PythonDataScienceHandbook
PythonDataScienceHandbook copied to clipboard
03.06 Concatenation - wrong axis argument
Dear all,
I am greatly appreciating the book so far. I run into the following error in chapter 03.06 with using pd.concat:
df3 = make_df('AB', [0, 1])
df4 = make_df('CD', [0, 1])
display('df3', 'df4', "pd.concat([df3, df4], axis='col')")
ValueError: No axis named col for object type <class 'pandas.core.frame.DataFrame'>
In the pandas documentation the axis argument should be 'columns' instead of 'col':
axis : {0/'index', 1/'columns'}, default 0 The axis to concatenate along
Currently I'm not sure if this error is due to me using a later pandas version (I'm using 0.23.4) and whether this should be fixed. If a change is appreciated, I'm happy to create a pull-request!
Best, Simon
since 0.19 version, the axis argument should be 'columns' instead of 'col'
axis : {0/’index’, 1/’columns’}, default 0 The axis to concatenate along
while in 0.18 version, or earlier, something different in the document, which may be the prove for your problem.
axis : {0, 1, ...}, default 0 The axis to concatenate along