Skip to content
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: datetime selection in a DataFrame should work in the where #3311

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

Comments

@jreback
Copy link
Contributor

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
@jreback

This comment has been minimized.

Copy link
Contributor Author

commented Apr 10, 2013

closed by #3312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.