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
  • 379,657
  • 97
  • 704
  • 746
peoplesparkresident
  • 1,381
  • 2
  • 9
  • 10

0 Answers0