import pandas as pd
import numpy as np
s = pd.Series(np.arange(5),index = np.arange(5)[::-1],dtype='int64')
s
4 0
3 1
2 2
1 3
0 4
dtype: int64
s.isin([1,3,4])
4 False
3 True
2 False
1 True
0 True
dtype: bool
s[s.isin([1,3,4])]
3 1
1 3
0 4
dtype: int64
s2 = pd.Series(np.arange(6),index = pd.MultiIndex.from_product([[0,1],['a','b','c']]))
s2
0 a 0
b 1
c 2
1 a 3
b 4
c 5
dtype: int32
s2.iloc[s2.index.isin([(1,'a'),(0,'b')])]