@@ -674,7 +674,7 @@ def f(x):
674
674
675
675
self ._check_moment_func (np .mean , name = "apply" , func = f , raw = raw )
676
676
677
- expected = Series ([] )
677
+ expected = Series (dtype = "float64" )
678
678
result = expected .rolling (10 ).apply (lambda x : x .mean (), raw = raw )
679
679
tm .assert_series_equal (result , expected )
680
680
@@ -1201,7 +1201,7 @@ def _check_ew(self, name=None, preserve_nan=False):
1201
1201
1202
1202
# check series of length 0
1203
1203
result = getattr (Series ().ewm (com = 50 , min_periods = min_periods ), name )()
1204
- tm .assert_series_equal (result , Series ())
1204
+ tm .assert_series_equal (result , Series (dtype = "float64" ))
1205
1205
1206
1206
# check series of length 1
1207
1207
result = getattr (Series ([1.0 ]).ewm (50 , min_periods = min_periods ), name )()
@@ -1996,8 +1996,8 @@ def func(A, B, com, **kwargs):
1996
1996
assert not np .isnan (result .values [11 :]).any ()
1997
1997
1998
1998
# check series of length 0
1999
- result = func (Series ([] ), Series ([] ), 50 , min_periods = min_periods )
2000
- tm .assert_series_equal (result , Series ([] ))
1999
+ result = func (Series (), Series (), 50 , min_periods = min_periods )
2000
+ tm .assert_series_equal (result , Series (dtype = "float64" ))
2001
2001
2002
2002
# check series of length 1
2003
2003
result = func (Series ([1.0 ]), Series ([1.0 ]), 50 , min_periods = min_periods )
@@ -2197,7 +2197,7 @@ def test_rolling_functions_window_non_shrinkage_binary(self):
2197
2197
2198
2198
def test_moment_functions_zero_length (self ):
2199
2199
# GH 8056
2200
- s = Series ()
2200
+ s = Series (dtype = "float64" )
2201
2201
s_expected = s
2202
2202
df1 = DataFrame ()
2203
2203
df1_expected = df1
@@ -2416,7 +2416,7 @@ def expanding_mean(x, min_periods=1):
2416
2416
# here to make this pass
2417
2417
self ._check_expanding (expanding_mean , np .mean , preserve_nan = False )
2418
2418
2419
- ser = Series ([])
2419
+ ser = Series ([], dtype = "float64" )
2420
2420
tm .assert_series_equal (ser , ser .expanding ().apply (lambda x : x .mean (), raw = raw ))
2421
2421
2422
2422
# GH 8080
0 commit comments