Bottom Page

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

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

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to modify data frame row value SriRajesh 0 57 Feb-12-2020, 05:46 PM
Last Post: SriRajesh
  Handling escape charters while converting data frame to JSON RahulShukla 0 149 Nov-11-2019, 11:22 AM
Last Post: RahulShukla
  pandas DataReader error on all data sources glidecode 5 8,346 Sep-25-2019, 02:10 PM
Last Post: perfringo
  pandas data frame dervast 1 296 Aug-28-2019, 12:40 PM
Last Post: ThomasL
  Need Help With Filtering Data For Excel Files Using Pandas eddywinch82 9 781 Aug-06-2019, 03:44 PM
Last Post: eddywinch82
  Insert Pandas Data Frame into Teradata DB kylenater 0 1,283 Jul-19-2019, 04:53 PM
Last Post: kylenater
  Loading .csv data using Pandas zaki424160 1 627 Jul-15-2019, 09:48 AM
Last Post: perfringo
  [pandas] Convert categorical data to numbers pradeep_as400 1 550 Jun-15-2019, 08:27 AM
Last Post: ThomasL
  Creating new rows and adding them to empty data frame kapilan15 0 366 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 3,813 Apr-22-2019, 05:05 PM
Last Post: Yoriz

Forum Jump:


Users browsing this thread: 1 Guest(s)