The Spearman rank-order correlation is a comparison between the rankings of two variables. It neatly bypasses the magnitude of the values, and it can often find a correlation even when the relationship is not linear. The formula is as follows:
This formula shows us that we'll be summing the differences in rank , and , for all of the pairs of observed values. The Python version of this depends on the