Pandas: Group Data by column A, Filter A by existing values of column B
问题 I'm new to pandas and want to create a new dataset with grouped and filtered data. Right now, my dataset contains two columns looking like this (first column with A, B or C, second with value): A 1 A 2 A 3 A 4 B 1 B 2 B 3 C 4 --> now I want to group by the keys of the first column (A,B,C) , and show only the keys, where the values 1 AND 2 exist. So that my new data set looks like: A 1 A 2 B 1 B 2 Until now, I'm only able to print everything but I don't know how to filter: for name, group in