I would like to create a correlation data between columns like in this diagonal correlation matrix.
My data is currently is this format:
And i need to convert it to this format:
How is this possible, merging the categories from T and G into the Sample columns?
Thanks for your help!
Edit:
print(df.dtypes)
outputs:
T
int64
Group
object
Sample1
float64
Sample2
int64
Sample3
float64
dtype: object
print(df.index)
outputs:
Int64Index([0, 1, 3, 6, 16, 18, 19, ..., 52], dtype='int64')
print(type(df))
outputs:
<class 'pandas.core.frame.DataFrame'>
df.set_index(['T', 'Group'])
to iterate over the indexes and creating a new dataset with a new column for each iteration. Is there a better way? – Hmmm Feb 12 at 17:13