Deletion in a DataFrame

Let's see how to delete data in pandas.

Delete a row

The pandas drop() function is used to delete data rows or columns. The default operation takes axis=0, which indicates that we are referring to a row.

Notice: The drop operation is not in place. The result is returned from the function.

Get hands-on with 1400+ tech skills courses.