Python Forum
Iterating Through Data Frame Rows
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Iterating Through Data Frame Rows
#1
Hello all

I have a dataframe which i have imported from excel.

It has column headings and below the column headings it has all of my data in rows.

I want to LOOP through each row of the first column and if it is equal to a value say 123 then i just want to remove it.

I want to LOOP through each item in the data frame.

so far i have:-

t = 0
while t < len(Report):
Value = Report.iloc[t,0] #the value i want to check is always in the 0 column index
if Value == Report.iloc[t,0]:

#how do i delete the the row????

t=t+1
deleting the rows is proving to be very difficult.

Can anyone help provide some guidance.

Thank you.
Reply


Messages In This Thread
Iterating Through Data Frame Rows - by JoeDainton123 - Aug-03-2020, 09:20 PM
RE: Iterating Through Data Frame Rows - by scidam - Aug-06-2020, 05:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how do you style data frame that has empty rows. gsaray101 0 543 Sep-08-2023, 05:20 PM
Last Post: gsaray101
  googletrans library to translate text language for using data frame is not running gcozba2023 0 1,248 Mar-06-2023, 09:50 AM
Last Post: gcozba2023
  (Python) Pulling data from UA Google Analytics with more than 100k rows into csv. Stockers 0 1,261 Dec-19-2022, 11:11 PM
Last Post: Stockers
  How to properly format rows and columns in excel data from parsed .txt blocks jh67 7 1,934 Dec-12-2022, 08:22 PM
Last Post: jh67
  Load multiple Jason data in one Data Frame vijays3 6 1,588 Aug-12-2022, 05:17 PM
Last Post: vijays3
  conditionals based on data frame mbrown009 1 915 Aug-12-2022, 08:18 AM
Last Post: Larz60+
  Merging two Data Frame on a special case piku9290dgp 0 1,100 Mar-02-2022, 10:43 AM
Last Post: piku9290dgp
  Save data frame to .csv df.to.csv() mcva 1 1,569 Feb-03-2022, 07:05 PM
Last Post: mcva
  Move a particular row in pandas data frame to last row klllmmm 0 3,810 Dec-27-2021, 09:11 AM
Last Post: klllmmm
  The code I have written removes the desired number of rows, but wrong rows Jdesi1983 0 1,645 Dec-08-2021, 04:42 AM
Last Post: Jdesi1983

Forum Jump:

User Panel Messages

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