Skip to content

BUG: value_counts may raise OutOfBoundsDatetime #13772

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

Merged
merged 1 commit into from
Jul 24, 2016

Conversation

sinhrks
Copy link
Member

@sinhrks sinhrks commented Jul 24, 2016

The root cause looks normal Index raises OutOfBoudsDatetime. I think it should be coerced to object dtype because user specifies no dtype.

pd.Index([datetime(9999, 1, 1)])
# on current master
# OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 9999-01-01 00:00:00

# this PR
Index([9999-01-01 00:00:00], dtype='object')

@sinhrks sinhrks added Bug Datetime Datetime data dtype labels Jul 24, 2016
@sinhrks sinhrks added this to the 0.19.0 milestone Jul 24, 2016
@codecov-io
Copy link

codecov-io commented Jul 24, 2016

Current coverage is 84.57% (diff: 100%)

No coverage report found for master at b60e42b.

Powered by Codecov. Last update b60e42b...533bba3

@TomAugspurger
Copy link
Contributor

Gave a quick look, everything looks good.

Slightly OT, do we have a convention on import datetime vs. from datetime import datetime? You changed it to the second version, which seems to be slightly more common in the codebase? Might be nice to standardize that everywhere.

@jreback jreback merged commit 0067b90 into pandas-dev:master Jul 24, 2016
@jreback
Copy link
Contributor

jreback commented Jul 24, 2016

thanks @sinhrks

yeah @TomAugspurger there is a bit of differences on import, though generally not back; we mostly from datetime import datetime which is the correct idiom here. Could change if someone wants to put in the effort :>

pls make an issue.

@sinhrks
Copy link
Member Author

sinhrks commented Jul 24, 2016

yeah, from datetime import datetime looks commonto meet with < 80 chars. Though i don't have strong opinion about it.

@sinhrks sinhrks deleted the index_outofbounds branch July 24, 2016 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

series with datetime raises pandas.tslib.OutOfBoundsDatetime on value_counts()
4 participants