SciPy Reference Guide
Release 0.19.0
Written by the SciPy community
March 09, 2017
CONTENTS
1 Release Notes 3
1.1 SciPy 0.19.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 SciPy 0.18.1 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.3 SciPy 0.18.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.4 SciPy 0.17.1 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
1.5 SciPy 0.17.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
1.6 SciPy 0.16.1 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
1.7 SciPy 0.16.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
1.8 SciPy 0.15.1 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
1.9 SciPy 0.15.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
1.10 SciPy 0.14.1 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
1.11 SciPy 0.14.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
1.12 SciPy 0.13.2 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
1.13 SciPy 0.13.1 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
1.14 SciPy 0.13.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
1.15 SciPy 0.12.1 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
1.16 SciPy 0.12.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
1.17 SciPy 0.11.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
1.18 SciPy 0.10.1 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
1.19 SciPy 0.10.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
1.20 SciPy 0.9.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
1.21 SciPy 0.8.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
1.22 SciPy 0.7.2 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
1.23 SciPy 0.7.1 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
1.24 SciPy 0.7.0 Release Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
2 API - importing from Scipy 141
2.1 Guidelines for importing functions from Scipy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
2.2 API definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
3 Tutorial 145
3.1 SciPy Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
4 Developer’s Guide 293
4.1 Contributing to SciPy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
4.2 SciPy Developer Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
4.3 SciPy Roadmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
5 API Reference 315
5.1 Clustering package (scipy.cluster) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
5.2 K-means clustering and vector quantization (scipy.cluster.vq) . . . . . . . . . . . . . . . . . 315
i
5.3 Hierarchical clustering (scipy.cluster.hierarchy) . . . . . . . . . . . . . . . . . . . . . . 319
5.4 Constants (scipy.constants) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
5.5 Discrete Fourier transforms (scipy.fftpack) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
5.6 Integration and ODEs (scipy.integrate) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
5.7 Interpolation (scipy.interpolate) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
5.8 Input and output (scipy.io) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
5.9 Linear algebra (scipy.linalg) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
5.10 Low-level BLAS functions (scipy.linalg.blas) . . . . . . . . . . . . . . . . . . . . . . . . . 555
5.11 Low-level LAPACK functions (scipy.linalg.lapack) . . . . . . . . . . . . . . . . . . . . . 591
5.12 BLAS Functions for Cython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
5.13 LAPACK functions for Cython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
5.14 Interpolative matrix decomposition (scipy.linalg.interpolative) . . . . . . . . . . . . . 726
5.15 Miscellaneous routines (scipy.misc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 735
5.16 Multi-dimensional image processing (scipy.ndimage) . . . . . . . . . . . . . . . . . . . . . . . 748
5.17 Orthogonal distance regression (scipy.odr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 818
5.18 Optimization and root finding (scipy.optimize) . . . . . . . . . . . . . . . . . . . . . . . . . . 827
5.19 Nonlinear solvers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 923
5.20 Signal processing (scipy.signal) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 925
5.21 Sparse matrices (scipy.sparse) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1129
5.22 Sparse linear algebra (scipy.sparse.linalg) . . . . . . . . . . . . . . . . . . . . . . . . . . 1263
5.23 Compressed Sparse Graph Routines (scipy.sparse.csgraph) . . . . . . . . . . . . . . . . . . 1295
5.24 Spatial algorithms and data structures (scipy.spatial) . . . . . . . . . . . . . . . . . . . . . . 1310
5.25 Distance computations (scipy.spatial.distance) . . . . . . . . . . . . . . . . . . . . . . . 1356
5.26 Special functions (scipy.special) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1372
5.27 Statistical functions (scipy.stats) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1496
5.28 Statistical functions for masked arrays (scipy.stats.mstats) . . . . . . . . . . . . . . . . . . 1882
5.29 Low-level callback functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1912
Bibliography 1915
Python Module Index 1941
Index 1943
ii
SciPy Reference Guide, Release 0.19.0
Release 0.19.0
Date March 09, 2017
SciPy (pronounced “Sigh Pie”) is open-source software for mathematics, science, and engineering.
CONTENTS 1