pandas and NumPy 3 · Cleaning and transforming

Add a column

Create a column from others. Vectorized operations are much faster than apply.

df = df.assign(total=df["price"] * df["qty"])

Official pandas and NumPy 3 documentation

More cleaning and transforming commands

All cleaning and transforming commands · pandas and NumPy 3 cheatsheet

Was this page helpful?