0

I have a dataframe as follows:


                      col1   col2     sum    value_1   value_2   value_3   value_4
timestamp       
2022-05-09 11:28:00    30     09       100      0         0        0         1
2022-05-09 11:28:01    30     11       105      0         0        1         0
2022-05-09 11:28:02    30     09       103      0         0        0         1
2022-05-09 11:28:03    50     11       109      0         1        1         0
2022-05-09 11:28:04    50     09       110      0         1        0         1
2022-05-09 11:28:05    50     09       101      0         1        0         1

From the above table, I want to extract the unique combinations of the values present in col1 and col2 ignoring the timestamp and the column sum. For example: from the above table, I want the following:

  col1   col2   value_1   value_2   value_3   value_4
   30     09      0         0        0         1
   30     11      0         0        1         0
   50     11      0         1        1         0
   50     09      0         1        0         1

The combinations (30,09), (30,11), (50,11) and (50,09) are unique. the values present in value_1, value_2, value_3, value_4 are same for a particular combination.

Is there a way to obtain this?

EngGu
  • 459
  • 3
  • 14

0 Answers0