1.What is vectorisation, and why does it matter in NumPy and pandas?
Show hint
Where does the loop run?
Show solution
Vectorisation means applying an operation to a whole array or column at once instead of looping in Python. The loop still happens, but inside compiled C code, so it is typically one or two orders of magnitude faster and the code is shorter: df["total"] = df["price"] * df["qty"] instead of a for loop over rows.