0

I have a dataframe like below:

      Col1   Col2    Col3   Col4
2018-01-12      A       B      2
2018-01-13      A       B      3
2018-01-14      A       C      5
2018-01-15      B       C      7
2018-01-16      B       D      8

How do I count the number of occurrences for combination of Col2 and Col3?

Final Expected Output:

      Col1   Col2    Col3   Col4   Count
2018-01-12      A       B      2       2
2018-01-13      A       B      3       2
2018-01-14      A       C      5       1
2018-01-15      B       C      7       1
2018-01-16      B       D      8       1
nak5120
  • 4,089
  • 4
  • 35
  • 94

0 Answers0