小编Yam*_*ing的帖子

找出最频率组合并添加标签

我有一个表格,其中包含我的客户数据:

Customer    Price
AAA            100
AAA            100
AAA            200
BBB            100
BBB            220
BBB            200
BBB            200
Run Code Online (Sandbox Code Playgroud)

我想要做的是找出具有条件的客户number of price >= 200 is more than number of price < 200并为他们添加标签.例如:

Customer    LABELS
AAA            FALSE
BBB            TRUE
Run Code Online (Sandbox Code Playgroud)

对这个问题的任何想法?

python group-by frequency pandas pandas-groupby

2
推荐指数
1
解决办法
63
查看次数

标签 统计

frequency ×1

group-by ×1

pandas ×1

pandas-groupby ×1

python ×1