You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [2]: pi = pd.PeriodIndex(['1970-01-01 00:00:00', pd.NaT, '1970-01-01 00:00:02'], freq='S')
In [3]: pd.DataFrame([2, 3, 5], pi).resample('1s').mean()
...
ValueError: Start and end must not be NaT
But DatetimeIndex obtained from PeriodIndex can:
In [4]: pd.DataFrame([2, 3, 5], pi.to_datetime()).resample('1s').mean()
Out[4]:
0
1970-01-01 00:00:00 2.0
1970-01-01 00:00:01 NaN
1970-01-01 00:00:02 5.0
Shouldn't these behave the same?
Versions:
python: 2.7.11.final.0
OS: Linux
machine: x86_64
pandas: 0.18.1+38.gc7e6f5f.dirty
numpy: 1.10.2
The text was updated successfully, but these errors were encountered:
PeriodIndex
can't handleNaT
:But
DatetimeIndex
obtained fromPeriodIndex
can:Shouldn't these behave the same?
Versions:
The text was updated successfully, but these errors were encountered: