Last active
September 15, 2018 07:10
-
-
Save srishtis/32b751b0be9f6c604d6e136f8bf90952 to your computer and use it in GitHub Desktop.
Kickstarter project name features
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
#creating features from the project name | |
#length of name | |
kick_projects['name_len'] = kick_projects.name.str.len() | |
# presence of ! | |
kick_projects['name_exclaim'] = (kick_projects.name.str[-1] == '!').astype(int) | |
# presence of ? | |
kick_projects['name_question'] = (kick_projects.name.str[-1] == '?').astype(int) | |
# number of words in the name | |
kick_projects['name_words'] = kick_projects.name.apply(lambda x: len(str(x).split(' '))) | |
# if name is uppercase | |
kick_projects['name_is_upper'] = kick_projects.name.str.isupper().astype(float) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment