check for column name in pandas and drop it code example
Example 1: delete unnamed coloumns in pandas
# Best method so far.
df = df.loc[:, ~df.columns.str.contains('^Unnamed')]
Example 2: pandas remove column
del df['column_name']
# Best method so far.
df = df.loc[:, ~df.columns.str.contains('^Unnamed')]
del df['column_name']