Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

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

Comments

Projects
None yet
1 participant
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
Contributor

jreback commented Apr 10, 2013

closed by #3312

@jreback jreback closed this Apr 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment