60-second card
concat
concat stacks tables on top of each other (or side by side).
- pd.concat([jan, feb]) puts February's rows under January's.
- ignore_index=True renumbers the rows 0, 1, 2 ...
- Columns are matched by name; missing ones become NaN.
import pandas as pd
jan = pd.DataFrame({"sales": [10, 20]})
feb = pd.DataFrame({"sales": [30]})
print(pd.concat([jan, feb], ignore_index=True)["sales"].tolist())Prints
[10, 20, 30]Remember: concat = stack. merge = join on a key.
Common mistake: Forgetting ignore_index=True and ending up with repeated row labels.