April 2019
Intermediate to advanced
426 pages
11h 13m
English
Correlation is a statistical association of how closely two variables have a linear relationship with each other. We can perform a correlation calculation on the returns of two time series datasets to give us a value between -1 and 1. A correlation value of 0 indicates that the returns of the two time series have no relation to each other. A high correlation value close to 1 indicates that the returns of the two time series data tend to move together. A low value close to -1 indicates that returns tend to move inversely in relation to each other.
In pandas, the corr() method computes the correlations between columns in its supplied DataFrame and outputs these values as a matrix. In the previous example, we ...
Read now
Unlock full access