79517012

Date: 2025-03-18 10:09:37
Score: 1.5
Natty:
Report link

Pandas DataFrames have an itertuples method that returns a generator of named tuples. The named tuples have an _asdict() method. So you can get a generator of rows as dictionaries with:

row_generator = (row._asdict() for row in df.itertuples())

References:

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Dr John A Stevenson