Python Forum
Dropping Rows From A Data Frame Based On A Variable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dropping Rows From A Data Frame Based On A Variable
#1
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
Reply
#2
What behavior did you expect? May be you forgot to set inplace=True? data_frame_current.drop(index=b, inplace=True).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how to filter data frame dynamically with the columns psahay 0 183 Aug-24-2020, 01:10 PM
Last Post: psahay
  Extracting rows based on condition on one column Robotguy 2 213 Aug-07-2020, 02:27 AM
Last Post: Robotguy
  How to shift data frame rows of specified column Mekala 0 446 Jul-21-2020, 02:42 PM
Last Post: Mekala
  Filter data based on a value from another dataframe column and create a file using lo pawanmtm 1 320 Jul-15-2020, 06:20 PM
Last Post: pawanmtm
  HELP- DATA FRAME INTO TIME SERIES- BASIC bntayfur 0 245 Jul-11-2020, 09:04 PM
Last Post: bntayfur
  Pandas data frame creation from Kafka Topic vboppa 0 219 Jul-01-2020, 04:23 PM
Last Post: vboppa
  Filter rows by multiple text conditions in another data frame i.e contains strings an Pan 0 467 Jun-09-2020, 06:05 AM
Last Post: Pan
  How can I convert time-series data in rows into column srvmig 0 349 Apr-11-2020, 05:40 AM
Last Post: srvmig
  Displaying Result from Data Frame from Function eagle 1 447 Apr-08-2020, 11:58 PM
Last Post: eagle
  add formatted column to pandas data frame alkaline3 0 358 Mar-22-2020, 06:44 PM
Last Post: alkaline3

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020