@@ -351,30 +351,25 @@ def test_concat_axis_parameter(self):
351
351
# GH 14369
352
352
df1 = pd .DataFrame ({'A' : [0.1 , 0.2 ]}, index = range (2 ))
353
353
df2 = pd .DataFrame ({'A' : [0.3 , 0.4 ]}, index = range (2 ))
354
- expected_row = pd .DataFrame (
355
- {'A' : [0.1 , 0.2 , 0.3 , 0.4 ]}, index = [0 , 1 , 0 , 1 ])
356
- concatted_row = pd .concat ([df1 , df2 ], axis = 'rows' )
357
- assert_frame_equal (concatted_row , expected_row )
358
354
359
355
expected_index = pd .DataFrame (
360
356
{'A' : [0.1 , 0.2 , 0.3 , 0.4 ]}, index = [0 , 1 , 0 , 1 ])
361
357
concatted_index = pd .concat ([df1 , df2 ], axis = 'index' )
362
358
assert_frame_equal (concatted_index , expected_index )
363
359
364
- expected_0 = pd .DataFrame (
365
- {'A' : [0.1 , 0.2 , 0.3 , 0.4 ]}, index = [0 , 1 , 0 , 1 ])
360
+ concatted_row = pd .concat ([df1 , df2 ], axis = 'rows' )
361
+ assert_frame_equal (concatted_row , expected_index )
362
+
366
363
concatted_0 = pd .concat ([df1 , df2 ], axis = 0 )
367
- assert_frame_equal (concatted_0 , expected_0 )
364
+ assert_frame_equal (concatted_0 , expected_index )
368
365
369
366
expected_columns = pd .DataFrame (
370
367
[[0.1 , 0.3 ], [0.2 , 0.4 ]], index = [0 , 1 ], columns = ['A' , 'A' ])
371
368
concatted_columns = pd .concat ([df1 , df2 ], axis = 'columns' )
372
369
assert_frame_equal (concatted_columns , expected_columns )
373
370
374
- expected_1 = pd .DataFrame (
375
- [[0.1 , 0.3 ], [0.2 , 0.4 ]], index = [0 , 1 ], columns = ['A' , 'A' ])
376
371
concatted_1 = pd .concat ([df1 , df2 ], axis = 1 )
377
- assert_frame_equal (concatted_1 , expected_1 )
372
+ assert_frame_equal (concatted_1 , expected_columns )
378
373
379
374
series1 = pd .Series ([0.1 , 0.2 ])
380
375
series2 = pd .Series ([0.3 , 0.4 ])
0 commit comments