Created
April 28, 2020 17:17
-
-
Save piEsposito/dd7c2515bd7d739a82180fb0720d4dbd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
idx_positive = df[df['labels']=='positive'].index | |
nbr_to_drop = len(df) - len(idx_positive) | |
drop_indices = np.random.choice(idx_positive, nbr_to_drop, replace=False) | |
df = df.drop(drop_indices) | |
#transform all of it to lists | |
text_as_list = df['text'].tolist() | |
labels_as_list = df['labels'].tolist() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment