Skip to content
Advertisement

How to remove a group of specific rows from a dataframe?

I have a dataframe with 7581 rows and 3 columns (id,text,label). And I have a subgroup of this dataframe of 794 rows.

What I need to do is to remove that subgroup of 794 rows (same labels) from the big dataframe of 7581.

This is how the subgroup looks like: Photo

I have tried to do this:

JavaScript

But the following error appears:

JavaScript

Can anyone help me please?

Advertisement

Answer

You can use this slicing

JavaScript

And if you want to use drop then you can do this

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement