I have a list of pandas datasets like the one below:
dataset_list=[df1,df2,df3]
What I need to do is compute the correlation coefficient of each dataset. Since I would not like to do this manually, I tried to use a for loop to accomplish this:
for dataset in dataset_list:
corr_matrices=dataset.corr()
corr_matrices.to_csv(str(dataset)+'Correlation_Matrices.csv', sep=',')
However, the output only shows the correlation matrix for the last dataset and not the first two. How can I fix this and save each correlation matrix in its own separate .csv file?