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
Resampling fence posts are off when upsampling < 1 Day.
In [5]: df = DataFrame(data=[[1, 3], [-5, 10], [0, 0]],index=pd.timedelta_range('00:00:00','00:10:00',freq='5T'))
In [6]: df.resample('1T').asfreq()
Out[6]:
0 1
00:00:00 1.0 3.0
00:01:00 NaN NaN
00:02:00 NaN NaN
00:03:00 NaN NaN
00:04:00 NaN NaN
00:05:00 -5.0 10.0
00:06:00 NaN NaN
00:07:00 NaN NaN
00:08:00 NaN NaN
00:09:00 NaN NaN
In [8]: df.resample('1T').mean()
Out[8]:
0 1
00:00:00 1.0 3.0
00:01:00 NaN NaN
00:02:00 NaN NaN
00:03:00 NaN NaN
00:04:00 NaN NaN
00:05:00 -5.0 10.0
00:06:00 NaN NaN
00:07:00 NaN NaN
00:08:00 NaN NaN
00:09:00 NaN NaN
00:10:00 0.0 0.0
The text was updated successfully, but these errors were encountered:
In [6]: from pandas import *
In [7]: rng = timedelta_range(start='1d', periods=10, freq='d')
In [8]: df = DataFrame({'value':range(10)}, index=rng)
In [9]: df.resample('2D').count()
Out[9]:
value
1 days 2
3 days 2
5 days 2
7 days 2
9 days 2
11 days 0
In [10]: df.resample('2D').asfreq()
Out[10]:
value
1 days 0
3 days 2
5 days 4
7 days 6
9 days 8
brought up in #12925
some examples in #15167
Resampling fence posts are off when upsampling < 1 Day.
The text was updated successfully, but these errors were encountered: