delete a column in pandas

40

#To delete the column without having to reassign df
df.drop('column_name', axis=1, inplace=True) 
df.drop('column_name', axis=1, inplace=True)
#no need to reasign df
#axis 1 is columns, 0 is rows
df.drop('column_name', axis=1, inplace=True)

Comments

Submit
0 Comments