Skip to content

Commit a731549

Browse files
committed
apply the review comments
1 parent 53252a0 commit a731549

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pandas/tests/resample/test_timedelta.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,16 @@ def test_resample_timedelta_edge_case(start, end, freq, resample_freq):
152152
assert not np.isnan(result[-1])
153153

154154

155-
def test_resample_timedelta_no_empty_groups():
155+
def test_resample_with_timedelta_yields_no_empty_groups():
156156
# GH 10603
157-
# check that resample does not yield empty groups
158-
df = pd.DataFrame(np.random.normal(size=(10000, 4)))
159-
df.index = pd.timedelta_range(start="0s", periods=10000, freq="3906250n")
157+
df = pd.DataFrame(
158+
np.random.normal(size=(10000, 4)),
159+
index=pd.timedelta_range(start="0s", periods=10000, freq="3906250n"),
160+
)
160161
result = df.loc["1s":, :].resample("3s").apply(lambda x: len(x))
161162

162-
expected = pd.DataFrame([[768.0] * 4] * 12 + [[528.0] * 4])
163-
expected.index = pd.timedelta_range(start="1s", periods=13, freq="3s")
163+
expected = pd.DataFrame(
164+
[[768.0] * 4] * 12 + [[528.0] * 4],
165+
index=pd.timedelta_range(start="1s", periods=13, freq="3s"),
166+
)
164167
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)