I have got data frame with the rows (5000000) as customers and rows(500) as products.
Cust/Pro P1 P2 P3 P4
C1 1 0 0 1
C2 0 1 0 1
C3 1 1 0 0
C4 1 0 1 1
I want to convert this into
P1 P2 P3 P4
P1 3 0 1 2
P2 0 2 0 1
P3 1 0 1 1
P4 2 1 1 3
It also needs to be efficient since the data frame size is also big. Tried correlation and cos product of matrix. No getting the exact result.