Created
May 16, 2020 01:13
-
-
Save goddoe/dcd3782ba9e75d836ebb363654251787 to your computer and use it in GitHub Desktop.
sample each group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data_df = data_df.groupby('label', group_keys=False).apply(pd.DataFrame.sample, n=50, replace=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment