-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Dates are parsed with read_csv thousand seperator #4678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm not an expert on this IO code just yet, but it would seem that maybe the numeric parser is running first? In that case, we wouldn't even try the datetime converter, would we? https://github.com/pydata/pandas/blob/master/pandas/parser.pyx#L1648 |
things are parsed (with thousands/decimal substituions) then passed to the dtype converter (and na converter), so I think this would have to change based on if parse_dates is True for a particular column; might be tricky (or not) |
@guyrt having a look at this? |
@jreback I am. Got sidetracked on a few other things, but I'll carve out some time to look at it over the next few days. What I know so far is that the second example works on the python parser. It's not clear yet what is causing it to fail on the c parser but I'll keep digging. The first example is a problem with the date parser, which doesn't parse the day part correctly. |
Fix for C parser submitted, but I found an error in Python parser as well. That one will come in next commit. |
Fixes issue where thousands separator could conflict with date parsing. This is only fixed in the C parser. Closes issue pandas-dev#4678
When reading a csv with a date column, the date is sometimes parsed as a number:
Here
06.02.2013
is read as a number0602013
before the date is parsed (which fails)... I think dates are sometimes written this way on the continent (along with . thousands).This was found in #4322 (but that issue was more about . being ignored), I guess another test case would be with
-
:@jreback suggests:
cc #4598 @guyrt
The text was updated successfully, but these errors were encountered: