Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created Nov 22, 2020
Embed
What would you like to do?
def cat_to_num(data):
categories = unique(data)
features = []
for cat in categories:
binary = (data == cat)
features.append(binary.astype("int"))
return features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment