Relative Content

Tag Archive for pythonpandasgroup-byunique

How do I get the unique combinations of values that exist in all groupings

I want to know what are the existing combinations of uom values that products have.
Given
df = pd.DataFrame([{'prod_id':3,'uom':'PK'},{'prod_id':3,'uom':'PQT'},{'prod_id':4,'uom':'PK'},{'prod_id':5,'uom':'PQT'},{'prod_id':5,'uom':'PK'},{'prod_id':6,'uom':'SET'},{'prod_id':6,'uom':'ENS'},{'prod_id':7,'uom':'PK'},{'prod_id':7,'uom':'ENS'}])