-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Don't parse index column as numeric when parse_dates=True #14077
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
BUG: Don't parse index column as numeric when parse_dates=True #14077
Conversation
b7cfef0
to
68ecee3
Compare
this is related to #9435 (though don't think this fixes) |
@@ -1474,6 +1474,13 @@ def _set(x): | |||
else: | |||
_set(val) | |||
|
|||
elif self.parse_dates: | |||
if isinstance(self.index_col, list): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_list_like
? (I don't know if its coerced to a list before this), same below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need to handle dict
at this point? (or is that already transformed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
index_col
can never be a dict
per the docs.
If you're referring to parse_dates
, parse_dates
being a dict
has a completely different meaning that is independent of the index_col
.
68ecee3
to
235d624
Compare
Current coverage is 85.26% (diff: 75.00%)@@ master #14077 diff @@
==========================================
Files 139 139
Lines 50492 50504 +12
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43053 43061 +8
- Misses 7439 7443 +4
Partials 0 0
|
bce56d0
to
676c606
Compare
When a thousands parameter is specified, if the index column data contains that thousands value for date purposes (e.g. '.'), do not interpret those characters as the thousands parameter. Closes pandas-devgh-14066.
676c606
to
f2ed334
Compare
tm.assert_frame_equal(result, expected) | ||
|
||
expected = DataFrame([[datetime(2016, 4, 15), | ||
datetime(2013, 9, 16)]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a dict for parse_dates
as well
@jreback : Travis is passing, so this is ready to merge if there are no other concerns. |
@gfyoung Thanks! |
When a thousands parameter is specified, if the index column data contains that thousands value for date purposes (e.g. '.'), do not interpret those characters as the thousands parameter.
Closes #14066.