python pandas : How to get the index of the values from a series that have matching values in other series?
问题 I have these two series: In [48]: serie1 Out[48]: 0 A 1 B 2 C 3 A 4 D In [49]: serie2 Out[49]: 0 X 1 Y 2 A 3 Z 4 A 5 D dtype: object And for each value in serie1 I want to get the index/indexes from serie2. Is this possible without iterating over values? A possible solution would be to build a dataframe more or less like this: A B C D X False False False False Y False False False False A True False False False Z False False False False A True False False False D False False False True ... and