samedi 3 mars 2018

I want to identify the age range ,which will child,adult

Here i used function to identify category of age(i have a column which contains 800 age data from .65 to 55) and i want to create a new column in which based on age

def get_person_identify(Predicted_Age1): if Predicted_Age1<=13: return child if Predicted_Age1<=2: return infant if Predicted_Age1>13: return adult after apply this function i did this where i am trying to create a new column data2['Person']=data2[['Predicted_Age1']].apply(get_person_identify,axis=1)

i am getting error after applying this , i am new on python Thanks in advance

Aucun commentaire:

Enregistrer un commentaire