I want to combine data frames with different columns in Python Pandas.
import pandas as pd
first_df = pd.DataFrame({
'a':np.random.randn(6),
'b':np.random.choice( [5,7,np.nan], 6),
'c':np.random.choice( ['panda','python','shark'], 6)})
second_df = pd.DataFrame({
'a':np.random.randn(6),
'b':np.random.choice( [5,7,np.nan], 6)})
third_df = pd.DataFrame({
'a':np.random.randn(6)})
I got a list of dataframes
df_list = %who_ls DataFrame
print(len(df_list))
df_list
but I do not know how to capture the dataframes objects themselves so that I can combine them:
pd.concat(df_list, axis=0, ignore_index=True)