pandas subset based on list of index of rows code example Example: filter dataframe with a list of index df[df.index.isin([1,3])]