@@ -830,7 +830,6 @@ def test_map_with_series_all_indices(self):
830
830
self .assert_numpy_array_equal (expected .values .get_values (), output .values .get_values ())
831
831
self .assert_equal (expected .name , output .name )
832
832
833
-
834
833
for name in list (set (self .indices .keys ()) - set (special )):
835
834
cur_index = self .indices [name ]
836
835
expected = Index (np .arange (len (cur_index ), 0 , - 1 ))
@@ -850,12 +849,16 @@ def test_map_with_categorical_series(self):
850
849
exp = Index (["odd" , "even" , "odd" , np .nan ])
851
850
self .assert_index_equal (a .map (c ), exp )
852
851
853
- def test_map_with_series_missing_values (self ):
852
+ def test_map_with_non_function_missing_values (self ):
854
853
# GH 12756
855
854
expected = Index ([2. , np .nan , 'foo' ])
855
+ input = Index ([2 , 1 , 0 ])
856
+
856
857
mapper = Series (['foo' , 2. , 'baz' ], index = [0 , 2 , - 1 ])
857
- output = Index ([2 , 1 , 0 ]).map (mapper )
858
- self .assert_index_equal (output , expected )
858
+ self .assert_index_equal (expected , input .map (mapper ))
859
+
860
+ mapper = {0 : 'foo' , 2 : 2.0 , - 1 : 'baz' }
861
+ self .assert_index_equal (expected , input .map (mapper ))
859
862
860
863
def test_append_multiple (self ):
861
864
index = Index (['a' , 'b' , 'c' , 'd' , 'e' , 'f' ])
0 commit comments