Add pd.Series([1, 2], index=["x", "y"]) to pd.Series([10, 20], index=["y", "z"]…
pandas · from The index, and alignment
df.indexalignmentreindexset_indexreset_indexfill_valuePutting the kettle on…
Starting up…
Exercise 1
Add pd.Series([1, 2], index=["x", "y"]) to pd.Series([10, 20], index=["y", "z"]) and return the result — gaps and all.
your answer
stuck? the lesson behind it
The index, and alignment
Labels take part in the arithmetic — the one idea NumPy doesn’t have.