@@ -841,7 +841,6 @@ def test_map_with_series_all_indices(self):
841
841
self .assert_numpy_array_equal (expected .values .get_values (), output .values .get_values ())
842
842
self .assert_equal (expected .name , output .name )
843
843
844
-
845
844
for name in list (set (self .indices .keys ()) - set (special )):
846
845
cur_index = self .indices [name ]
847
846
expected = Index (np .arange (len (cur_index ), 0 , - 1 ))
@@ -861,12 +860,16 @@ def test_map_with_categorical_series(self):
861
860
exp = Index (["odd" , "even" , "odd" , np .nan ])
862
861
self .assert_index_equal (a .map (c ), exp )
863
862
864
- def test_map_with_series_missing_values (self ):
863
+ def test_map_with_non_function_missing_values (self ):
865
864
# GH 12756
866
865
expected = Index ([2. , np .nan , 'foo' ])
866
+ input = Index ([2 , 1 , 0 ])
867
+
867
868
mapper = Series (['foo' , 2. , 'baz' ], index = [0 , 2 , - 1 ])
868
- output = Index ([2 , 1 , 0 ]).map (mapper )
869
- self .assert_index_equal (output , expected )
869
+ self .assert_index_equal (expected , input .map (mapper ))
870
+
871
+ mapper = {0 : 'foo' , 2 : 2.0 , - 1 : 'baz' }
872
+ self .assert_index_equal (expected , input .map (mapper ))
870
873
871
874
def test_append_multiple (self ):
872
875
index = Index (['a' , 'b' , 'c' , 'd' , 'e' , 'f' ])
0 commit comments