I have a data about diabetes patients. I want to fill nan values in "medical speciality" column based on the numbers of three column features " outpatients, inpatients and emergency numbers they already have".
but this ValueError displayed :
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
I think my code has a problem in datatypes can anyone help me to fix this please?
thank you .
this is my code ::
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
for i in df:
a = df['number_outpatient']
b = df['number_inpatient']
c = df['number_emergency']
d = df['medical_specialty']
if a > b > c:
d.fillna("Outpatient Clinic", inplace = True)
elif a > c > b:
d.fillna("Outpatient Clinic", inplace = True)
elif b > a > c:
d.fillna("Inpatient", inplace = True)
elif b > c > a:
d.fillna("Inpatient", inplace = True)
elif c > b > a:
d.fillna("Emergency", inplace = True)
elif c > a > b:
d.fillna("Emergency", inplace = True)
else:
d.fillna("Overloded / No Bed", inplace = True)