@@ -669,21 +669,15 @@ def test_rolling_axis(self, axis_frame):
669
669
670
670
def test_count_axis (self ):
671
671
# 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 ]})
676
674
677
675
# 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 )
687
681
688
682
689
683
class TestExpanding (Base ):
0 commit comments