Pandas/Python equivalent of Stata's "levelsof"

Viewed 291

I want to get a list of all distinct or unique values of one variable in a dataframe that coincide with a specific value of another variable in that dataframe.

In Stata I would use something like:

levelsof(ID1) if ID2==i

How do I do this in Python?

2 Answers
Related