Python Forum

Full Version: Loop pandas data frame by position ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
You can use iloc selector, e.g.

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