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
- Count missing values
- Drop rows with missing values
- Fill missing values
- Remove duplicate rows
- Rename columns
- Drop columns
All cleaning and transforming commands · pandas and NumPy 3 cheatsheet