1

I have to load excel file with few column to pandas data frame. In That Excel file some times data use come with column names "Unnamed 1" ,"Unnamed 2", "Unnamed 3" . I want to delete all the columns where column names start with "Unnamed" . How to do this ? Suppose my data frame name is df .

1 Answers1

1

The easiest way to use this with regex is:

df.drop(list(df.filter(regex = 'Unnamed')), axis = 1, inplace = True)