I know DataFrame.sample(), but how can I do this and also remove the sample from the dataset? (Note: AFAIK this has nothing to do with fetch with replacement)
For example, the essence of what I want to achieve does not actually work:
len(df)
df_subset = df.sample(300)
len(df_subset)
df = df.remove(df_subset)
len(df)
source
share