@@ -59,7 +59,6 @@ def test_rolling(self):
59
59
r = g .rolling (window = 4 )
60
60
61
61
for f in ["sum" , "mean" , "min" , "max" , "count" , "kurt" , "skew" ]:
62
-
63
62
result = getattr (r , f )()
64
63
expected = g .apply (lambda x : getattr (x .rolling (4 ), f )())
65
64
tm .assert_frame_equal (result , expected )
@@ -69,9 +68,10 @@ def test_rolling(self):
69
68
expected = g .apply (lambda x : getattr (x .rolling (4 ), f )(ddof = 1 ))
70
69
tm .assert_frame_equal (result , expected )
71
70
72
- result = r .quantile (0.5 )
73
- expected = g .apply (lambda x : x .rolling (4 ).quantile (0.5 ))
74
- tm .assert_frame_equal (result , expected )
71
+ for f in ["linear" , "lower" , "higher" , "midpoint" , "nearest" ]:
72
+ result = r .quantile (0.4 , interpolation = f )
73
+ expected = g .apply (lambda x : x .rolling (4 ).quantile (0.4 , interpolation = f ))
74
+ tm .assert_frame_equal (result , expected )
75
75
76
76
def test_rolling_corr_cov (self ):
77
77
g = self .frame .groupby ("A" )
@@ -141,9 +141,10 @@ def test_expanding(self):
141
141
expected = g .apply (lambda x : getattr (x .expanding (), f )(ddof = 0 ))
142
142
tm .assert_frame_equal (result , expected )
143
143
144
- result = r .quantile (0.5 )
145
- expected = g .apply (lambda x : x .expanding ().quantile (0.5 ))
146
- tm .assert_frame_equal (result , expected )
144
+ for f in ["linear" , "lower" , "higher" , "midpoint" , "nearest" ]:
145
+ result = r .quantile (0.4 , interpolation = f )
146
+ expected = g .apply (lambda x : x .expanding ().quantile (0.4 , interpolation = f ))
147
+ tm .assert_frame_equal (result , expected )
147
148
148
149
def test_expanding_corr_cov (self ):
149
150
g = self .frame .groupby ("A" )
0 commit comments