This is a special post for quick takes by SatvikBeri. Only they can create top-level comments. Comments here also appear on the Quick Takes page and All Posts page.
Tell Claude Code to calculate some statistics without using for loops, and it will thrash around and often end up with for loops anyway. Tell it to write the code and then refactor it to remove for loops with vectorized operations, and it usually succeeds, and much faster.