Skip to content

Instantly share code, notes, and snippets.

View Subho07's full-sized avatar
🏠
Working from home

Subhadip Dey Subho07

🏠
Working from home
  • Indian Institute of Technology Kharagpur
  • Kharagpur, India
View GitHub Profile
@Subho07
Subho07 / distcorr.py
Created November 27, 2021 10:14 — forked from wladston/distcorr.py
Distance correlation with p-value
from scipy.spatial.distance import pdist, squareform
import numpy as np
import copy
def distcorr(Xval, Yval, pval=True, nruns=500):
""" Compute the distance correlation function, returning the p-value.
Based on Satra/distcorr.py (gist aa3d19a12b74e9ab7941)
>>> a = [1,2,3,4,5]