Examples
import numpy as np
import pandas as pd
df = pd.DataFrame({'num_legs': [4, 2], 'num_wings': [0, 2]},
index=['fox', 'eagle'])
df
for row in df.itertuples():
print(row)
for row in df.itertuples(index=False):
print(row)
With the name parameter set we set a custom name for the yielded named tuples:
for row in df.itertuples(name='Animal'):
print(row)