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