set_index and reset_index
What it is
set_index promotes columns to the index; reset_index demotes them back to columns, with drop=True to discard rather than keep.
Why it matters
Operations that align, join or slice by label are all faster and clearer with a meaningful index — particularly time series.
In the real world: Making customer ID the index for fast lookups during analysis, then turning it back into a column before saving the result for a dashboard.
ts = df.set_index("ordered_at").sort_index()
ts.reset_index() # datetime becomes a column again
df.set_index(["country", "city"]) # a MultiIndexReflexively calling reset_index() after every group-by. It is often right, but doing it without looking is how people end up with a stray index column in their output.
Practise it: Average Order Value Per Customer, Count Orders Per Customer, Filter Rows and Keep Two Columns