Scientific Python

9K posts

Scientific Python banner
Scientific Python

Scientific Python

@SciPyTip

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

Houston شامل ہوئے Şubat 2011
18 فالونگ209.7K فالوورز
Scientific Python
Scientific Python@SciPyTip·
The Python math module has asin, acos, and atan methods. NumPy has arcsin, arccos, and arctan.
English
1
1
8
1K
Scientific Python
Scientific Python@SciPyTip·
'Knowing is not enough; we must apply.' -- Goethe
English
0
0
11
1.2K
Scientific Python
Scientific Python@SciPyTip·
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.
English
0
1
8
1.6K
Scientific Python
Scientific Python@SciPyTip·
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).
English
0
0
18
2.1K
Scientific Python
Scientific Python@SciPyTip·
numpy.linspace(a, b, c) creates an array of c evenly spaced points starting with a and ending with b.
English
0
0
10
1.8K
Scientific Python
Scientific Python@SciPyTip·
NumPy arrays have methods sum(), mean(), var(), and std() for simple statistics.
English
0
2
19
2.3K
Scientific Python
Scientific Python@SciPyTip·
Matplotlib labels can take TeX strings, e.g. plt.xlabel(r'$\sqrt{x}$')
English
0
0
24
2.7K
Scientific Python
Scientific Python@SciPyTip·
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).
English
0
2
6
1.9K
Scientific Python
Scientific Python@SciPyTip·
Why does the following code not print sqrt(x**2 - 1)? >>> from sympy import * >>> x = symbols('x') >>> print( simplify(sinh(acosh(x))) ) sqrt(x - 1)*sqrt(x + 1) There's a good reason. johndcook.com/blog/2026/03/1…
English
0
2
25
3.3K