-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Description
import pandas as pd
from numpy.random import rand
idx = pd.date_range(start='5/20/2013', end='5/21/2013')
df = pd.DataFrame({k:(100*rand(len(idx))).astype('int') for k in ['6', '36']}, index=idx)
everything looks fine:
>>> df
36 6
2013-05-20 58 23
2013-05-21 68 31
and even this works:
>>> df['6']
2013-05-20 23
2013-05-21 31
Freq: D, Name: 6, dtype: int32
but this is one fails:
>>> df['36']
Empty DataFrame
Columns: [36, 6]
Index: []
it seems to me the problem comes from a 'DatetimeIndex', because this works fine:
>>> df.index = [d.date() for d in df.index]
>>> df['36']
2013-05-20 58
2013-05-21 68
Name: 36, dtype: int32
Metadata
Metadata
Assignees
Labels
No labels