How to drop a column in dataframe

Hello,

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)        
st.write(df)

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

TIA!

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.