Skip to content

Commit ee9fa7e

Browse files
committed
ENH: gb.is_monotonic_increasing pandas-dev#17015 tests revised and passing
1 parent ee9eb01 commit ee9fa7e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pandas/tests/groupby/test_groupby.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -2610,9 +2610,9 @@ def test_is_monotonic_increasing(self, in_vals, out_vals):
26102610
'B': ['a', 'a', 'a', 'b', 'b', 'b', 'c', 'c', 'c', 'd', 'd'],
26112611
'C': in_vals}
26122612
df = pd.DataFrame(source_dict)
2613-
result = df.groupby(['B']).C.is_monotonic_increasing()
2614-
expected = pd.Series(index=list('abcd'), name='B')
2615-
2613+
result = df.groupby('B').C.is_monotonic_increasing()
2614+
expected = pd.Series(index=list('abcd'), data=out_vals, name='C')
2615+
expected.index.name = 'B'
26162616
tm.assert_series_equal(result, expected)
26172617

26182618
# Also check result equal to manually taking x.is_monotonic_increasing.
@@ -2641,7 +2641,8 @@ def test_is_monotonic_decreasing(self, in_vals, out_vals):
26412641

26422642
df = pd.DataFrame(source_dict)
26432643
result = df.groupby('B').C.is_monotonic_decreasing()
2644-
expected = pd.Series(index=list('abcd'), name='B')
2644+
expected = pd.Series(index=list('abcd'), data=out_vals, name='C')
2645+
expected.index.name = 'B'
26452646
tm.assert_series_equal(result, expected)
26462647

26472648
def test_apply_numeric_coercion_when_datetime(self):

0 commit comments

Comments
 (0)