How NOT to write pandas code
towardsdatascience.com
towardsdatascience.com
Try to use the built-in vectorized Pandas functions instead of writing explicit loops.
This is one of those cases that really isn't just pedantic, "pythonic", nagging. It matters.