libb.covarp

covarp(x, y)[source]

Compute population covariance between x and y.

Parameters:
  • x – First array.

  • y – Second array (same length as x).

Returns:

Population covariance.

Return type:

float

Example:

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