pandas and NumPy 3 · Cleaning and transforming
Change a column's type
Convert a column to another type.
df["age"] = df["age"].astype("int64")
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