loc.copy code example
Example 1: pandas df by row index
indices = [133, 22, 19, 203, 14, 1]
df_by_indices = df.iloc[indices, :]
Example 2: pandas loc index not in
df.loc[set(df.index) - set(blacklist)]
indices = [133, 22, 19, 203, 14, 1]
df_by_indices = df.iloc[indices, :]
df.loc[set(df.index) - set(blacklist)]