我有一个有关糖尿病患者的数据。我想根据“门诊病人,住院病人和他们已经拥有的急诊电话号码”这三栏特征的数量在“医学专长”栏中填写nan值。
但是显示此ValueError:
ValueError: The truth value of a Series is ambiguous. Use a.empty,a.bool(),a.item(),a.any() or a.all().
我认为我的代码在数据类型方面存在问题,有人可以帮助我解决此问题吗?
谢谢。
这是我的代码::
''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''
对于我在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)