LostKobrakai

LostKobrakai

If that’s the reasoning then this is a bad error though. Not sure why they’d push such domain specific requirements into what seems to be an otherwise fully capable parser for csv. If they don’t expect multi line headers that’s not a problem with the csv, but with the supplied data.

0
Post #11
BradS2S

BradS2S

I’m a guy coming from Python and just the idea of having a new line character in a header row is like saying you are from outer space :slight_smile:

0
Post #12
LostKobrakai

LostKobrakai

I’m totally fine with headers be required to be single line. I’m just argueing that this should not be a CSV parsing error, but a proper “hey we need you to have single line headers” error.

2
Post #13
BradS2S

BradS2S

Oh yes the error message could be more helpful but it is a parsing error. It sees the newline character as a new row. It looks forward and sees mostly numbers in the row so it decides to infer int64 which doesn’t work for the second half of the string.

3
Post #14
LostKobrakai

LostKobrakai

Given it seems to be able to deal with newlines in data fields just fine it doesn’t need to be a parsing error though.

0
Post #15
alphydan

alphydan OP

And yet, pandas can process \n in the header or in the fields if they are quoted.

The csv:

"Timestamp (ISO)",Animal Type,Animal Color,"Friends $
of Given Animal","Another Timestamp$
 (ISO)",Feedstock,"Favorite food for Animal",Feed Amount,Feed Frequency^M$
2023,"Tiger and $
Beasts",Yellow,Lion,2023-03-14,3,meat,32.2,weekly^M$

is imported by pandas as:

Timestamp (ISO)	Animal Type	Animal Color	Friends \n of Given Animal	Another Timestamp\n (ISO)	Feedstock	Favorite food for Animal	Feed Amount	Feed Frequency
0	2023	Tiger and \nBeasts	Yellow	Lion	2023-03-14	3	meat	32.2	weekly
1	2023	Tiger	Yellow	Lion	2023-03-14	3	meat	32.2	weekly

Should I give feedback to the Explorer library?

1
Post #16
BradS2S

BradS2S

Yeah that might not be bad to submit

1
Post #17
— All posts loaded —