I have a pandas dataframe that looks like
some_data another_id
id
312871 ... abc
312977 ... def
...
and a dictionary letters = {"abc": "x", "def": "y"}. I want to add letters as a column to my dataframe, but it is morally indexed by another_id so I can't just set df["letters"] = letters.
I'm sure there's a beautiful, elegant way to do this. What is it?