-
-
Save HSShashank/826724da30aa563bb32428dbc736008b to your computer and use it in GitHub Desktop.
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
classes = list(np.unique(labels)) | |
print(classes) | |
map_classes = dict(zip(classes, [t for t in range(len(classes))])) | |
print(map_classes) | |
df['MAPPED LABELS'] = [map_classes[i] for i in df['LABEL']] | |
df = df.sample(frac = 1) #To randomly shuffle the data | |
df.to_csv('dataset.csv') | |
df.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment