0

I have a dataset which roughly looks like this:

ID        Product      Time
C0014        X1        2020-05-01  
                       00:00:04
C4321        X2        2020-05-01 
                       00:00:06
C0014        X1        2020-05-01
                       00:00:08

I would like to count the first occurence of every unique ID per product per month. So if a Product ID appears once in January and then in February, I only want to count it in January for that specific Product. Unfortunately, I have no clue how to do that. Thank you for any help!

Michelle
  • 247
  • 2
  • 9
  • 3
    Welcome to Stackoverflow. Please take the time to read this post on [how to provide a great pandas example](http://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples) as well as how to provide a [minimal, complete, and verifiable example](http://stackoverflow.com/help/mcve) and revise your question accordingly. These tips on [how to ask a good question](http://stackoverflow.com/help/how-to-ask) may also be useful. – jezrael Aug 25 '20 at 08:22
  • If a product appears twice in Jan, do you want to count it as 1 or 2? – Shaunak Sen Aug 25 '20 at 09:46
  • I want to count the ID only the first time it appears. – Michelle Aug 25 '20 at 12:49

0 Answers0