# Statistics: rowbased operations

pyranges includes fast rowbased Pearson and Spearman correlations, including a
fast row-based version of rankdata.

```{python tidy=FALSE}
import pyranges as pr
gr = pr.random(1000)
import numpy as np

size = (int(1e3), 5)
d1 = np.random.randint(0, high=20, size=size)
d2 = np.random.randint(0, high=20, size=size)

spearman = pr.stats.rowbased_spearman(d1, d2) # or rowbased_pearson(d1, d2)
print(spearman[:5])
ranks = pr.stats.rowbased_rankdata(d1) # similar to scipy.stats.rankdata
print(ranks)
```
