-
-
Save amankharwal/71ebb803f204cfd40dc7468a2ddbda61 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
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