Skip to content

Commit faef86b

Browse files
committed
TST: GH26055 rebasing with master
1 parent 75115e6 commit faef86b

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

pandas/tests/test_window.py

+7-13
Original file line numberDiff line numberDiff line change
@@ -669,21 +669,15 @@ def test_rolling_axis(self, axis_frame):
669669

670670
def test_count_axis(self):
671671
# see gh-26055
672-
df = pd.DataFrame({'x': range(5), 'y': range(5)})
673-
674-
df_correct_row_count = pd.DataFrame({'x': [1.0, 2.0, 2.0, 2.0, 2.0],
675-
'y': [1.0, 2.0, 2.0, 2.0, 2.0]})
672+
df = DataFrame({'x': range(3), 'y': range(3)})
673+
df_row = DataFrame({'x': [1.0, 2.0, 2.0], 'y': [1.0, 2.0, 2.0]})
676674

677675
# not specifiying axis and making axis=rows should be the same result
678-
tm.assert_frame_equal(df.rolling(2).count(), df_correct_row_count)
679-
tm.assert_frame_equal(df.rolling(2, axis='rows').count(),
680-
df_correct_row_count)
681-
682-
df_correct_column_count = pd.DataFrame({'x': [1.0, 1.0, 1.0, 1.0, 1.0],
683-
'y': [2.0, 2.0, 2.0, 2.0, 2.0]}
684-
)
685-
tm.assert_frame_equal(df.rolling(2, axis='columns').count(),
686-
df_correct_column_count)
676+
tm.assert_frame_equal(df.rolling(2).count(), df_row)
677+
tm.assert_frame_equal(df.rolling(2, axis='rows').count(), df_row)
678+
679+
df_col = DataFrame({'x': [1.0, 1.0, 1.0], 'y': [2.0, 2.0, 2.0]})
680+
tm.assert_frame_equal(df.rolling(2, axis='columns').count(), df_col)
687681

688682

689683
class TestExpanding(Base):

0 commit comments

Comments
 (0)