136

I'm looking to iterate row by row through a pandas DataFrame. The way I'm doing it so far is as follows:

for i in df.index:
    do_something(df.ix[i])

Is there a more performant and/or more idiomatic way to do this? I know about apply, but sometimes it's more convenient to use a for loop.

cs95
  • 330,695
  • 80
  • 606
  • 657
peoplesparkresident
  • 1,371
  • 2
  • 9
  • 10

0 Answers0