SciPy 1.3.0 is the culmination of 5 months of hard work. It contains
many new features, numerous bug-fixes, improved test coverage and better
documentation. There have been some API changes
in this release, which are documented below. All users are encouraged to
upgrade to this release, as there are a large number of bug-fixes and
optimizations. Before upgrading, we recommend that users check that
their own code does not use deprecated SciPy functionality (to do so,
run your code with
python -Wd and check for
Our development attention will now shift to bug-fix releases on the
1.3.x branch, and on adding new features on the master branch.
This release requires Python 3.5+ and NumPy 1.13.3 or greater.
For running on PyPy, PyPy3 6.0+ and NumPy 1.15.0 are required.
statsfunctions, a rewrite of
pearsonr, and an exact computation of the Kolmogorov-Smirnov two-sample test
A new Cython API for bounded scalar-function root-finders in
CSCsparse matrix indexing performance improvements
Added support for interpolation of rotations with continuous angular rate and acceleration in
A new class
CubicHermiteSpline is introduced. It is a piecewise-cubic
interpolator which matches observed values and first derivatives. Existing
Akima1DInterpolator were made subclasses of
For the Attribute-Relation File Format (ARFF)
now supports relational attributes.
scipy.io.mmread can now parse Matrix Market format files with empty lines.
Added wrappers for
?syconv routines, which convert a symmetric matrix
given by a triangular matrix factorization into two matrices and vice versa.
scipy.linalg.clarkson_woodruff_transform now uses an algorithm that leverages
sparsity. This may provide a 60-90 percent speedup for dense input matrices.
Truly sparse input matrices should also benefit from the improved sketch
algorithm, which now correctly runs in
Added new functions to calculate symmetric Fiedler matrices and
Fiedler companion matrices, named
scipy.linalg.fiedler_companion, respectively. These may be used
for root finding.
Gaussian filter performances may improve by an order of magnitude in
some cases, thanks to removal of a dependence on
scipy.ndimage.gaussian_filter for example.
scipy.optimize.brute minimizer obtained a new keyword
can be used to parallelize computation.
A Cython API for bounded scalar-function root-finders in
is available in a new module
This API may be used with
prange to loop
over an array of function arguments to solve for an array of roots more
quickly than with pure Python.
'interior-point' is now the default method for
'interior-point' now uses SuiteSparse for sparse problems when the
required scikits (scikit-umfpack and scikit-sparse) are available.
On benchmark problems (gh-10026), execution time reductions by factors of 2-3
were typical. Also, a new
method='revised simplex' has been added.
It is not as fast or robust as
method='interior-point', but it is a faster,
more robust, and equally accurate substitute for the legacy
differential_evolution can now use a
Bounds class to specify the
bounds for the optimizing argument of a function.
scipy.optimize.dual_annealing performance improvements related to
vectorisation of some internal code.
Two additional methods of discretization are now supported by
scipy.signal.firls now uses faster solvers
scipy.signal.detrend now has a lower physical memory footprint in some
cases, which may be leveraged using the new
overwrite_data keyword argument
pass_zero argument now accepts new string arguments
that allow specification of the desired filter type:
scipy.signal.sosfilt may have improved performance due to lower retention
of the global interpreter lock (GIL) in algorithm
A new keyword was added to
allows users to query the shortest path to ANY of the passed in indices,
as opposed to the shortest path to EVERY passed index.
scipy.sparse.linalg.lsmr performance has been improved by roughly 10 percent
on large problems
Improved performance and reduced physical memory footprint of the algorithm
CSC sparse matrix fancy indexing performance has been
scipy.spatial.ConvexHull now has a
good attribute that can be used
QGn Qhull options to determine which external facets of a
convex hull are visible from an external query point.
scipy.spatial.cKDTree.query_ball_point has been modernized to use some newer
Cython features, including GIL handling and exception translation. An issue
return_sorted=True and scalar queries was fixed, and a new mode named
return_length was added.
return_length only computes the length of the
returned indices list instead of allocating the array every time.
scipy.spatial.transform.RotationSpline has been added to enable interpolation
of rotations with continuous angular rates and acceleration
Added a new function to compute the Epps-Singleton test statistic,
scipy.stats.epps_singleton_2samp, which can be applied to continuous and
(geometric standard deviation) were added. The
method now supports
rvs(dim) functions’ algorithms were updated from a
implementation to a
O(dim^3) which gives large speed improvements
A rewrite of
scipy.stats.pearsonr to use a more robust algorithm,
provide meaningful exceptions and warnings on potentially pathological input,
and fix at least five separate reported issues in the original implementation.
Improved the precision of
Added exact computation for Kolmogorov-Smirnov (KS) two-sample test, replacing
the previously approximate computation for the two-sided test stats.ks_2samp.
Also added a one-sided, two-sample KS test, and a keyword
spltopp) and functions from
toimage) have been removed. The former set has
been deprecated since v0.19.0 and the latter has been deprecated since v1.0.0.
Similarly, aliases from
who) which have been deprecated since v1.0.0 are removed.
SciPy documentation for
can be used to track the new import locations for the relocated functions.
pinvh, the default cutoff values are changed
for consistency (see the docs for the actual values).
The default method for
linprog is now
'interior-point'. The method’s
robustness and speed come at a cost: solutions may not be accurate to
machine precision or correspond with a vertex of the polytope defined
by the constraints. To revert to the original simplex method,
include the argument
ks_2samp(data1, data2) would run a two-sided test and return
the approximated p-value. The new signature,
alternative="two-sided", method="auto"), still runs the two-sided test by
default but returns the exact p-value for small samples and the approximated
value for large samples.
method="asymp" would be equivalent to the
old version but
auto is the better choice.
Our tutorial has been expanded with a new section on global optimizers
There has been a rework of the
scipy.optimize now correctly sets the convergence flag of the result to
CONVERR, a convergence error, for bounded scalar-function root-finders
if the maximum iterations has been exceeded,
disp is false, and
full_output is true.
scipy.optimize.curve_fit no longer fails if
differ; they are both now automatically cast to
scipy.ndimage functions including
binary_dilation now require an integer value for the number of iterations,
which alleviates a number of reported issues.
Fixed normal approximation in case
zero_method == "pratt" in
Fixes for incorrect probabilities, broadcasting issues and thread-safety
related to stats distributions setting member variables inside
scipy.optimize.newton now correctly raises a
RuntimeError, when default
arguments are used, in the case that a derivative of value zero is obtained,
which is a special case of failing to converge.
A draft toolchain roadmap is now available, laying out a compatibility plan including Python versions, C standards, and NumPy versions.
#1320: scipy.stats.distribution: problem with self.a, self.b if they…
#2002: members set in scipy.stats.distributions.##._argcheck (Trac #1477)
#2823: distribution methods add tmp
#3220: Scipy.opimize.fmin_powell direc argument syntax unclear
#3728: scipy.stats.pearsonr: possible bug with zero variance input
#6873: ‘stats.boxcox’ return all same values
#7117: Warn users when using float32 input data to curve_fit and friends
#7632: it’s not possible to tell the `optimize.least_squares` solver…
#7730: stats.pearsonr: Potential division by zero for dataset of length…
#7933: stats.truncnorm fails when providing values outside truncation…
#8033: Add standard filter types to firwin to set pass_zero intuitively…
#8600: lfilter.c.src zfill has erroneous header
#8692: Non-negative values of `stats.hypergeom.logcdf`
#8734: Enable pip build isolation
#8861: scipy.linalg.pinv gives wrong result while scipy.linalg.pinv2…
#8915: need to fix macOS build against older numpy versions
#8980: scipy.stats.pearsonr overflows with high values of x and y
#9226: BUG: signal: SystemError: <built-in function _linear_filter>…
#9254: BUG: root finders brentq, etc, flag says “converged” even if…
#9308: Test failure - test_initial_constraints_as_canonical
#9353: scipy.stats.pearsonr returns r=1 if r_num/r_den = inf
#9359: Planck distribution is a geometric distribution
#9381: linregress should warn user in 2x2 array case
#9406: BUG: stats: In pearsonr, when r is nan, the p-value must also…
#9437: Cannot create sparse matrix from size_t indexes
#9518: Relational attributes in loadarff
#9551: BUG: scipy.optimize.newton says the root of x^2+1 is zero.
#9564: rv_sample accepts invalid input in scipy.stats
#9565: improper handling of multidimensional input in stats.rv_sample
#9581: Least-squares minimization fails silently when x and y data are…
#9587: Outdated value for scipy.constants.au
#9611: Overflow error with new way of p-value calculation in kendall…
#9645: `scipy.stats.mode` crashes with variable length arrays (`dtype=object`)
#9734: PendingDeprecationWarning for np.matrix with pytest
#9786: stats.ks_2samp() misleading for small data sets.
#9790: Excessive memory usage on detrend
#9801: dual_annealing does not set the success attribute in OptimizeResult
#9833: IntegrationWarning from mielke.stats() during build of html doc.
#9835: scipy.signal.firls seems to be inefficient versus MATLAB firls
#9864: Curve_fit does not check for empty input data if called with…
#9869: scipy.ndimage.label: Minor documentation issue
#9882: format at the wrong paranthesis in scipy.spatial.transform
#9889: scipy.signal.find_peaks minor documentation issue
#9890: Minkowski p-norm Issues in cKDTree For Values Other Than 2 Or…
#9896: scipy.stats._argcheck sets (not just checks) values
#9905: Memory error in ndimage.binary_erosion
#9909: binary_dilation/erosion/closing crashes when iterations is float
#9919: BUG: `coo_matrix` does not validate the `shape` argument.
#9982: lsq_linear hangs/infinite loop with ‘trf’ method
#10003: exponnorm.pdf returns NAN for small K
#10011: Incorrect check for invalid rotation plane in scipy.ndimage.rotate
#10024: Fails to build from git
#10048: DOC: scipy.optimize.root_scalar
#10068: DOC: scipy.interpolate.splev
#10074: BUG: `expm` calculates the wrong coefficients in the backward…
#7827: ENH: sparse: overhaul of sparse matrix indexing
#8431: ENH: Cython optimize zeros api
#8743: DOC: Updated linalg.pinv, .pinv2, .pinvh docstrings
#8744: DOC: added examples to remez docstring
#9227: DOC: update description of “direc” parameter of “fmin_powell”
#9263: ENH: optimize: added “revised simplex” for scipy.optimize.linprog
#9325: DEP: Remove deprecated functions for 1.3.0
#9330: Add note on push and pull affine transformations
#9423: DOC: Clearly state how 2x2 input arrays are handled in stats.linregress
#9428: ENH: parallelised brute
#9438: BUG: Initialize coo matrix with size_t indexes
#9455: MAINT: Speed up get_(lapack,blas)_func
#9465: MAINT: Clean up optimize.zeros C solvers interfaces/code.
#9477: DOC: linalg: fix lstsq docstring on residues shape
#9478: DOC: Add docstring examples for rosen functions
#9479: DOC: Add docstring example for ai_zeros and bi_zeros
#9480: MAINT: linalg: lstsq clean up
#9489: DOC: roadmap update for changes over the last year.
#9492: MAINT: stats: Improve implementation of chi2 ppf method.
#9497: DOC: Improve docstrings sparse.linalg.isolve
#9499: DOC: Replace “Scipy” with “SciPy” in the .rst doc files for consistency.
#9500: DOC: Document the toolchain and its roadmap.
#9505: DOC: specify which definition of skewness is used
#9511: DEP: interpolate: remove deprecated interpolate_wrapper
#9517: BUG: improve error handling in stats.iqr
#9522: ENH: Add Fiedler and fiedler companion to special matrices
#9526: TST: relax precision requirements in signal.correlate tests
#9529: DOC: fix missing random seed in optimize.newton example
#9533: MAINT: Use list comprehension when possible
#9537: DOC: add a “big picture” roadmap
#9538: DOC: Replace “Numpy” with “NumPy” in .py, .rst and .txt doc files…
#9539: ENH: add two-sample test (Epps-Singleton) to scipy.stats
#9559: DOC: add section on global optimizers to tutorial
#9561: ENH: remove noprefix.h, change code appropriately
#9562: MAINT: stats: Rewrite pearsonr.
#9563: BUG: Minor bug fix Callback in linprog(method=’simplex’)
#9568: MAINT: raise runtime error for newton with zeroder if disp true,…
#9570: Correct docstring in show_options in optimize. Fixes #9407
#9573: BUG fixes range of pk variable pre-check
#9577: TST: fix minor issue in a signal.stft test.
#9580: Included blank line before list - Fixes #8658
#9582: MAINT: drop Python 2.7 and 3.4
#9588: MAINT: update `constants.astronomical_unit` to new 2012 value.
#9592: TST: Add 32-bit testing to CI
#9593: DOC: Replace cumulative density with cumulative distribution
#9596: TST: remove VC 9.0 from Azure CI
#9599: Hyperlink DOI to preferred resolver
#9601: DEV: try to limit GC memory use on PyPy
#9603: MAINT: improve logcdf and logsf of hypergeometric distribution
#9605: Reference to pylops in LinearOperator notes and ARPACK example
#9617: TST: reduce max memory usage for sparse.linalg.lgmres test
#9619: FIX: Sparse matrix addition/subtraction eliminates explicit zeros
#9621: bugfix in rv_sample in scipy.stats
#9622: MAINT: Raise error in directed_hausdorff distance
#9623: DOC: Build docs with warnings as errors
#9625: Return the number of calls to ‘hessp’ (not just ‘hess’) in trust…
#9627: BUG: ignore empty lines in mmio
#9637: Function to calculate the MAD of an array
#9646: BUG: stats: mode for objects w/ndim > 1
#9648: Add `stats.contingency` to refguide-check
#9650: ENH: many lobpcg() algorithm improvements
#9652: Move misc.doccer to _lib.doccer
#9660: ENH: add pearson, tippett, and mudholkar-george to combine_pvalues
#9661: BUG: Fix ksone right-hand endpoint, documentation and tests.
#9664: ENH: adding multi-target dijsktra performance enhancement
#9670: MAINT: link planck and geometric distribution in scipy.stats
#9676: ENH: optimize: change default linprog method to interior-point
#9685: Added reference to ndimage.filters.median_filter
#9705: Fix coefficients in expm helper function
#9711: Release the GIL during sosfilt processing for simple types
#9721: ENH: Convexhull visiblefacets
#9723: BLD: Modify rv_generic._construct_doc to print out failing distribution…
#9726: BUG: Fix small issues with `signal.lfilter’
#9729: BUG: Typecheck iterations for binary image operations
#9730: ENH: reduce sizeof(NI_WatershedElement) by 20%
#9731: ENH: remove suspicious sequence of type castings
#9739: BUG: qr_updates fails if u is exactly in span Q
#9749: BUG: MapWrapper.__exit__ should terminate
#9753: ENH: Added exact computation for Kolmogorov-Smirnov two-sample…
#9755: DOC: Added example for signal.impulse, copied from impulse2
#9756: DOC: Added docstring example for iirdesign
#9757: DOC: Added examples for step functions
#9759: ENH: Allow pass_zero to act like btype
#9760: DOC: Added docstring for lp2bs
#9761: DOC: Added docstring and example for lp2bp
#9764: BUG: Catch internal warnings for matrix
#9766: ENH: Speed up _gaussian_kernel1d by removing dependence on np.polynomial
#9769: BUG: Fix Cubic Spline Read Only issues
#9773: DOC: Several docstrings
#9774: TST: bump Azure CI OpenBLAS version to match wheels
#9775: DOC: Improve clarity of cov_x documentation for scipy.optimize.leastsq
#9779: ENH: dual_annealing vectorise visit_fn
#9788: TST, BUG: f2py-related issues with NumPy < 1.14.0
#9791: BUG: fix amax constraint not enforced in scalar_search_wolfe2
#9792: ENH: Allow inplace copying in place in “detrend” function
#9795: DOC: Fix/update docstring for dstn and dst
#9796: MAINT: Allow None tolerances in least_squares
#9798: BUG: fixes abort trap 6 error in scipy issue 9785 in unit tests
#9807: MAINT: improve doc and add alternative keyword to wilcoxon in…
#9808: Fix PPoly integrate and test for CubicSpline
#9810: ENH: Add the geometric standard deviation function
#9811: MAINT: remove invalid derphi default None value in scalar_search_wolfe2
#9813: Adapt hamming distance in C to support weights
#9817: DOC: Copy solver description to solver modules
#9829: ENH: Add FOH and equivalent impulse response discretizations…
#9831: ENH: Implement RotationSpline
#9834: DOC: Change mielke distribution default parameters to ensure…
#9838: ENH: Use faster solvers for firls
#9854: ENH: loadarff now supports relational attributes.
#9856: integrate.bvp - improve handling of nonlinear boundary conditions
#9862: TST: reduce Appveyor CI load
#9874: DOC: Update requirements in release notes
#9883: BUG: fixed parenthesis in spatial.rotation
#9884: ENH: Use Sparsity in Clarkson-Woodruff Sketch
#9888: MAINT: Replace NumPy aliased functions
#9892: BUG: Fix 9890 query_ball_point returns wrong result when p is…
#9893: BUG: curve_fit doesn’t check for empty input if called with bounds
#9894: scipy.signal.find_peaks documentation error
#9898: BUG: Set success attribute in OptimizeResult. See #9801
#9900: BUG: Restrict rv_generic._argcheck() and its overrides from setting…
#9906: fixed a bug in kde logpdf
#9911: DOC: replace example for “np.select” with the one from numpy…
#9912: BF(DOC): point to numpy.select instead of plain (python) .select
#9914: DOC: change ValueError message in _validate_pad of signaltools.
#9915: cKDTree query_ball_point improvements
#9918: Update ckdtree.pyx with boxsize argument in docstring
#9920: BUG: sparse: Validate explicit shape if given with dense argument…
#9924: BLD: add back pyproject.toml
#9931: Fix empty constraint
#9935: DOC: fix references for stats.f_oneway
#9936: Revert gh-9619: “FIX: Sparse matrix addition/subtraction eliminates…
#9937: MAINT: fix PEP8 issues and update to pycodestyle 2.5.0
#9939: DOC: correct `structure` description in `ndimage.label` docstring
#9940: MAINT: remove extraneous distutils copies
#9945: ENH: differential_evolution can use Bounds object
#9949: Added ‘std’ to add doctstrings since it is a `known_stats`…
#9953: DOC: Documentation cleanup for stats tutorials.
#9962: __repr__ for Bounds
#9971: ENH: Improve performance of lsmr
#9987: CI: pin Sphinx version to 1.8.5
#9990: ENH: constraint violation
#9991: BUG: Avoid inplace modification of input array in newton
#9995: MAINT: sparse.csgraph: Add cdef to stop build warning.
#9996: BUG: Make minimize_quadratic_1d work with infinite bounds correctly
#10004: BUG: Fix unbound local error in linprog - simplex.
#10007: BLD: fix Python 3.7 build with build isolation
#10009: BUG: Make sure that _binary_erosion only accepts an integer number…
#10016: Update link to airspeed-velocity
#10017: DOC: Update `interpolate.LSQSphereBivariateSpline` to include…
#10018: MAINT: special: Fix a few warnings that occur when compiling…
#10019: TST: Azure summarizes test failures
#10021: ENH: Introduce CubicHermiteSpline
#10022: BENCH: Increase cython version in asv to fix benchmark builds
#10023: BUG: Avoid exponnorm producing nan for small K values.
#10025: BUG: optimize: tweaked linprog status 4 error message
#10026: ENH: optimize: use SuiteSparse in linprog interior-point when…
#10027: MAINT: cluster: clean up the use of malloc() in the function…
#10028: Fix rotate invalid plane check
#10040: MAINT: fix pratt method of wilcox test in scipy.stats
#10041: MAINT: special: Fix a warning generated when building the AMOS…
#10044: DOC: fix up spatial.transform.Rotation docstrings
#10047: MAINT: interpolate: Fix a few build warnings.
#10051: Add project_urls to setup
#10052: don’t set flag to “converged” if max iter exceeded
#10054: MAINT: signal: Fix a few build warnings and modernize some C…
#10056: BUG: Ensure factorial is not too large in kendaltau
#10058: Small speedup in samping from ortho and special_ortho groups
#10059: BUG: optimize: fix #10038 by increasing tol
#10061: BLD: DOC: make building docs easier by parsing python version.
#10064: ENH: Significant speedup for ortho and special ortho group
#10065: DOC: Reword parameter descriptions in `optimize.root_scalar`
#10066: BUG: signal: Fix error raised by savgol_coeffs when deriv > polyorder.
#10067: MAINT: Fix the cutoff value inconsistency for pinv2 and pinvh
#10072: BUG: stats: Fix boxcox_llf to avoid loss of precision.
#10075: ENH: Add wrappers for ?syconv routines
#10076: BUG: optimize: fix curve_fit for mixed float32/float64 input
#10077: DOC: Replace undefined `k` in `interpolate.splev` docstring
#10079: DOC: Fixed typo, rearranged some doc of stats.morestats.wilcoxon.
#10080: TST: install scikit-sparse for full TravisCI tests
#10083: Clean ``_clean_inputs`` in optimize.linprog
#10088: ENH: optimize: linprog test CHOLMOD/UMFPACK solvers when available
#10090: MAINT: Fix CubicSplinerInterpolator for pandas
#10091: MAINT: improve logcdf and logsf of hypergeometric distribution
#10095: MAINT: Clean ``_clean_inputs`` in linprog
#10116: MAINT: update scipy-sphinx-theme
#10135: BUG: fix linprog revised simplex docstring problem failure