drop column pd dataframe code example
Example 1: drop a column in pandas
note: df is your dataframe
df = df.drop('coloum_name',axis=1)
Example 2: removing features pandas
df.drop([‘feature_1’,’feature_2’], inplace = True, axis = 1)
note: df is your dataframe
df = df.drop('coloum_name',axis=1)
df.drop([‘feature_1’,’feature_2’], inplace = True, axis = 1)