-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
to_datetime returns NaT for epoch with errors='coerce' #11758
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
hmm, that does seem like a bug... pull-requests welcome! |
I will take this one. |
@engelmav want to do the PR? |
hey Jeff, sure. I don't have the fix yet. had to pause due to issues at On Sunday, January 24, 2016, Jeff Reback [email protected] wrote:
|
Similarly, this is also not working as desired
|
@jreback I was looking at this, and some questions: It seems this is deliberate, given the comment here: https://github.com/pydata/pandas/blob/084391126cc4edda35b41378d2905c788e5b573a/pandas/tslib.pyx#L2041 ("if we are coercing, dont' allow integers"). And I suppose this is to deal with the case of mixed types. For example, if you are parsing strings: But, I was also wondering, is there a reason we don't have a special path specifically for converting epochs (integers with
|
@jorisvandenbossche so it could be in a routine. What you could do is multiply then feed it back to |
further I suspect we can error out on the above example as
in fact could be a pre-processing step assume we pass thru the |
I think I can fix this shortly. |
xref #11760
Parsing unix epoch timestamps give NaT with
errors='coerce'
while they can be parsed correctly without it:pandas: 0.17.1
numpy: 1.10.1
Python 2.7.7
The text was updated successfully, but these errors were encountered: