pandas index not in code example
Example 1: filter dataframe with a list of index
df[df.index.isin([1,3])]
Example 2: pandas loc index not in
df.loc[set(df.index) - set(blacklist)]
df[df.index.isin([1,3])]
df.loc[set(df.index) - set(blacklist)]