【发布时间】:2022-12-03 09:20:38
【问题描述】:
我努力了:
for i, row in preferences.iterrows():
if len(students_with_courses) == preferences.sum(axis = i):
但是得到以下错误: Series 的真值是不明确的。使用 a.empty、a.bool()、a.item()、a.any() 或 a.all()。
I have tried:
对于我,preferences.iterrows() 中的行: 如果 len(students_with_courses) == preferences.sum(axis = i):
But gets following error:
The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
【问题讨论】:
-
students_with_courses是什么?如果不使用row,为什么要遍历行?请提供一个完全可重现的输入/输出示例
标签: pandas