Skip to content
RED SAG Skills
medium10 pts · first answer countspythonpandasperformance

A slow row-wise apply

This line takes minutes on 5 million rows. What is the best rewrite?

df["total"] = df.apply(lambda r: r["price"] * r["qty"] * 1.18, axis=1)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions