Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pandas/tests/resample/test_datetime_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,19 @@ def test_resample_base():
tm.assert_index_equal(resampled.index, exp_rng)


def test_resample_float_base():
# GH25161
dt = pd.to_datetime(["2018-11-26 16:17:43.51",
"2018-11-26 16:17:44.51",
"2018-11-26 16:17:45.51"])
s = Series(np.arange(3), index=dt)

base = 17 + 43.51 / 60
result = s.resample("3min", base=base).size()
expected = Series(3, index=pd.DatetimeIndex(["2018-11-26 16:17:43.51"]))
assert_series_equal(result, expected)


def test_resample_daily_anchored():
rng = date_range('1/1/2000 0:00:00', periods=10000, freq='T')
ts = Series(np.random.randn(len(rng)), index=rng)
Expand Down