pandas delete row from dataframe code example
Example 1: drop columns pandas
df.drop(columns=['B', 'C'])
Example 2: delete a row in pandas dataframe
df.drop(df.index[2])
Example 3: drop a column from dataframe
#working with "text" syntax for the columns:
df.drop(['column_nameA', 'column_nameB'], axis=1, inplace=True)
Example 4: remove rows from dataframe
df.drop(['Cochice', 'Pima'])