@@ -3760,6 +3760,53 @@ def test_min(self):
3760
3760
self ._check_stat_op ('min' , np .min )
3761
3761
self ._check_stat_op ('min' , np .min , frame = self .intframe )
3762
3762
3763
+ def test_cummin (self ):
3764
+ self .tsframe .ix [5 :10 , 0 ] = nan
3765
+ self .tsframe .ix [10 :15 , 1 ] = nan
3766
+ self .tsframe .ix [15 :, 2 ] = nan
3767
+
3768
+ # axis = 0
3769
+ cummin = self .tsframe .cummin ()
3770
+ expected = self .tsframe .apply (Series .cummin )
3771
+ assert_frame_equal (cummin , expected )
3772
+
3773
+ # axis = 1
3774
+ cummin = self .tsframe .cummin (axis = 1 )
3775
+ expected = self .tsframe .apply (Series .cummin , axis = 1 )
3776
+ assert_frame_equal (cummin , expected )
3777
+
3778
+ # works
3779
+ df = DataFrame ({'A' : np .arange (20 )}, index = np .arange (20 ))
3780
+ result = df .cummin ()
3781
+
3782
+ # fix issue
3783
+ cummin_xs = self .tsframe .cummin (axis = 1 )
3784
+ self .assertEqual (np .shape (cummin_xs ), np .shape (self .tsframe ))
3785
+
3786
+ def test_cummax (self ):
3787
+ self .tsframe .ix [5 :10 , 0 ] = nan
3788
+ self .tsframe .ix [10 :15 , 1 ] = nan
3789
+ self .tsframe .ix [15 :, 2 ] = nan
3790
+
3791
+ # axis = 0
3792
+ cummax = self .tsframe .cummax ()
3793
+ expected = self .tsframe .apply (Series .cummax )
3794
+ assert_frame_equal (cummax , expected )
3795
+
3796
+ # axis = 1
3797
+ cummax = self .tsframe .cummax (axis = 1 )
3798
+ expected = self .tsframe .apply (Series .cummax , axis = 1 )
3799
+ assert_frame_equal (cummax , expected )
3800
+
3801
+ # works
3802
+ df = DataFrame ({'A' : np .arange (20 )}, index = np .arange (20 ))
3803
+ result = df .cummax ()
3804
+
3805
+ # fix issue
3806
+ cummax_xs = self .tsframe .cummax (axis = 1 )
3807
+ self .assertEqual (np .shape (cummax_xs ), np .shape (self .tsframe ))
3808
+
3809
+
3763
3810
def test_max (self ):
3764
3811
self ._check_stat_op ('max' , np .max )
3765
3812
self ._check_stat_op ('max' , np .max , frame = self .intframe )
0 commit comments