February 25, 2026
Love is non‑linear
Scipy.stats. Chatterjeexi
SciPy’s new ‘xi’ says when two things vibe — comments explode
TLDR: SciPy’s xi correlation spots non‑straight‑line relationships and offers flexible p‑value methods, sparking hype and skepticism. Commenters point to the original paper while debating asymmetry, tie handling, and GPU support, arguing whether xi is a breakthrough or just another stat to confuse the masses.
SciPy’s “chatterjeexi” is here to measure how two things move together even when the relationship isn’t a straight line. Think: a roller‑coaster pattern like a sine wave — xi still catches the vibe. It runs fast, handles missing values, and even plays nice with GPU backends like JAX and PyTorch. But it’s not symmetric (x vs y order matters), and ties in data get “broken” by adding tiny random noise. That’s where the drama begins.
Fans are thrilled: “Finally, a correlation that sees curvy relationships,” while skeptics clutch pearls over the “add noise” advice and the asymmetry by design. The p‑value options — quick “asymptotic” vs the more hands‑on permutation test — triggered a mini p‑value war, with armchair statisticians re‑enacting textbook battles in the comments. Another meme moment: “np.matrix is dead, long live ndarray,” as veterans hold a mock funeral for legacy code. And the name itself sparked jokes: “Xi? Is this the ex who still knows all your patterns?”
The lone visible comment dropped the receipts: the paper. From there, the crowd split — one side shouting “science!” and the other yelling “yet another correlation to confuse students.” Meanwhile, GPU people flexed, telling everyone to set the magic variable and let JAX cook. Drama level: spicy
Key Points
- •scipy.stats.chatterjeexi computes Chatterjee’s xi correlation and performs a test of independence.
- •The p-value method can be ‘asymptotic’ (normal approximation) or permutation-based via a PermutationMethod.
- •Parameters include y_continuous for performance, nan_policy for NaN handling, axis/keepdims controls, and broadcastable inputs.
- •The statistic is asymmetric in x and y; ties in x are broken arbitrarily, with a recommendation to break ties uniformly at random (e.g., add small noise).
- •SciPy 1.9 converts np.matrix to np.ndarray and offers experimental Array API support for CuPy, PyTorch, JAX, and Dask via SCIPY_ARRAY_API.