How would you delete rows from a dataframe ?
To delete rows from a dataframe, we use the drop() function with the syntax:
drop()
<DF>.drop(sequence of indexes).
<DF>.drop(sequence of indexes)
For example, the statement to delete the rows with indexes 2, 3, 4 from a dataframe df is df.drop([2, 3, 4]).
df
df.drop([2, 3, 4])