0Pricing
Data Science Academy · Lesson

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

  1. Rows, Columns, and the Index
  2. Build a DataFrame From Scratch
  3. head, info, and describe
  4. Add, Rename, and Drop Columns
← Back to Data Science Academy