Skip to content

Instantly share code, notes, and snippets.

@grahamharrison68
Created January 30, 2021 13:53
Show Gist options
  • Save grahamharrison68/d4c7990ba6015ac6b25af4557e3d6037 to your computer and use it in GitHub Desktop.
Save grahamharrison68/d4c7990ba6015ac6b25af4557e3d6037 to your computer and use it in GitHub Desktop.
red_wines = df_merged_wine[df_merged_wine['label'] == 1]
all_white_wines = df_merged_wine[df_merged_wine['label'] == 0]
white_wines = all_white_wines.sample(n=red_wines.shape[0], random_state=24)
df_wine_balanced = pd.concat([red_wines, white_wines])
df_wine_balanced
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment