Real Python

Free Sample Code: Click here to download the free sample code and datasets that you’ll use to explore iterating over rows in a pandas DataFrame vs using vectorized methods.

Almost there! Complete this form and click the button below to gain instant access:

How to Iterate Over Rows in pandas, and Why You Shouldn't

How to Iterate Over Rows in pandas, and Why You Shouldn't (Sample Code)

© 2012–2026 Real Python ⋅ Privacy Policy