Problems with numpy + csv
Data: file with the .npy numpy mass (text data)
The task is to translate it into .csv format.
Problem: after storing np.savetxt(), it will not be possible to restore the file from the csv file - a error will come out:
ValueError: Wrong number of columns at line 9 (in fact, if you use different separators, the number of line may change)
I’ve checked 25 times that the column is exactly as much as it should be. Also, Open Office opens such a csv file without any problems and does not shame - that is, it has no problems with the number of columns.
If my eyes are mistaken, I don’t consider anything.
I have already tried different separators, even the most exotic (to exclude the possibility of the appearance of extra columns due to the appearance in the text of the separator symbol.
Nothing helps.
I'm crying for the code that will save the output mass in the csv and then this csv will be downloaded without mistakes by the method np.loadtxt()
by P.S. When saving the method np.savetxt(), I recommend using the parameters:encoding='utf-8' and fmt='%s'
Applications 1
Client's review of cooperation with Yevgeny N.
Problems with numpy + csvThank you for the quick and professional solution to the problem. I recommend it as a great specialist.
Freelancer's review of cooperation with Aleksey Fedchishin
Problems with numpy + csvEverything is good. I recommend cooperation.
-
Добрый день, задание ещё актуально?
-
deleted by moderator
-
Current freelance projects in the category Desktop Apps
Account reconciliation tool with the bank, cards, and accountantTechnical Assignment: Tool for Reconciling Accounts with Bank, Cards, and AccountantGeneral Goal A local tool (script/small application in Python) is needed, which is manually run once every 1-2 months on my computer and performs reconciliation between: Invoices I issued to… Python, Desktop Apps ∙ 2 days 6 hours back ∙ 39 proposals |
Add pauses of 10-30 seconds between sending emails.Hello! I am looking for an experienced 1C / BAS (BAF) programmer to promptly resolve a technical issue with email distribution.Problem essence: We use the accounting program BAF (Business Automation Framework), version 2.0. Once a month, there is a need to send about 300 emails… Web Programming, Desktop Apps ∙ 7 days 22 hours back ∙ 10 proposals |
Reverse engineering of console utilities for querying SSD controllers (Flash ID)1. Purpose of the work Extraction of the application programming interface (API) for interaction with SSD/NVMe controllers from the provided set of console utilities (Phison, Silicon Motion, Realtek, Maxiotek, Marvell, JMicron, etc.). The result should be working code in C/C++… C & C++, Desktop Apps ∙ 8 days 9 hours back ∙ 6 proposals |