Tweets about SciPy (Scientific Python) and related topics from @JohnDCook.

Houston
Joined February 2011
Distributions in scipy.stats have a method sf for the survival function, i.e. complementary CDF.
6
4,092
Quick linear regression: scipy.stats.linregress(x, y) returns slope, intercept, rvalue, pvalue, stderr.
11
6,332
scipy.optimize contains functions for optimization and root finding
3
4,077
Scientific Python retweeted
I read this and I'm terrified, the situation seems intractable. In the python ecosystem alone every cpython install, venv, UV is at risk. Don't get my started on npm, pnpm, yarn, go, rust. My current 2026 security posture: stay home and only connect to the internet from a trusted ISP. The winter is coming. discuss.python.org/t/informa…
72
372
68
3,279
395,328
Can compute eigenvalues and eigenvectors with linalg.eig().
1
11
6,289
Histogram bin heuristic: numpy.histogram_bin_edges(x, bins='fd') uses Freedman–Diaconis rule.
10
4,637
np.unique returns the unique elements of an array in sorted order.
1
1
16
6,613
np.linalg.pinv computes the Moore-Penrose pseudo inverse of a matrix.
1
15
6,123
numpy.random.zipf(a, n) generates n samples from a discrete power law with exponent a.
1
10
5,465
np.nan_to_num() replaces nan with 0, inf with max float, and -inf with min float.
1
1
12
6,511
Latin hypercube: scipy.stats.qmc.LatinHypercube(d).random(n) is a solid design-of-experiments default.
12
5,107
Lambert W poster: orcca.on.ca/LambertW/ scipy.special.lambertw
1
4
5,102
linalg.lstsq can solve over-determined linear systems. (lstsq ~ least squares)
1
9
6,513