Bottom Page

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():

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  pandas data frame dervast 1 124 Aug-28-2019, 12:40 PM
Last Post: ThomasL
  Need Help With Filtering Data For Excel Files Using Pandas eddywinch82 9 447 Aug-06-2019, 03:44 PM
Last Post: eddywinch82
  Insert Pandas Data Frame into Teradata DB kylenater 0 434 Jul-19-2019, 04:53 PM
Last Post: kylenater
  Loading .csv data using Pandas zaki424160 1 267 Jul-15-2019, 09:48 AM
Last Post: perfringo
  [pandas] Convert categorical data to numbers pradeep_as400 1 337 Jun-15-2019, 08:27 AM
Last Post: ThomasL
  Creating new rows and adding them to empty data frame kapilan15 0 231 May-31-2019, 10:19 AM
Last Post: kapilan15
  Pandas to_csv in for loop AttributeError: 'tuple' object has no attribute 'to_csv' NSearch 9 1,707 Apr-22-2019, 05:05 PM
Last Post: Yoriz
  [pandas]How to liner fit time series data and get linear fit equation and r square Sri 5 529 Apr-04-2019, 12:00 PM
Last Post: Sri
  Getting the difference between two times in a Data Frame soulkid555 4 409 Mar-21-2019, 11:22 AM
Last Post: perfringo
  Inserting data from python list into a pandas dataframe mahmoud899 0 387 Mar-02-2019, 04:07 AM
Last Post: mahmoud899

Forum Jump:

Users browsing this thread: 1 Guest(s)