Python Forum
Loop pandas data frame by position ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loop pandas data frame by position ?
#1
Hello,

Is there a way to loop a pandas data frame by position ?

The loop is generally this way,

For i, r in a.iterrows():

If I want to start at index 10,
instead of the beginning
how do I do that ?

Hope you know what I mean.
Reply
#2
You can use iloc selector, e.g.

for i, r in a.iloc[10:].iterrows():
    pass
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how to filter data frame dynamically with the columns psahay 0 226 Aug-24-2020, 01:10 PM
Last Post: psahay
  Python PDF merging from an excel pandas for loop siraero 0 466 Aug-16-2020, 09:34 AM
Last Post: siraero
  Dropping Rows From A Data Frame Based On A Variable JoeDainton123 1 325 Aug-03-2020, 02:05 AM
Last Post: scidam
  How to shift data frame rows of specified column Mekala 0 488 Jul-21-2020, 02:42 PM
Last Post: Mekala
  HELP- DATA FRAME INTO TIME SERIES- BASIC bntayfur 0 277 Jul-11-2020, 09:04 PM
Last Post: bntayfur
  pandas read_csv can't handle missing data mrdominikku 0 403 Jul-09-2020, 12:26 PM
Last Post: mrdominikku
  Pandas data frame creation from Kafka Topic vboppa 0 250 Jul-01-2020, 04:23 PM
Last Post: vboppa
  Generate Test data (.csv) using Pandas Ashley 5 543 Jun-15-2020, 02:51 PM
Last Post: jefsummers
  Filter rows by multiple text conditions in another data frame i.e contains strings an Pan 0 498 Jun-09-2020, 06:05 AM
Last Post: Pan
  Read json array data by pandas vipinct 0 390 Apr-13-2020, 02:24 PM
Last Post: vipinct

Forum Jump:

User Panel Messages

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