【发布时间】:2021-02-07 04:28:37
【问题描述】:
我读到了一个包含每日条目的考勤卡 CSV 文件:“用户”、“小时”。 我想知道提交了部分考勤卡(例如,每周少于 40 小时)的用户列表。
summed_entries = df.groupby('User')['Hours'].sum()
# This returns me a Series of Users and their total hours logged.
for item in summed_entries:
if item < 40:
print(???) # This is where I want to return the User, available to me as the Series index label. I am unclear how to go about this.
【问题讨论】:
-
print(item)长什么样子?
标签: python pandas dataframe series