Created
January 14, 2018 19:50
-
-
Save hunterowens/953b89a38d498ab74d19c72c5fb273fb to your computer and use it in GitHub Desktop.
example_catagory
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 catagorize(row): | |
""" | |
apply function to catagorize a set of traing data values into | |
catagories. | |
""" | |
sentiment = 0 | |
focus = 0 | |
energy_level = 0 ## TODO replace with real | |
if sentiment > 0: | |
if focus > 0: # focus outward | |
if energy_level > .25: | |
return "connected" | |
elif energy_level < -.25: | |
return "tolerant" | |
else: | |
return "vunerable" | |
else: # focus inward | |
if energy_level > .25: | |
return "hopeful" | |
elif energy_level < -.25: | |
return "calm" | |
else: | |
return "happy" | |
elif sentiment <= 0: | |
if focus > 0: #focus outward | |
if energy_level > .25: | |
return "angry" | |
elif energy_level < -.25: | |
return "lonely" | |
else: | |
return "guarded" | |
else: #focus inward | |
if energy_level > .25: | |
return "anxious" | |
elif energy_level < -.25: | |
return "sad" | |
else: | |
return "fearful" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment