← Courses

Pandas, Hands-On Data with Python

Data Science

Core pandas · Lesson 8 of 10

Renaming and combining

Tidying and joining

The last core skills are renaming columns and combining datasets.

  • rename(columns={...}) gives columns clearer names
  • pd.concat([...]) stacks DataFrames on top of each other
  • merge() joins two DataFrames on a shared column, like a database join
Python

Exercise

Exercise — check your understanding

Two DataFrames, q1 and q2, hold sales for two quarters. Stack them into one DataFrame called year, with the row numbers reset so they run 0, 1, 2, 3.

You’re reading for free. Sign in to keep your progress and earn a certificate when you finish.Sign in to keep my progress →