【发布时间】:2021-08-17 12:45:15
【问题描述】:
我有一个示例数据:
date Product Advert_Type total_clients
2020-01-01. Dell. call. 10
2020-01-01. Dell. Email. 5
2020-01-01. Apple. call. 6
2020-01-01. Apple fax. 4
2020-01-02. Dell. Email. 5
2020-01-02. Dell. fax. 4
2020-01-02. Apple. visit. 2
2020-01-02. Apple. call. 1
我想获得每个产品每月获得的客户总数以及每个产品类型在该月完成的事件列表。
输出应如下所示:
date Product. Advert_Type. Total_Clients
2020-01-01. Dell. [call,email]. 15
2020-01-01. Apple. [call, fax]. 10
2020-01-02. Dell [email, fax]. 9
2020-01-02 Apple. [visit, call]. 3
【问题讨论】:
标签: python pandas dataframe numpy data-science