我有一个名为Dataprep的数据帧,有19列和18484个raw。我已经用下面的代码聚合了我想要的列:
Dataprep.groupby('CustomerKey').OrderQuantity.agg('count')
CustomerKey是客户的ID号,orderquantity是每个客户的订单数。数据看起来像
11000-1个
11000-1个
11000-1个
11000-1个
11001年-1月
11001年-1月
11001年-1月
11001年-1月
11002年-1月
11002年-1月
11002年-1月
11002年-1月
11002年-1月
11003年-1月
11003年-1月
11003年-1月
11003年-1月
11003年-1月
11004年-1月
11004年-1月
11004年-1月
11004年-1月
第一列是customerkey,另一列是orderquantity
我的问题是如何将其应用于DataFrame Dataprep。我想保留所有其他栏目
谢谢
似乎你需要^{} :
相关问题 更多 >
编程相关推荐