I\'m aware of DataFrame.sample(), but how can I do this and also remove the sample from the dataset? (Note: AFAIK this has nothing to do with sampling with repl
DataFrame.sample()
If your index is unique
df = df.drop(df_subset.index)
example
df = pd.DataFrame(np.arange(10).reshape(-1, 2))
sample
df_subset = df.sample(2) df_subset
drop
df.drop(df_subset.index)