@@ -324,18 +324,18 @@ def test_apply_mixed_dtype_corner():
324
324
result = df [:0 ].apply (np .mean , axis = 1 )
325
325
# the result here is actually kind of ambiguous, should it be a Series
326
326
# or a DataFrame?
327
- expected = Series (np . nan , index = pd . Index ([], dtype = "int64" ) )
327
+ expected = Series (dtype = np . float64 )
328
328
tm .assert_series_equal (result , expected )
329
329
330
330
331
331
def test_apply_mixed_dtype_corner_indexing ():
332
332
df = DataFrame ({"A" : ["foo" ], "B" : [1.0 ]})
333
333
result = df .apply (lambda x : x ["A" ], axis = 1 )
334
- expected = Series (["foo" ], index = [ 0 ] )
334
+ expected = Series (["foo" ], index = range ( 1 ) )
335
335
tm .assert_series_equal (result , expected )
336
336
337
337
result = df .apply (lambda x : x ["B" ], axis = 1 )
338
- expected = Series ([1.0 ], index = [ 0 ] )
338
+ expected = Series ([1.0 ], index = range ( 1 ) )
339
339
tm .assert_series_equal (result , expected )
340
340
341
341
@@ -993,7 +993,7 @@ def test_result_type(int_frame_const_col):
993
993
994
994
result = df .apply (lambda x : [1 , 2 , 3 ], axis = 1 , result_type = "expand" )
995
995
expected = df .copy ()
996
- expected .columns = [ 0 , 1 , 2 ]
996
+ expected .columns = range ( 3 )
997
997
tm .assert_frame_equal (result , expected )
998
998
999
999
@@ -1003,7 +1003,7 @@ def test_result_type_shorter_list(int_frame_const_col):
1003
1003
df = int_frame_const_col
1004
1004
result = df .apply (lambda x : [1 , 2 ], axis = 1 , result_type = "expand" )
1005
1005
expected = df [["A" , "B" ]].copy ()
1006
- expected .columns = [ 0 , 1 ]
1006
+ expected .columns = range ( 2 )
1007
1007
tm .assert_frame_equal (result , expected )
1008
1008
1009
1009
0 commit comments