1

I have data in DF that looks like this:

client_id     e_id        activity_cd     event_dt
1234          ABC         Sent            2020-07-27 13:32:56.927
1234          ABC         Open            2020-07-27 14:33:56.927
1234          ZZZ         Sent            2020-08-10 10:32:56.911
2222          ABC         Sent            2020-07-27 13:42:57.933
2222          ABC         Open            2020-07-31 08:11:56.927
2222          ABC         Click           2020-07-31 08:11:59.955

I want to make it wide so it would look like this.

uid    e_id   sent_time         open_time          first_click_time
1234   ABC    2020-07-27 13:32  2020-07-27 14:33:56
1234   ZZZ    2020-08-10 10:32
2222   ABC    2020-07-27 13:42  2020-07-31 08:11:56 2020-07-31 08:11:59.955

I tried using unstack and pivot, but I either wasn't getting what I was going for or was getting an error about Date not being a unique index.

Joe Brown
  • 11
  • 1

0 Answers0