Skip to content

BUG: datetime selection in a DataFrame should work in the where #3311

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

Closed
jreback opened this issue Apr 10, 2013 · 1 comment · Fixed by #3312
Closed

BUG: datetime selection in a DataFrame should work in the where #3311

jreback opened this issue Apr 10, 2013 · 1 comment · Fixed by #3312
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Apr 10, 2013

I think something broke:

see: http://stackoverflow.com/questions/15927451/filter-on-pandas-dataframe-with-datetime-columns-raises-error/15927797?noredirect=1#comment22689922_15927797

This is wrong (should give rows > 0)

In [3]: df = pd.DataFrame(dict(A = pd.date_range('20130102',periods=5), B = pd.date_range('20130104',periods=5)))

In [4]: df
Out[4]: 
                    A                   B
0 2013-01-02 00:00:00 2013-01-04 00:00:00
1 2013-01-03 00:00:00 2013-01-05 00:00:00
2 2013-01-04 00:00:00 2013-01-06 00:00:00
3 2013-01-05 00:00:00 2013-01-07 00:00:00
4 2013-01-06 00:00:00 2013-01-08 00:00:00

In [5]: df[df>pd.Timestamp('20130103')]
Out[5]: 
                    A                   B
0 2013-01-02 00:00:00 2013-01-04 00:00:00
1 2013-01-03 00:00:00 2013-01-05 00:00:00
2 2013-01-04 00:00:00 2013-01-06 00:00:00
3 2013-01-05 00:00:00 2013-01-07 00:00:00
4 2013-01-06 00:00:00 2013-01-08 00:00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Dtype Conversions Unexpected or buggy dtype conversions Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant