How to drop a column in dataframe


xx = {'tt': [{'a': '11', 'b': '22', 'c': '33'}, {'a':'44', 'b':'55', 'c':'66'}]}
tt = xx['tt']

df = pd.DataFrame(tt)
df.drop(columns=['b'], axis=1)        

Above code does still displays column ‘b’. How to remove it?


df.drop(columns=['b'], axis=1, inplace=True)

1 Like

oh my, that did it!

missed a parameter, spent hours searching and trying different combos.

thank you!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.