我有糖尿病病人的资料。我想在“医学专业”一栏中,根据“门诊、住院和急诊”三个一栏特征的数字填写nan值
但是这个值错误显示:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
我想我的代码在数据类型上有问题,有人能帮我解决这个问题吗
谢谢你
这是我的密码:
好了,好了,好了
对于df中的i:
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)
目前没有回答
相关问题 更多 >
编程相关推荐