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

Houston
To take the element-wise maximum of two arrays x and y, use np.maximum(x, y).
1
18
6,564
scipy.special.zeta(x, q) implements the generalized (Hurwitz) zeta function. Riemann zeta corresponds to q=1.
14
6,493
'Knowing is not enough; we must apply.' -- Goethe
1
12
5,827
The function np.partition(x, k) finds the k-th order statistic without fully sorting the array.
13
6,464
Save a figure to file using plt.savefig with filename. File format is inferred from name. E.g. plt.savefig('foo.png') saves as PNG.
11
6,472
Scientific Python lecture notes scipy-lectures.github.io/ind…
3
29
6,566
Can use scipy.integrate.quad(f, a, b) to integrate f(x) from a to b. Limits could be infinite, e.g. quad(f, -inf, inf).
4
19
6,557
numpy.linspace(a, b, c) creates an array of c evenly spaced points starting with a and ending with b.
18
6,359
Can compute quantiles with np.quantile. For example, np.quantile(x, [0.25, 0.5, 0.75]) yields quartiles.
1
1
13
6,710
NumPy arrays have methods sum(), mean(), var(), and std() for simple statistics.
1
17
6,548
Matplotlib labels can take TeX strings, e.g. plt.xlabel(r'$\sqrt{x}$')
13
6,579
SciPy has optimized versions of Bessel functions of order 0 and 1. For example, j0(z) & j1(z) are faster versions of jn(0, z) & jn(1,z).
1
18
6,605
astropy.io.ascii provides methods for reading and writing a wide range of ASCII data table formats. docs.astropy.org/en/latest/i…
5
6,131
BLAS: Basic Linear Algebra Subprograms netlib.org/blas/
31
6,524
The Blaze Ecosystem blaze.pydata.org/
1
9
6,519
Special functions (Bessel functions, Gamma function, etc.) are located in scipy.special.
18
6,522