@@ -2929,20 +2929,20 @@ def test_isin(self):
2929
2929
2930
2930
def test_fillna_int (self ):
2931
2931
s = Series (np .random .randint (- 100 , 100 , 50 ))
2932
- self .assert_ (s .fillna (inplace = True ) is s )
2933
- assert_series_equal (s .fillna (inplace = False ), s )
2932
+ self .assert_ (s .fillna (method = 'ffill' , inplace = True ) is s )
2933
+ assert_series_equal (s .fillna (method = 'ffill' , inplace = False ), s )
2934
2934
2935
2935
#-------------------------------------------------------------------------------
2936
2936
# TimeSeries-specific
2937
2937
2938
2938
def test_fillna (self ):
2939
2939
ts = Series ([0. , 1. , 2. , 3. , 4. ], index = tm .makeDateIndex (5 ))
2940
2940
2941
- self .assert_ (np .array_equal (ts , ts .fillna ()))
2941
+ self .assert_ (np .array_equal (ts , ts .fillna (method = 'ffill' )))
2942
2942
2943
2943
ts [2 ] = np .NaN
2944
2944
2945
- self .assert_ (np .array_equal (ts .fillna (), [0. , 1. , 1. , 3. , 4. ]))
2945
+ self .assert_ (np .array_equal (ts .fillna (method = 'ffill' ), [0. , 1. , 1. , 3. , 4. ]))
2946
2946
self .assert_ (np .array_equal (ts .fillna (method = 'backfill' ),
2947
2947
[0. , 1. , 3. , 3. , 4. ]))
2948
2948
@@ -2974,6 +2974,9 @@ def test_fillna_invalid_method(self):
2974
2974
except ValueError , inst :
2975
2975
self .assert_ ('ffil' in str (inst ))
2976
2976
2977
+ def test_fillna_toomany_params (self ):
2978
+ self .assertRaises (ValueError , self .ts .fillna , value = 0 , method = 'ffill' )
2979
+
2977
2980
def test_replace (self ):
2978
2981
N = 100
2979
2982
ser = Series (np .random .randn (N ))
0 commit comments