Python Forum
Dropping Rows From A Data Frame Based On A Variable - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: Dropping Rows From A Data Frame Based On A Variable (/thread-28773.html)



Dropping Rows From A Data Frame Based On A Variable - JoeDainton123 - Aug-02-2020

Hi all

I have a data frame which i want rows to be removed.

I am using the command:-

data_frame_current.drop(index=b)
b is a variable that increments which represents the row.

So i want to remove the row that has the index b.

But this does not work, but has not errors.

Can anyone point me in the right direction please?

Thank you


RE: Dropping Rows From A Data Frame Based On A Variable - scidam - Aug-03-2020

What behavior did you expect? May be you forgot to set inplace=True? data_frame_current.drop(index=b, inplace=True).