Consider the following explanation and sample code from this link.
When we concatenate DataFrames, we need to specify the axis. axis=0
tells pandas to stack the second DataFrame UNDER the first one. It
will automatically detect whether the column names are the same and
will stack accordingly. axis=1
will stack the columns in the second
DataFrame to the RIGHT of the first DataFrame. To stack the data
vertically, we need to make sure we have the same columns and
associated column format in both datasets. When we stack horizontally,
we want to make sure what we are doing makes sense (i.e. the data are
related in some way).
# Stack the DataFrames on top of each other
vertical_stack = pd.concat([survey_sub, survey_sub_last10], axis=0)
# Place the DataFrames side by side
horizontal_stack = pd.concat([survey_sub, survey_sub_last10], axis=1)