gpt4 book ai didi

python - 查找创建内容超过 500 条的内容用户创建总数,Python

转载 作者:行者123 更新时间:2023-11-28 19:00:49 24 4
gpt4 key购买 nike

这是我用于此计算的数据的 .head():

enter image description here

到目前为止,我已经这样做了:

group = user_message.groupby('user_id')
agg = group.aggregate({'content_count': np.sum})
agg

这给了我这个输出:

enter image description here

现在我只想返回 content_count 大于 500 的 user_id。我想我可以只修改这一行:agg = group。聚合({'content_count':np.sum > 500}) 但是这样做时出现此错误:

TypeError: '>' not supported between instances of 'function' and 'int'

最佳答案

尝试

agg[agg.content_count>500]

关于python - 查找创建内容超过 500 条的内容用户创建总数,Python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52824908/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com