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.
