drop all columns not specified pandas code example
Example 1: remove a columns in pandas
DataFrame.drop(self, labels=None, axis=0, index=None, columns=None, level=None, inplace=False, errors='raise')[source]
Example 2: drop the first column pandas
df.set_index['column'] # column refers to column to be set as index