DataframeConcat
Combine one or more dataframes by concatentating them together. This takes the rows of each dataframe and places them one after another in a new dataframe. Data will be retained in columns of the same name. Therefore, if columns are not the same across dataframes, the new dataframe will have missing values for cells for corresponding sections that did not have a given column name.
Examples
Example 1 - Concatenate Two Dataframes Vertically
When working with data from different time periods or sources, it is common to combine them into a single dataframe. This example concatenates two dataframes by stacking their rows on top of each other. The result is a new dataframe that contains all rows from both inputs, preserving the order and resetting the index to maintain consistency.
#> DataframeConcat df2021_FinalDf df2020_FinalDf
AFLEFT
dfsList = [df2021_FinalDf, df2020_FinalDf]
dfsConcat = pd.concat(dfsList, ignore_index=True) AFRIGHT