How can I delete multiple columns in one pass? I know this works
del df['A']
del df['B']
but
del df[['A', 'B']]
doesn't.
Remove duplicate values from multiple columns in ExcelRemoving duplicates from multiple columns in Excel is the exact same process as removing duplicate values from a single column. The only difference is the “Remove Duplicates” dialog box—you'll need to confirm the columns you wish to remove duplicates from.
Remove Duplicates from Multiple Columns in Excel Select the data. Go to Data –> Data Tools –> Remove Duplicates. In the Remove Duplicates dialog box: If your data has headers, make sure the 'My data has headers' option is checked.
In Excel, there are several ways to filter for unique values—or remove duplicate values: To filter for unique values, click Data > Sort & Filter > Advanced. To remove duplicate values, click Data > Data Tools > Remove Duplicates.
You can use .drop
:
df = df.drop(['A', 'B'], axis=1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With