@@ -848,7 +848,6 @@ def test_map_with_series_all_indices(self):
848
848
self .assert_numpy_array_equal (expected .values .get_values (), output .values .get_values ())
849
849
self .assert_equal (expected .name , output .name )
850
850
851
-
852
851
for name in list (set (self .indices .keys ()) - set (special )):
853
852
cur_index = self .indices [name ]
854
853
expected = Index (np .arange (len (cur_index ), 0 , - 1 ))
@@ -868,12 +867,16 @@ def test_map_with_categorical_series(self):
868
867
exp = Index (["odd" , "even" , "odd" , np .nan ])
869
868
self .assert_index_equal (a .map (c ), exp )
870
869
871
- def test_map_with_series_missing_values (self ):
870
+ def test_map_with_non_function_missing_values (self ):
872
871
# GH 12756
873
872
expected = Index ([2. , np .nan , 'foo' ])
873
+ input = Index ([2 , 1 , 0 ])
874
+
874
875
mapper = Series (['foo' , 2. , 'baz' ], index = [0 , 2 , - 1 ])
875
- output = Index ([2 , 1 , 0 ]).map (mapper )
876
- self .assert_index_equal (output , expected )
876
+ self .assert_index_equal (expected , input .map (mapper ))
877
+
878
+ mapper = {0 : 'foo' , 2 : 2.0 , - 1 : 'baz' }
879
+ self .assert_index_equal (expected , input .map (mapper ))
877
880
878
881
def test_append_multiple (self ):
879
882
index = Index (['a' , 'b' , 'c' , 'd' , 'e' , 'f' ])
0 commit comments