Question : DataFrame.iterrows is a generator which yields both the index and row (as a Series):
Answered by : morteza-abdipourchenarestansofla
import pandas as pd
df = pd.DataFrame({'c1': [10, 11, 12], 'c2': [100, 110, 120]})
for index, row in df.iterrows(): print(row['c1'], row['c2'])
Source : https://stackoverflow.com/questions/16476924/how-to-iterate-over-rows-in-a-dataframe-in-pandas | Last Update : Sun, 24 Jan 21