Answers for "remove column based on column name pandas"

1

delete unnamed coloumns in pandas

# Best method so far.
df = df.loc[:, ~df.columns.str.contains('^Unnamed')]
Posted by: Guest on May-24-2021
0

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
Posted by: Guest on May-25-2021

Code answers related to "remove column based on column name pandas"

Python Answers by Framework

Browse Popular Code Answers by Language