Guided Notes
Transform: Combining Data
Stacking data with concat, joining with merge, and cleaning keys so two sources can match.
Two ways to combine data
Slide 1 / 5Transforming often starts with bringing sources together:
• concat stacks tables with the same columns on top of each other — a union. Rural-population and electricity-access indicators share the same layout (Country Name, Country Code, Indicator Name, year columns), so they stack neatly. • merge joins tables side by side on a shared key — like a SQL JOIN. Projects and indicators share a country code and year.
Pick concat when adding rows, merge when adding columns.