How can I concatenate a dictionary of dataframes (index of each dataframe starts with 0. So, there are duplicate indices) with different column sizes. i.e. Few df's have some missing columns and some df's contain all the columns.
Here is an example:
df1
idx col1 col2 col3 0 1 1 1 1 2 2 2 df2
idx col1 col3 0 1 1 1 2 2 df3
idx col1 col2 col3 0 1 1 1 1 2 2 2 desired_result
idx col1 col2 col3 0 1 1 1 1 2 2 2 2 1 nan 1 3 2 nan 2 4 1 1 1 5 2 2 2 So I would like to fill these columns with Nans and reshape it to the dataframe having all columns.
Thanks in advance !