Skip to content

Commit 277182c

Browse files
committed
Use a more obvious test
1 parent b9cf210 commit 277182c

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

doc/source/whatsnew/v0.20.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ Performance Improvements
280280

281281
- Improved performance of ``pd.wide_to_long()`` (:issue:`14779`)
282282
- Increased performance of ``pd.factorize()`` by releasing the GIL with ``object`` dtype when inferred as strings (:issue:`14859`)
283-
- Increased performance of ``groupby().cummin()`` and ``groupby().cummax()`` (:issue:`15048`)
283+
- Improved performance of ``groupby().cummin()`` and ``groupby().cummax()`` (:issue:`15048`)
284284

285285

286286
.. _whatsnew_0200.bug_fixes:

pandas/tests/groupby/test_groupby.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -5770,14 +5770,16 @@ def test_agg_over_numpy_arrays(self):
57705770
assert_frame_equal(result, expected)
57715771

57725772
def test_cummin_cummax(self):
5773-
df = pd.DataFrame({'A': np.random.randint(0, 5, size=100),
5774-
'B': np.random.randn(100)})
5773+
df = pd.DataFrame({'A': [1, 1, 1, 2, 2, 2],
5774+
'B': range(3, 9)})
57755775
result = df.groupby('A').cummin()
5776-
expected = df.groupby('A').apply(np.minimum.accumulate)['B'].to_frame()
5776+
expected = pd.DataFrame({'B': [3, 3, 3, 6, 6, 6]})
57775777
tm.assert_frame_equal(result, expected)
57785778

5779+
df = pd.DataFrame({'A': [1, 1, 1, 2, 2, 2],
5780+
'B': range(8, 2, -1)})
57795781
result = df.groupby('A').cummax()
5780-
expected = df.groupby('A').apply(np.maximum.accumulate)['B'].to_frame()
5782+
expected = pd.DataFrame({'B': [5, 5, 5, 8, 8, 8]})
57815783
tm.assert_frame_equal(result, expected)
57825784

57835785

0 commit comments

Comments
 (0)