xxxxxxxxxx
# axis=1 tells Python that we want to apply function on columns instead of rows
# To delete the column permanently from original dataframe df, we can use the option inplace=True
df.drop(['A', 'B', 'C'], axis=1, inplace=True)
xxxxxxxxxx
#To delete the column without having to reassign df
df.drop('column_name', axis=1, inplace=True)
xxxxxxxxxx
df.drop('column_name', axis=1, inplace=True)
#no need to reasign df
#axis 1 is columns, 0 is rows
xxxxxxxxxx
df.drop(['Col_1', 'Col_2'], axis = 1) # to drop full colum more general way can visulize easily
df.drop(['Col_1', 'Col_2'], axis = 1, inplace = True) # advanced : to generate df without making copies inside memory