Home > Net >  Appending df shape
Appending df shape

Time:03-30

I've two dataframes that i need to append them in one data frame but the second not like the same shape of the first one, therefore when I try to append them I found the DataFrame like below PS.

enter image description here enter image description here

CodePudding user response:

Try:

out = pd.concat([IBN_df.reset_index(), IBO_df])

Or use_index=False when you use groupby.

CodePudding user response:

For prevent MultiIndex add as_index=False parameter to DataFrame.groupby:

.groupby(['Date','Queue'])['Offered '].sum()

to:

.groupby(['Date','Queue'], as_index=False)['Offered '].sum()
  • Related