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 ?

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.
You can use iloc selector, e.g.

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

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to filter data frame dynamically with the columns psahay 0 231 Aug-24-2020, 01:10 PM
Last Post: psahay
  Python PDF merging from an excel pandas for loop siraero 0 470 Aug-16-2020, 09:34 AM
Last Post: siraero
  Dropping Rows From A Data Frame Based On A Variable JoeDainton123 1 326 Aug-03-2020, 02:05 AM
Last Post: scidam
  How to shift data frame rows of specified column Mekala 0 496 Jul-21-2020, 02:42 PM
Last Post: Mekala
  HELP- DATA FRAME INTO TIME SERIES- BASIC bntayfur 0 280 Jul-11-2020, 09:04 PM
Last Post: bntayfur
  pandas read_csv can't handle missing data mrdominikku 0 407 Jul-09-2020, 12:26 PM
Last Post: mrdominikku
  Pandas data frame creation from Kafka Topic vboppa 0 253 Jul-01-2020, 04:23 PM
Last Post: vboppa
  Generate Test data (.csv) using Pandas Ashley 5 551 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 503 Jun-09-2020, 06:05 AM
Last Post: Pan
  Read json array data by pandas vipinct 0 394 Apr-13-2020, 02:24 PM
Last Post: vipinct

Forum Jump:

User Panel Messages

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