libb.correl

correl(x, y)[source]

Compute correlation between x and y.

Parameters:
  • x – First array.

  • y – Second array.

Returns:

Correlation coefficient.

Return type:

float

Example:

>>> x = [3, 2, 4, 5, 6]
>>> y = [9, 7, 12, 15, 17]
>>> "{:.3}".format(correl(x, y))
'0.997'