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