Why pandas loc/iloc Slows Down Loops and How at/iat Can Speed It Up
This article explains how using pandas loc and iloc inside Python loops can be extremely slow, demonstrates the performance difference with concrete timing examples, and shows that replacing them with the scalar accessors at and iat can accelerate the operation by up to sixty times.
