Add, Rename, and Drop Columns
Shaping columns to fit your analysis.
Shape Columns to Fit
Real analysis means reshaping columns: adding new ones, renaming unclear ones, and dropping clutter so your table answers the question at hand. ✂️
Add a Column by Assignment
Create a new column just by assigning to a fresh name. If it does not exist yet, pandas adds it on the spot.
df["total"] = df["price"] * df["qty"]All lessons in this course
- Rows, Columns, and the Index
- Build a DataFrame From Scratch
- head, info, and describe
- Add, Rename, and Drop Columns