I have a data frame like this:
df:
Col-1 Col-2 Col-3 ..................Col-100
index
A 23 33 1 5
A 33 22 4 29
A 1 5 3 24
B 65 12 4 42
B 2 24 4 24
B 3 12 24 5
I want to calculate the correlation for Col-1 against all the other columns and group them by Index.
So my output looks like this:
Col-1 Col-2 Col-3 ............Col-100
A 1 0.24 0.2 0.45
B 1 0.30 0.25 0.18
Can anyone help me with this?