delete columns by name in pandas code example
Example 1: remove column from dataframe
df.drop('column_name', axis=1, inplace=True)
Example 2: pandas dataframe delete column
del df['column_name']
Example 3: remove name of a column
M
a b c
1[1,] 1 4 7
2[2,] 2 5 8
3[3,] 3 6 9
row.names(M)<- NULL ; colnames(M)<- NULL
M
[,1] [,2] [,3]
[1,] 1 4 7
[2,] 2 5 8
[3,] 3 6 9