make a list with the index of a pd dataframe code example Example: filter dataframe with a list of index df[df.index.isin([1,3])]