@@ -769,7 +769,7 @@ def test_sub(self):
769
769
def test_map_identity_mapping (self ):
770
770
# GH 12766
771
771
for name , cur_index in self .indices .items ():
772
- self .assert_index_equal (cur_index , cur_index .map (lambda x : x ))
772
+ tm .assert_index_equal (cur_index , cur_index .map (lambda x : x ))
773
773
774
774
def test_map_with_tuples (self ):
775
775
# GH 12766
@@ -778,35 +778,35 @@ def test_map_with_tuples(self):
778
778
# returns an Index.
779
779
boolean_index = tm .makeIntIndex (3 ).map (lambda x : (x ,))
780
780
expected = Index ([(0 ,), (1 ,), (2 ,)])
781
- self .assert_index_equal (boolean_index , expected )
781
+ tm .assert_index_equal (boolean_index , expected )
782
782
783
783
# Test that returning a tuple from a map of a single index
784
784
# returns a MultiIndex object.
785
785
boolean_index = tm .makeIntIndex (3 ).map (lambda x : (x , x == 1 ))
786
786
expected = MultiIndex .from_tuples ([(0 , False ), (1 , True ), (2 , False )])
787
- self .assert_index_equal (boolean_index , expected )
787
+ tm .assert_index_equal (boolean_index , expected )
788
788
789
789
# Test that returning a single object from a MultiIndex
790
790
# returns an Index.
791
791
first_level = ['foo' , 'bar' , 'baz' ]
792
792
multi_index = MultiIndex .from_tuples (lzip (first_level , [1 , 2 , 3 ]))
793
793
reduced_index = multi_index .map (lambda x : x [0 ])
794
- self .assert_index_equal (reduced_index , Index (first_level ))
794
+ tm .assert_index_equal (reduced_index , Index (first_level ))
795
795
796
796
def test_map_tseries_indices_return_index (self ):
797
797
date_index = tm .makeDateIndex (10 )
798
798
exp = Index ([1 ] * 10 )
799
- self .assert_index_equal (exp , date_index .map (lambda x : 1 ))
799
+ tm .assert_index_equal (exp , date_index .map (lambda x : 1 ))
800
800
801
801
period_index = tm .makePeriodIndex (10 )
802
- self .assert_index_equal (exp , period_index .map (lambda x : 1 ))
802
+ tm .assert_index_equal (exp , period_index .map (lambda x : 1 ))
803
803
804
804
tdelta_index = tm .makeTimedeltaIndex (10 )
805
- self .assert_index_equal (exp , tdelta_index .map (lambda x : 1 ))
805
+ tm .assert_index_equal (exp , tdelta_index .map (lambda x : 1 ))
806
806
807
807
date_index = tm .makeDateIndex (24 , freq = 'h' , name = 'hourly' )
808
808
exp = Index (range (24 ), name = 'hourly' )
809
- self .assert_index_equal (exp , date_index .map (lambda x : x .hour ))
809
+ tm .assert_index_equal (exp , date_index .map (lambda x : x .hour ))
810
810
811
811
def test_append_multiple (self ):
812
812
index = Index (['a' , 'b' , 'c' , 'd' , 'e' , 'f' ])
0 commit comments