Pandas DataFrame: iterrows() function

DataFrame - iterrows() function

The iterrows() function is used to iterate over DataFrame rows as (index, Series) pairs.

Iterates over the DataFrame columns, returning a tuple with the column name and the content as a Series.




Name Description Type/Default Value Required / Optional
index    The index of the row. A tuple for a MultiIndex. label or tuple of label Required
data    The data of the row as a Series. Series Required
it  A generator that iterates over the rows of the frame. generator Required


Download the Pandas DataFrame Notebooks from here.

Previous: DataFrame - iteritems() function
Next: DataFrame - itertuples() function

Share this Tutorial / Exercise on : Facebook and Twitter