df_countries = dict(list(df_countries.groupby('Country')))
for df in df_countries.values():
df.drop('Country', axis=1)
df_countries["Australia"]
Above is the coding that I typed, but how to drop the column country?? From the output, the column 'Country' didn't drop
CodePudding user response:
Try adding the inplace=True
parameter
df_countries = dict(list(df_countries.groupby('Country')))
for df in df_countries.values():
df.drop('Country', inplace=True, axis=1)
df_countries["Australia"]