我如何从分组数据中获取个人消费者ID?

时间:2018-02-12 09:38:29

标签: python dataframe

DGroup=df.groupby(['Conmer id','Purchase date']).count()

Conmer id Purchase date A B C D

2397 2017-07-29 19:05:24 1 1 1 1

4107 2016-03-31 19:06:54 1 0 0 1

         2016-04-01 05:41:55        1         0          0     1  

         2016-04-02 06:18:16        1         0          0     1  

         2016-04-03 05:28:02        1         0          0     1  

         2016-04-04 05:47:08        1         0          0     1  

         2016-04-05 05:15:10        1         0          0     1  

         2016-04-09 05:40:06        1         0          0     1  

         2016-04-10 05:02:34        1         0          0     1  

         2016-04-11 05:06:18        1         0          0     1  

.... 234 2016-03-31 11:06:54 1 0 0 1

         2016-04-01 05:41:55        1         0          0     1  

         2016-04-02 16:18:16        1         0          0     1  

         2016-04-03 15:28:02        1         0          0     1  

         2016-04-04 15:47:08        1         0          0     1  

         2016-04-05 15:15:10        1         0          0     1  

         2016-04-09 15:40:06        1         0          0     1  

         2016-04-10 11:02:34        1         0          0     1  

         2016-04-11 13:06:18        1         0          0     1

2634 2015-08-16 18:26:46 1 1 1 1 0

2017-11-30 11:42:50 1 1 1 1 0 2017-12-01 06:14:47 1 1 1 1 0 2017-12-02 06:09:43 1 1 1 1 0

.... 现在我如何从这个分组数据中获取个人消费者ID,将cunsumer id和日期(整行)放入另一个变量中进行绘图和分析?

0 个答案:

没有答案