Data Manipulation
Pandas Basics
1 min read
Published Sep 29 2025, updated Oct 24 2025
Guide Sections
Guide Comments
Renaming Columns
You can rename all columns at once or specific ones.
Use .rename() when you only want to change a few columns.
Selecting Columns by Data Type
.select_dtypes() helps filter numeric, categorical, or boolean columns.
Converting to NumPy
Access the underlying NumPy representation of the DataFrame.
This strips column and index labels (just raw data).
Replacing Data
.replace() can substitute values in the whole DataFrame or specific columns.
Changing Data Types
.astype() is used to convert a column to a new data type.
Mapping Data
.map() can apply a function, dictionary mapping, or Series to each element in that column.
This replaces "M" with "Male" and "F" with "Female" in that column.
You can also pass a function:
applymap() can apply a function elementwise to every single cell in the entire DataFrame.
Converts every value in the DataFrame to uppercase strings.














