user2003052
user2003052

Reputation: 119

Pandas CSV all data NaN - file issues

I have a 'csv' file that is exported by a piece of equipment which I am trying to open with Pandas. All data is marked as NaN.

enter image description here

The first bunch of rows are being skipped due to irrelevant data being dropped. Row 70 contains the desired column headings.

After investigating I have determined that the csv file does not import correctly, but if I open the file in excel and 'save as' a csv file the data loads, but the default import creates 230 rows with only a single column. Note: adding sep=',' does not help here.

enter image description here

Finally if I open the excel csv, and copy and paste the first column to a text editor, then save that as a csv, everything works fine. It seems apparent that the original exported file for the equipment is not exporting as purely as I need it.

enter image description here

What is the best way to manage this? (have not shared the csv as I'm not sure if it would help my question).

Upvotes: 1

Views: 161

Answers (1)

user2003052
user2003052

Reputation: 119

The answer lies in the encoding... I guess I missed that.

Upvotes: 1

Related Questions