In R, you can use a melt function to take the below example table and convert it to a melted covariance table. Is there a function to perform this? I looked at pd.melt() but is there a way to perform this based on column name and row name? I am struggling to understand how to use this with column and row names.
ALL Examples below are made up for illustrations sake Start:
Stock AAPL COM TTD
AAPL 1 .6 .5
COM .6 1 .3
TTD .5 .3 1
Finish:
AAPL AAPL 1
AAPL COM .6
AAPL TTD .5
COM AAPL .6
COM COM 1
COMM TDD .3
TTD AAPL .5
TTD COM .3
TTD TTD 1