We try and avoid loops with NumPy and Pandas, but occasionally you will need them, or their friends comprehensions.