DEV Community

loading...

Answer: How to drop a list of rows from Pandas dataframe?

nilotpalc profile image Nilotpal Choudhury ・1 min read

I solved this in a simpler way - just in 2 steps.

Step 1: First form a dataframe with unwanted rows/data.

Step 2: Use the index of this unwanted dataframe to drop the rows from the original dataframe.

Example:

Suppose you have a dataframe df which as many columns including…

Discussion

pic
Editor guide