Отбросить несколько колонн панд
yourdf.drop(['columnheading1', 'columnheading2'], axis=1, inplace=True)
Nutty Newt
yourdf.drop(['columnheading1', 'columnheading2'], axis=1, inplace=True)
import pandas as pd
# Drop all duplicates in the DataFrame
df = df.drop_duplicates()
# Drop all duplicates in a specific column of the DataFrame
df = df.drop_duplicates(subset = "column")
# Drop all duplicate pairs in DataFrame
df = df.drop_duplicates(subset = ["column", "column2"])
# Display DataFrame
print(df)
df.loc[:,~df.T.duplicated(keep='first')]
import pandas as pd
# making data frame from csv file
data = pd.read_csv("employees.csv")
# sorting by first name
data.sort_values("First Name", inplace = True)
# dropping ALL duplicte values
data.drop_duplicates(subset ="First Name",keep = False, inplace = True)
# displaying data
print(data)
df = df.drop_duplicates()
df.loc[:,~df.columns.duplicated()]