0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

spearmanr

Posted at

import numpy as np
from scipy.stats import spearmanr

Sample data

x = np.array([1, 2, 3, 4, 5])
y = np.array([5, 4, 3, 2, 1])

Calculate Spearman correlation coefficient and p-value

corr, p_value = spearmanr(x, y)

print("Spearman correlation coefficient:", corr)
print("P-value:", p_value) # pvalue < 0.05 is better

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?