@@ -643,7 +643,7 @@ def f(x):
643
643
644
644
self ._check_moment_func (np .mean , name = "apply" , func = f , raw = raw )
645
645
646
- expected = Series ([] )
646
+ expected = Series (dtype = "float64" )
647
647
result = expected .rolling (10 ).apply (lambda x : x .mean (), raw = raw )
648
648
tm .assert_series_equal (result , expected )
649
649
@@ -1170,7 +1170,7 @@ def _check_ew(self, name=None, preserve_nan=False):
1170
1170
1171
1171
# check series of length 0
1172
1172
result = getattr (Series ().ewm (com = 50 , min_periods = min_periods ), name )()
1173
- tm .assert_series_equal (result , Series ())
1173
+ tm .assert_series_equal (result , Series (dtype = "float64" ))
1174
1174
1175
1175
# check series of length 1
1176
1176
result = getattr (Series ([1.0 ]).ewm (50 , min_periods = min_periods ), name )()
@@ -1965,8 +1965,8 @@ def func(A, B, com, **kwargs):
1965
1965
assert not np .isnan (result .values [11 :]).any ()
1966
1966
1967
1967
# check series of length 0
1968
- result = func (Series ([] ), Series ([] ), 50 , min_periods = min_periods )
1969
- tm .assert_series_equal (result , Series ([] ))
1968
+ result = func (Series (), Series (), 50 , min_periods = min_periods )
1969
+ tm .assert_series_equal (result , Series (dtype = "float64" ))
1970
1970
1971
1971
# check series of length 1
1972
1972
result = func (Series ([1.0 ]), Series ([1.0 ]), 50 , min_periods = min_periods )
@@ -2166,7 +2166,7 @@ def test_rolling_functions_window_non_shrinkage_binary(self):
2166
2166
2167
2167
def test_moment_functions_zero_length (self ):
2168
2168
# GH 8056
2169
- s = Series ()
2169
+ s = Series (dtype = "float64" )
2170
2170
s_expected = s
2171
2171
df1 = DataFrame ()
2172
2172
df1_expected = df1
@@ -2385,7 +2385,7 @@ def expanding_mean(x, min_periods=1):
2385
2385
# here to make this pass
2386
2386
self ._check_expanding (expanding_mean , np .mean , preserve_nan = False )
2387
2387
2388
- ser = Series ([])
2388
+ ser = Series ([], dtype = "float64" )
2389
2389
tm .assert_series_equal (ser , ser .expanding ().apply (lambda x : x .mean (), raw = raw ))
2390
2390
2391
2391
# GH 8080
0 commit comments