Skip to content

Commit

Permalink
Fix resample tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel committed Nov 14, 2023
1 parent 4f30f5a commit 22291a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pandas/tests/resample/test_datetime_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1386,15 +1386,16 @@ def test_resample_timegrouper(dates, unit):


@pytest.mark.parametrize("dates", [dates1, dates2, dates3])
def test_resample_timegrouper2(dates):
def test_resample_timegrouper2(dates, unit):
dates = DatetimeIndex(dates).as_unit(unit)
df = DataFrame({"A": dates, "B": np.arange(len(dates)), "C": np.arange(len(dates))})
result = df.set_index("A").resample("ME").count()

exp_idx = DatetimeIndex(
["2014-07-31", "2014-08-31", "2014-09-30", "2014-10-31", "2014-11-30"],
freq="ME",
name="A",
)
).as_unit(unit)
expected = DataFrame(
{"B": [1, 0, 2, 2, 1], "C": [1, 0, 2, 2, 1]},
index=exp_idx,
Expand Down

0 comments on commit 22291a7

Please sign in to comment.