Changelog
### 1.8.1
```
compared to `1.8.0`. Notably, usage of Pythran has been
restored for Windows builds/binaries.
Authors
=======
* Henry Schreiner
* Maximilian Nöthe
* Sebastian Berg (1)
* Sameer Deshmukh (1) +
* Niels Doucet (1) +
* DWesl (4)
* Isuru Fernando (1)
* Ralf Gommers (4)
* Matt Haberland (1)
* Andrew Nelson (1)
* Dimitri Papadopoulos Orfanos (1) +
* Tirth Patel (3)
* Tyler Reddy (46)
* Pamphile Roy (7)
* Niyas Sait (1) +
* H. Vetinari (2)
* Warren Weckesser (1)
A total of 17 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.8.0
```
many new features, numerous bug-fixes, improved test coverage and better
documentation. There have been a number of deprecations and 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 ``DeprecationWarning`` s).
Our development attention will now shift to bug-fix releases on the
1.8.x branch, and on adding new features on the master branch.
This release requires Python `3.8`+ and NumPy `1.17.3` or greater.
For running on PyPy, PyPy3 `6.0`+ is required.
Highlights of this release
-------------------------
- A sparse array API has been added for early testing and feedback; this
work is ongoing, and users should expect minor API refinements over
the next few releases.
- The sparse SVD library PROPACK is now vendored with SciPy, and an interface
is exposed via `scipy.sparse.svds` with ``solver='PROPACK'``.
- A new `scipy.stats.sampling` submodule that leverages the ``UNU.RAN`` C
library to sample from arbitrary univariate non-uniform continuous and
discrete distributions
- All namespaces that were private but happened to miss underscores in
their names have been deprecated.
New features
-------------
`scipy.fft` improvements
========================
Added an ``orthogonalize=None`` parameter to the real transforms in `scipy.fft`
which controls whether the modified definition of DCT/DST is used without
changing the overall scaling.
`scipy.fft` backend registration is now smoother, operating with a single
registration call and no longer requiring a context manager.
`scipy.integrate` improvements
==============================
`scipy.integrate.quad_vec` introduces a new optional keyword-only argument,
``args``. ``args`` takes in a tuple of extra arguments if any (default is
``args=()``), which is then internally used to pass into the callable function
(needing these extra arguments) which we wish to integrate.
`scipy.interpolate` improvements
================================
`scipy.interpolate.BSpline` has a new method, ``design_matrix``, which
constructs a design matrix of b-splines in the sparse CSR format.
A new method ``from_cubic`` in ``BSpline`` class allows to convert a
``CubicSpline`` object to ``BSpline`` object.
`scipy.linalg` improvements
===========================
`scipy.linalg` gained three new public array structure investigation functions.
`scipy.linalg.bandwidth` returns information about the bandedness of an array
and can be used to test for triangular structure discovery, while
`scipy.linalg.issymmetric` and `scipy.linalg.ishermitian` test the array for
exact and approximate symmetric/Hermitian structure.
`scipy.optimize` improvements
=============================
`scipy.optimize.check_grad` introduces two new optional keyword only arguments,
``direction`` and ``seed``. ``direction`` can take values, ``'all'`` (default),
in which case all the one hot direction vectors will be used for verifying
the input analytical gradient function and ``'random'``, in which case a
random direction vector will be used for the same purpose. ``seed``
(default is ``None``) can be used for reproducing the return value of
``check_grad`` function. It will be used only when ``direction='random'``.
The `scipy.optimize.minimize` ``TNC`` method has been rewritten to use Cython
bindings. This also fixes an issue with the callback altering the state of the
optimization.
Added optional parameters ``target_accept_rate`` and ``stepwise_factor`` for
adapative step size adjustment in ``basinhopping``.
The ``epsilon`` argument to ``approx_fprime`` is now optional so that it may
have a default value consistent with most other functions in `scipy.optimize`.
`scipy.signal` improvements
===========================
Add ``analog`` argument, default ``False``, to ``zpk2sos``, and add new pairing
option ``'minimal'`` to construct analog and minimal discrete SOS arrays.
``tf2sos`` uses zpk2sos; add ``analog`` argument here as well, and pass it on
to ``zpk2sos``.
``savgol_coeffs`` and ``savgol_filter`` now work for even window lengths.
Added the Chirp Z-transform and Zoom FFT available as `scipy.signal.CZT` and
`scipy.signal.ZoomFFT`.
`scipy.sparse` improvements
===========================
An array API has been added for early testing and feedback; this
work is ongoing, and users should expect minor API refinements over
the next few releases. Please refer to the `scipy.sparse`
docstring for more information.
``maximum_flow`` introduces optional keyword only argument, ``method``
which accepts either, ``'edmonds-karp'`` (Edmonds Karp algorithm) or
``'dinic'`` (Dinic's algorithm). Moreover, ``'dinic'`` is used as default
value for ``method`` which means that Dinic's algorithm is used for computing
maximum flow unless specified. See, the comparison between the supported
algorithms in
`this comment <https://github.com/scipy/scipy/pull/14358#issue-684212523>`_.
Parameters ``atol``, ``btol`` now default to 1e-6 in
`scipy.sparse.linalg.lsmr` to match with default values in
`scipy.sparse.linalg.lsqr`.
Add the Transpose-Free Quasi-Minimal Residual algorithm (TFQMR) for general
nonsingular non-Hermitian linear systems in `scipy.sparse.linalg.tfqmr`.
The sparse SVD library PROPACK is now vendored with SciPy, and an interface is
exposed via `scipy.sparse.svds` with ``solver='PROPACK'``. For some problems,
this may be faster and/or more accurate than the default, ARPACK.
``sparse.linalg`` iterative solvers now have a nonzero initial guess option,
which may be specified as ``x0 = 'Mb'``.
The ``trace`` method has been added for sparse matrices.
`scipy.spatial` improvements
============================
`scipy.spatial.transform.Rotation` now supports item assignment and has a new
``concatenate`` method.
Add `scipy.spatial.distance.kulczynski1` in favour of
`scipy.spatial.distance.kulsinski` which will be deprecated in the next
release.
`scipy.spatial.distance.minkowski` now also supports ``0<p<1``.
`scipy.special` improvements
============================
The new function `scipy.special.log_expit` computes the logarithm of the
logistic sigmoid function. The function is formulated to provide accurate
results for large positive and negative inputs, so it avoids the problems
that would occur in the naive implementation ``log(expit(x))``.
A suite of five new functions for elliptic integrals:
``scipy.special.ellipr{c,d,f,g,j}``. These are the
`Carlson symmetric elliptic integrals <https://dlmf.nist.gov/19.16>`_, which
have computational advantages over the classical Legendre integrals. Previous
versions included some elliptic integrals from the Cephes library
(``scipy.special.ellip{k,km1,kinc,e,einc}``) but was missing the integral of
third kind (Legendre's Pi), which can be evaluated using the new Carlson
functions. The new Carlson elliptic integral functions can be evaluated in the
complex plane, whereas the Cephes library's functions are only defined for
real inputs.
Several defects in `scipy.special.hyp2f1` have been corrected. Approximately
correct values are now returned for ``z`` near ``exp(+-i*pi/3)``, fixing
`8054 <https://github.com/scipy/scipy/issues/8054>`_. Evaluation for such ``z``
is now calculated through a series derived by
`López and Temme (2013) <https://arxiv.org/abs/1306.2046>`_ that converges in
these regions. In addition, degenerate cases with one or more of ``a``, ``b``,
and/or ``c`` a non-positive integer are now handled in a manner consistent with
`mpmath's hyp2f1 implementation <https://mpmath.org/doc/current/functions/hypergeometric.html>`_,
which fixes `7340 <https://github.com/scipy/scipy/issues/7340>`_. These fixes
were made as part of an effort to rewrite the Fortran 77 implementation of
hyp2f1 in Cython piece by piece. This rewriting is now roughly 50% complete.
`scipy.stats` improvements
==========================
`scipy.stats.qmc.LatinHypercube` introduces two new optional keyword-only
arguments, ``optimization`` and ``strength``. ``optimization`` is either
``None`` or ``random-cd``. In the latter, random permutations are performed to
improve the centered discrepancy. ``strength`` is either 1 or 2. 1 corresponds
to the classical LHS while 2 has better sub-projection properties. This
construction is referred to as an orthogonal array based LHS of strength 2.
In both cases, the output is still a LHS.
`scipy.stats.qmc.Halton` is faster as the underlying Van der Corput sequence
was ported to Cython.
The ``alternative`` parameter was added to the ``kendalltau`` and ``somersd``
functions to allow one-sided hypothesis testing. Similarly, the masked
versions of ``skewtest``, ``kurtosistest``, ``ttest_1samp``, ``ttest_ind``,
and ``ttest_rel`` now also have an ``alternative`` parameter.
Add `scipy.stats.gzscore` to calculate the geometrical z score.
Random variate generators to sample from arbitrary univariate non-uniform
continuous and discrete distributions have been added to the new
`scipy.stats.sampling` submodule. Implementations of a C library
`UNU.RAN <http://statmath.wu.ac.at/software/unuran/>`_ are used for
performance. The generators added are:
- TransformedDensityRejection
- DiscreteAliasUrn
- NumericalInversePolynomial
- DiscreteGuideTable
- SimpleRatioUniforms
The ``binned_statistic`` set of functions now have improved performance for
the ``std``, ``min``, ``max``, and ``median`` statistic calculations.
``somersd`` and ``_tau_b`` now have faster Pythran-based implementations.
Some general efficiency improvements to handling of ``nan`` values in
several ``stats`` functions.
Added the Tukey-Kramer test as `scipy.stats.tukey_hsd`.
Improved performance of `scipy.stats.argus` ``rvs`` method.
Added the parameter ``keepdims`` to `scipy.stats.variation` and prevent the
undesirable return of a masked array from the function in some cases.
``permutation_test`` performs an exact or randomized permutation test of a
given statistic on provided data.
Deprecated features
---------------------
Clear split between public and private API
==========================================
SciPy has always documented what its public API consisted of in
:ref:`its API reference docs <scipy-api>`,
however there never was a clear split between public and
private namespaces in the code base. In this release, all namespaces that were
private but happened to miss underscores in their names have been deprecated.
These include (as examples, there are many more):
- ``scipy.signal.spline``
- ``scipy.ndimage.filters``
- ``scipy.ndimage.fourier``
- ``scipy.ndimage.measurements``
- ``scipy.ndimage.morphology``
- ``scipy.ndimage.interpolation``
- ``scipy.sparse.linalg.solve``
- ``scipy.sparse.linalg.eigen``
- ``scipy.sparse.linalg.isolve``
All functions and other objects in these namespaces that were meant to be
public are accessible from their respective public namespace (e.g.
`scipy.signal`). The design principle is that any public object must be
accessible from a single namespace only; there are a few exceptions, mostly for
historical reasons (e.g., ``stats`` and ``stats.distributions`` overlap).
For other libraries aiming to provide a SciPy-compatible API, it is now
unambiguous what namespace structure to follow. See
`gh-14360 <https://github.com/scipy/scipy/issues/14360>`_ for more details.
Other deprecations
--------------------
``NumericalInverseHermite`` has been deprecated from `scipy.stats` and moved
to the `scipy.stats.sampling` submodule. It now uses the C implementation of
the UNU.RAN library so the result of methods like ``ppf`` may vary slightly.
Parameter ``tol`` has been deprecated and renamed to ``u_resolution``. The
parameter ``max_intervals`` has also been deprecated and will be removed in a
future release of SciPy.
Backwards incompatible changes
----------------------------------
- SciPy has raised the minimum compiler versions to GCC 6.3 on linux and
VS2019 on windows. In particular, this means that SciPy may now use C99 and
C++14 features. For more details see
`here <https://docs.scipy.org/doc/scipy/reference/dev/toolchain.html>`_.
- The result for empty bins for `scipy.stats.binned_statistic` with the builtin
``'std'`` metric is now ``nan``, for consistency with ``np.std``.
- The function `scipy.spatial.distance.wminkowski` has been removed. To achieve
the same results as before, please use the ``minkowski`` distance function
with the (optional) ``w=`` keyword-argument for the given weight.
Other changes
---------------
Some Fortran 77 code was modernized to be compatible with NAG's nagfor Fortran
compiler (see, e.g., `PR 13229 <https://github.com/scipy/scipy/pull/13229>`_).
``threadpoolctl`` may now be used by our test suite to substantially improve
the efficiency of parallel test suite runs.
Authors
---------
* endolith
* adamadanandy +
* akeemlh +
* Anton Akhmerov
* Marvin Albert +
* alegresor +
* Andrew Annex +
* Pantelis Antonoudiou +
* Ross Barnowski +
* Christoph Baumgarten
* Stephen Becker +
* Nickolai Belakovski
* Peter Bell
* berberto +
* Georgii Bocharov +
* Evgeni Burovski
* Matthias Bussonnier
* CJ Carey
* Justin Charlong +
* Dennis Collaris +
* David Cottrell +
* cruyffturn +
* da-woods +
* Anirudh Dagar
* Tiger Du +
* Thomas Duvernay
* Dani El-Ayyass +
* Castedo Ellerman +
* Donnie Erb +
* Andreas Esders-Kopecky +
* Livio F +
* Isuru Fernando
* Evelyn Fitzgerald +
* Sara Fridovich-Keil +
* Mark E Fuller +
* Ralf Gommers
* Kevin Richard Green +
* guiweber +
* Nitish Gupta +
* h-vetinari
* Matt Haberland
* J. Hariharan +
* Charles Harris
* Trever Hines
* Ian Hunt-Isaak +
* ich +
* Itrimel +
* Jan-Hendrik Müller +
* Jebby993 +
* Evan W Jones +
* Nathaniel Jones +
* Jeffrey Kelling +
* Malik Idrees Hasan Khan +
* Sergey B Kirpichev
* Kadatatlu Kishore +
* Andrew Knyazev
* Ravin Kumar +
* Peter Mahler Larsen
* Eric Larson
* Antony Lee
* Gregory R. Lee
* Tim Leslie
* lezcano +
* Xingyu Liu
* Christian Lorentzen
* Lorenzo +
* Smit Lunagariya +
* Lv101Magikarp +
* Yair M +
* Cong Ma
* Lorenzo Maffioli +
* majiang +
* Brian McFee +
* Nicholas McKibben
* John Speed Meyers +
* millivolt9 +
* Jarrod Millman
* Harsh Mishra +
* Boaz Mohar +
* naelsondouglas +
* Andrew Nelson
* Nico Schlömer
* Thomas Nowotny +
* nullptr +
* Teddy Ort +
* Nick Papior
* ParticularMiner +
* Dima Pasechnik
* Tirth Patel
* Matti Picus
* Ilhan Polat
* Adrian Price-Whelan +
* Quentin Barthélemy +
* Sundar R +
* Judah Rand +
* Tyler Reddy
* Renal-Of-Loon +
* Frederic Renner +
* Pamphile Roy
* Bharath Saiguhan +
* Atsushi Sakai
* Eric Schanet +
* Sebastian Wallkötter
* serge-sans-paille
* Reshama Shaikh +
* Namami Shanker
* Walter Simson +
* Gagandeep Singh +
* Leo C. Stein +
* Albert Steppi
* Kai Striega
* Diana Sukhoverkhova
* Søren Fuglede Jørgensen
* Mike Taves
* Ben Thompson +
* Bas van Beek
* Jacob Vanderplas
* Dhruv Vats +
* H. Vetinari +
* Thomas Viehmann +
* Pauli Virtanen
* Vlad +
* Arthur Volant
* Samuel Wallan
* Stefan van der Walt
* Warren Weckesser
* Josh Wilson
* Haoyin Xu +
* Rory Yorke
* Egor Zemlyanoy
* Gang Zhao +
* 赵丰 (Zhao Feng) +
A total of 132 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.7.3
```
for MacOS arm64 with Python `3.8`, `3.9`, and `3.10`. The MacOS arm64 wheels
are only available for MacOS version `12.0` and greater, as explained
in [Issue 14688](https://github.com/scipy/scipy/issues/14688).
Authors
=======
* Anirudh Dagar
* Ralf Gommers
* Tyler Reddy
* Pamphile Roy
* Olivier Grisel
* Isuru Fernando
A total of 6 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.7.2
```
compared to `1.7.1`. Notably, the release includes wheels
for Python `3.10`, and wheels are now built with a newer
version of OpenBLAS, `0.3.17`. Python `3.10` wheels are provided
for MacOS x86_64 (thin, not universal2 or arm64 at this time),
and Windows/Linux 64-bit. Many wheels are now built with newer
versions of manylinux, which may require newer versions of pip.
Authors
=======
* Peter Bell
* da-woods +
* Isuru Fernando
* Ralf Gommers
* Matt Haberland
* Nicholas McKibben
* Ilhan Polat
* Judah Rand +
* Tyler Reddy
* Pamphile Roy
* Charles Harris
* Matti Picus
* Hugo van Kemenade
* Jacob Vanderplas
A total of 14 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.7.1
```
compared to `1.7.0`.
Authors
=======
* Peter Bell
* Evgeni Burovski
* Justin Charlong +
* Ralf Gommers
* Matti Picus
* Tyler Reddy
* Pamphile Roy
* Sebastian Wallkötter
* Arthur Volant
A total of 9 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.7.0
```
many new features, numerous bug-fixes, improved test coverage and better
documentation. There have been a number of deprecations and 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 ``DeprecationWarning`` s).
Our development attention will now shift to bug-fix releases on the
1.7.x branch, and on adding new features on the master branch.
This release requires Python `3.7+` and NumPy `1.16.5` or greater.
For running on PyPy, PyPy3 `6.0+` is required.
Highlights of this release
- A new submodule for quasi-Monte Carlo, `scipy.stats.qmc`, was added
- The documentation design was updated to use the same PyData-Sphinx theme as
other NumFOCUS packages like NumPy.
- We now vendor and leverage the Boost C++ library to enable numerous
improvements for long-standing weaknesses in `scipy.stats`
- `scipy.stats` has six new distributions, eight new (or overhauled)
hypothesis tests, a new function for bootstrapping, a class that enables
fast random variate sampling and percentile point function evaluation,
and many other enhancements.
- ``cdist`` and ``pdist`` distance calculations are faster for several metrics,
especially weighted cases, thanks to a rewrite to a new C++ backend framework
- A new class for radial basis function interpolation, `RBFInterpolator`, was
added to address issues with the `Rbf` class.
*We gratefully acknowledge the Chan-Zuckerberg Initiative Essential Open Source
Software for Science program for supporting many of the improvements to*
`scipy.stats`.
New features
`scipy.cluster` improvements
An optional argument, ``seed``, has been added to ``kmeans`` and ``kmeans2`` to
set the random generator and random state.
`scipy.interpolate` improvements
Improved input validation and error messages for ``fitpack.bispev`` and
``fitpack.parder`` for scenarios that previously caused substantial confusion
for users.
The class `RBFInterpolator` was added to supersede the `Rbf` class. The new
class has usage that more closely follows other interpolator classes, corrects
sign errors that caused unexpected smoothing behavior, includes polynomial
terms in the interpolant (which are necessary for some RBF choices), and
supports interpolation using only the k-nearest neighbors for memory
efficiency.
`scipy.linalg` improvements
An LAPACK wrapper was added for access to the ``tgexc`` subroutine.
`scipy.ndimage` improvements
`scipy.ndimage.affine_transform` is now able to infer the ``output_shape`` from
the ``out`` array.
`scipy.optimize` improvements
The optional parameter ``bounds`` was added to
``_minimize_neldermead`` to support bounds constraints
for the Nelder-Mead solver.
``trustregion`` methods ``trust-krylov``, ``dogleg`` and ``trust-ncg`` can now
estimate ``hess`` by finite difference using one of
``["2-point", "3-point", "cs"]``.
``halton`` was added as a ``sampling_method`` in `scipy.optimize.shgo`.
``sobol`` was fixed and is now using `scipy.stats.qmc.Sobol`.
``halton`` and ``sobol`` were added as ``init`` methods in
`scipy.optimize.differential_evolution.`
``differential_evolution`` now accepts an ``x0`` parameter to provide an
initial guess for the minimization.
``least_squares`` has a modest performance improvement when SciPy is built
with Pythran transpiler enabled.
When ``linprog`` is used with ``method`` ``'highs'``, ``'highs-ipm'``, or
``'highs-ds'``, the result object now reports the marginals (AKA shadow
prices, dual values) and residuals associated with each constraint.
`scipy.signal` improvements
``get_window`` supports ``general_cosine`` and ``general_hamming`` window
functions.
`scipy.signal.medfilt2d` now releases the GIL where appropriate to enable
performance gains via multithreaded calculations.
`scipy.sparse` improvements
Addition of ``dia_matrix`` sparse matrices is now faster.
`scipy.spatial` improvements
``distance.cdist`` and ``distance.pdist`` performance has greatly improved for
certain weighted metrics. Namely: ``minkowski``, ``euclidean``, ``chebyshev``,
``canberra``, and ``cityblock``.
Modest performance improvements for many of the unweighted ``cdist`` and
``pdist`` metrics noted above.
The parameter ``seed`` was added to `scipy.spatial.vq.kmeans` and
`scipy.spatial.vq.kmeans2`.
The parameters ``axis`` and ``keepdims`` where added to
`scipy.spatial.distance.jensenshannon`.
The ``rotation`` methods ``from_rotvec`` and ``as_rotvec`` now accept a
``degrees`` argument to specify usage of degrees instead of radians.
`scipy.special` improvements
Wright's generalized Bessel function for positive arguments was added as
`scipy.special.wright_bessel.`
An implementation of the inverse of the Log CDF of the Normal Distribution is
now available via `scipy.special.ndtri_exp`.
`scipy.stats` improvements
Hypothesis Tests
The Mann-Whitney-Wilcoxon test, ``mannwhitneyu``, has been rewritten. It now
supports n-dimensional input, an exact test method when there are no ties,
and improved documentation. Please see "Other changes" for adjustments to
default behavior.
The new function `scipy.stats.binomtest` replaces `scipy.stats.binom_test`. The
new function returns an object that calculates a confidence intervals of the
proportion parameter. Also, performance was improved from O(n) to O(log(n)) by
using binary search.
The two-sample version of the Cramer-von Mises test is implemented in
`scipy.stats.cramervonmises_2samp`.
The Alexander-Govern test is implemented in the new function
`scipy.stats.alexandergovern`.
The new functions `scipy.stats.barnard_exact` and `scipy.stats. boschloo_exact`
respectively perform Barnard's exact test and Boschloo's exact test
for 2x2 contingency tables.
The new function `scipy.stats.page_trend_test` performs Page's test for ordered
alternatives.
The new function `scipy.stats.somersd` performs Somers' D test for ordinal
association between two variables.
An option, ``permutations``, has been added in `scipy.stats.ttest_ind` to
perform permutation t-tests. A ``trim`` option was also added to perform
a trimmed (Yuen's) t-test.
The ``alternative`` parameter was added to the ``skewtest``, ``kurtosistest``,
``ranksums``, ``mood``, ``ansari``, ``linregress``, and ``spearmanr`` functions
to allow one-sided hypothesis testing.
Sample statistics
The new function `scipy.stats.differential_entropy` estimates the differential
entropy of a continuous distribution from a sample.
The ``boxcox`` and ``boxcox_normmax`` now allow the user to control the
optimizer used to minimize the negative log-likelihood function.
A new function `scipy.stats.contingency.relative_risk` calculates the
relative risk, or risk ratio, of a 2x2 contingency table. The object
returned has a method to compute the confidence interval of the relative risk.
Performance improvements in the ``skew`` and ``kurtosis`` functions achieved
by removal of repeated/redundant calculations.
Substantial performance improvements in `scipy.stats.mstats.hdquantiles_sd`.
The new function `scipy.stats.contingency.association` computes several
measures of association for a contingency table: Pearsons contingency
coefficient, Cramer's V, and Tschuprow's T.
The parameter ``nan_policy`` was added to `scipy.stats.zmap` to provide options
for handling the occurrence of ``nan`` in the input data.
The parameter ``ddof`` was added to `scipy.stats.variation` and
`scipy.stats.mstats.variation`.
The parameter ``weights`` was added to `scipy.stats.gmean`.
Statistical Distributions
We now vendor and leverage the Boost C++ library to address a number of
previously reported issues in ``stats``. Notably, ``beta``, ``binom``,
``nbinom`` now have Boost backends, and it is straightforward to leverage
the backend for additional functions.
The skew Cauchy probability distribution has been implemented as
`scipy.stats.skewcauchy`.
The Zipfian probability distribution has been implemented as
`scipy.stats.zipfian`.
The new distributions ``nchypergeom_fisher`` and ``nchypergeom_wallenius``
implement the Fisher and Wallenius versions of the noncentral hypergeometric
distribution, respectively.
The generalized hyperbolic distribution was added in
`scipy.stats.genhyperbolic`.
The studentized range distribution was added in `scipy.stats.studentized_range`.
`scipy.stats.argus` now has improved handling for small parameter values.
Better argument handling/preparation has resulted in performance improvements
for many distributions.
The ``cosine`` distribution has added ufuncs for ``ppf``, ``cdf``, ``sf``, and
``isf`` methods including numerical precision improvements at the edges of the
support of the distribution.
An option to fit the distribution to data by the method of moments has been
added to the ``fit`` method of the univariate continuous distributions.
Other
`scipy.stats.bootstrap` has been added to allow estimation of the confidence
interval and standard error of a statistic.
The new function `scipy.stats.contingency.crosstab` computes a contingency
table (i.e. a table of counts of unique entries) for the given data.
`scipy.stats.NumericalInverseHermite` enables fast random variate sampling
and percentile point function evaluation of an arbitrary univariate statistical
distribution.
New `scipy.stats.qmc` module
This new module provides Quasi-Monte Carlo (QMC) generators and associated
helper functions.
It provides a generic class `scipy.stats.qmc.QMCEngine` which defines a QMC
engine/sampler. An engine is state aware: it can be continued, advanced and
reset. 3 base samplers are available:
- `scipy.stats.qmc.Sobol` the well known Sobol low discrepancy sequence.
Several warnings have been added to guide the user into properly using this
sampler. The sequence is scrambled by default.
- `scipy.stats.qmc.Halton`: Halton low discrepancy sequence. The sequence is
scrambled by default.
- `scipy.stats.qmc.LatinHypercube`: plain LHS design.
And 2 special samplers are available:
- `scipy.stats.qmc.MultinomialQMC`: sampling from a multinomial distribution
using any of the base `scipy.stats.qmc.QMCEngine`.
- `scipy.stats.qmc.MultivariateNormalQMC`: sampling from a multivariate Normal
using any of the base `scipy.stats.qmc.QMCEngine`.
The module also provide the following helpers:
- `scipy.stats.qmc.discrepancy`: assess the quality of a set of points in terms
of space coverage.
- `scipy.stats.qmc.update_discrepancy`: can be used in an optimization loop to
construct a good set of points.
- `scipy.stats.qmc.scale`: easily scale a set of points from (to) the unit
interval to (from) a given range.
Deprecated features
`scipy.linalg` deprecations
- `scipy.linalg.pinv2` is deprecated and its functionality is completely
subsumed into `scipy.linalg.pinv`
- Both ``rcond``, ``cond`` keywords of `scipy.linalg.pinv` and
`scipy.linalg.pinvh` were not working and now are deprecated. They are now
replaced with functioning ``atol`` and ``rtol`` keywords with clear usage.
`scipy.spatial` deprecations
- `scipy.spatial.distance` metrics expect 1d input vectors but will call
``np.squeeze`` on their inputs to accept any extra length-1 dimensions. That
behaviour is now deprecated.
Backwards incompatible changes
Other changes
We now accept and leverage performance improvements from the ahead-of-time
Python-to-C++ transpiler, Pythran, which can be optionally disabled (via
``export SCIPY_USE_PYTHRAN=0``) but is enabled by default at build time.
There are two changes to the default behavior of `scipy.stats.mannwhitenyu`:
- For years, use of the default ``alternative=None`` was deprecated; explicit
``alternative`` specification was required. Use of the new default value of
``alternative``, "two-sided", is now permitted.
- Previously, all p-values were based on an asymptotic approximation. Now, for
small samples without ties, the p-values returned are exact by default.
Support has been added for PEP 621 (project metadata in ``pyproject.toml``)
We now support a Gitpod environment to reduce the barrier to entry for SciPy
development; for more details see `quickstart-gitpod`.
Authors
* endolith
* Jelle Aalbers +
* Adam +
* Tania Allard +
* Sven Baars +
* Max Balandat +
* baumgarc +
* Christoph Baumgarten
* Peter Bell
* Lilian Besson
* Robinson Besson +
* Max Bolingbroke
* Blair Bonnett +
* Jordão Bragantini
* Harm Buisman +
* Evgeni Burovski
* Matthias Bussonnier
* Dominic C
* CJ Carey
* Ramón Casero +
* Chachay +
* charlotte12l +
* Benjamin Curtice Corbett +
* Falcon Dai +
* Ian Dall +
* Terry Davis
* droussea2001 +
* DWesl +
* dwight200 +
* Thomas J. Fan +
* Joseph Fox-Rabinovitz
* Max Frei +
* Laura Gutierrez Funderburk +
* gbonomib +
* Matthias Geier +
* Pradipta Ghosh +
* Ralf Gommers
* Evan H +
* h-vetinari
* Matt Haberland
* Anselm Hahn +
* Alex Henrie
* Piet Hessenius +
* Trever Hines +
* Elisha Hollander +
* Stephan Hoyer
* Tom Hu +
* Kei Ishikawa +
* Julien Jerphanion
* Robert Kern
* Shashank KS +
* Peter Mahler Larsen
* Eric Larson
* Cheng H. Lee +
* Gregory R. Lee
* Jean-Benoist Leger +
* lgfunderburk +
* liam-o-marsh +
* Xingyu Liu +
* Alex Loftus +
* Christian Lorentzen +
* Cong Ma
* Marc +
* MarkPundurs +
* Markus Löning +
* Liam Marsh +
* Nicholas McKibben
* melissawm +
* Jamie Morton
* Andrew Nelson
* Nikola Forró
* Tor Nordam +
* Olivier Gauthé +
* Rohit Pandey +
* Avanindra Kumar Pandeya +
* Tirth Patel
* paugier +
* Alex H. Wagner, PhD +
* Jeff Plourde +
* Ilhan Polat
* pranavrajpal +
* Vladyslav Rachek
* Bharat Raghunathan
* Recursing +
* Tyler Reddy
* Lucas Roberts
* Gregor Robinson +
* Pamphile Roy +
* Atsushi Sakai
* Benjamin Santos
* Martin K. Scherer +
* Thomas Schmelzer +
* Daniel Scott +
* Sebastian Wallkötter +
* serge-sans-paille +
* Namami Shanker +
* Masashi Shibata +
* Alexandre de Siqueira +
* Albert Steppi +
* Adam J. Stewart +
* Kai Striega
* Diana Sukhoverkhova
* Søren Fuglede Jørgensen
* Mike Taves
* Dan Temkin +
* Nicolas Tessore +
* tsubota20 +
* Robert Uhl
* christos val +
* Bas van Beek +
* Ashutosh Varma +
* Jose Vazquez +
* Sebastiano Vigna
* Aditya Vijaykumar
* VNMabus
* Arthur Volant +
* Samuel Wallan
* Stefan van der Walt
* Warren Weckesser
* Anreas Weh
* Josh Wilson
* Rory Yorke
* Egor Zemlyanoy
* Marc Zoeller +
* zoj613 +
* 秋纫 +
A total of 126 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.6.3
```
compared to `1.6.2`.
Authors
======
* Peter Bell
* Ralf Gommers
* Matt Haberland
* Peter Mahler Larsen
* Tirth Patel
* Tyler Reddy
* Pamphile ROY +
* Xingyu Liu +
A total of 8 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.6.2
```
compared to `1.6.1`. This is also the first SciPy release
to place upper bounds on some dependencies to improve
the long-term repeatability of source builds.
Authors
=======
* Pradipta Ghosh +
* Tyler Reddy
* Ralf Gommers
* Martin K. Scherer +
* Robert Uhl
* Warren Weckesser
A total of 6 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.6.1
```
compared to `1.6.0`.
Please note that for SciPy wheels to correctly install with pip on
macOS 11, pip `>= 20.3.3` is needed.
Authors
=======
* Peter Bell
* Evgeni Burovski
* CJ Carey
* Ralf Gommers
* Peter Mahler Larsen
* Cheng H. Lee +
* Cong Ma
* Nicholas McKibben
* Nikola Forró
* Tyler Reddy
* Warren Weckesser
A total of 11 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.6.0
```
many new features, numerous bug-fixes, improved test coverage and better
documentation. There have been a number of deprecations and 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 ``DeprecationWarning`` s).
Our development attention will now shift to bug-fix releases on the
1.6.x branch, and on adding new features on the master branch.
This release requires Python `3.7`+ and NumPy `1.16.5` or greater.
For running on PyPy, PyPy3 `6.0`+ is required.
Highlights of this release
----------------------------
- `scipy.ndimage` improvements: Fixes and ehancements to boundary extension
modes for interpolation functions. Support for complex-valued inputs in many
filtering and interpolation functions. New ``grid_mode`` option for
`scipy.ndimage.zoom` to enable results consistent with scikit-image's
``rescale``.
- `scipy.optimize.linprog` has fast, new methods for large, sparse problems
from the ``HiGHS`` library.
- `scipy.stats` improvements including new distributions, a new test, and
enhancements to existing distributions and tests
New features
============
`scipy.special` improvements
-----------------------------
`scipy.special` now has improved support for 64-bit ``LAPACK`` backend
`scipy.odr` improvements
-------------------------
`scipy.odr` now has support for 64-bit integer ``BLAS``
`scipy.odr.ODR` has gained an optional ``overwrite`` argument so that existing
files may be overwritten.
`scipy.integrate` improvements
-------------------------------
Some renames of functions with poor names were done, with the old names
retained without being in the reference guide for backwards compatibility
reasons:
- ``integrate.simps`` was renamed to ``integrate.simpson``
- ``integrate.trapz`` was renamed to ``integrate.trapezoid``
- ``integrate.cumtrapz`` was renamed to ``integrate.cumulative_trapezoid``
`scipy.cluster` improvements
-------------------------------
`scipy.cluster.hierarchy.DisjointSet` has been added for incremental
connectivity queries.
`scipy.cluster.hierarchy.dendrogram` return value now also includes leaf color
information in `leaves_color_list`.
`scipy.interpolate` improvements
---------------------------------
`scipy.interpolate.interp1d` has a new method ``nearest-up``, similar to the
existing method ``nearest`` but rounds half-integers up instead of down.
`scipy.io` improvements
------------------------
Support has been added for reading arbitrary bit depth integer PCM WAV files
from 1- to 32-bit, including the commonly-requested 24-bit depth.
`scipy.linalg` improvements
----------------------------
The new function `scipy.linalg.matmul_toeplitz` uses the FFT to compute the
product of a Toeplitz matrix with another matrix.
`scipy.linalg.sqrtm` and `scipy.linalg.logm` have performance improvements
thanks to additional Cython code.
Python ``LAPACK`` wrappers have been added for ``pptrf``, ``pptrs``, ``ppsv``,
``pptri``, and ``ppcon``.
`scipy.linalg.norm` and the ``svd`` family of functions will now use 64-bit
integer backends when available.
`scipy.ndimage` improvements
-----------------------------
`scipy.ndimage.convolve`, `scipy.ndimage.correlate` and their 1d counterparts
now accept both complex-valued images and/or complex-valued filter kernels. All
convolution-based filters also now accept complex-valued inputs
(e.g. ``gaussian_filter``, ``uniform_filter``, etc.).
Multiple fixes and enhancements to boundary handling were introduced to
`scipy.ndimage` interpolation functions (i.e. ``affine_transform``,
``geometric_transform``, ``map_coordinates``, ``rotate``, ``shift``, ``zoom``).
A new boundary mode, ``grid-wrap`` was added which wraps images periodically,
using a period equal to the shape of the input image grid. This is in contrast
to the existing ``wrap`` mode which uses a period that is one sample smaller
than the original signal extent along each dimension.
A long-standing bug in the ``reflect`` boundary condition has been fixed and
the mode ``grid-mirror`` was introduced as a synonym for ``reflect``.
A new boundary mode, ``grid-constant`` is now available. This is similar to
the existing ndimage ``constant`` mode, but interpolation will still performed
at coordinate values outside of the original image extent. This
``grid-constant`` mode is consistent with OpenCV's ``BORDER_CONSTANT`` mode
and scikit-image's ``constant`` mode.
Spline pre-filtering (used internally by ``ndimage`` interpolation functions
when ``order >= 2``), now supports all boundary modes rather than always
defaulting to mirror boundary conditions. The standalone functions
``spline_filter`` and ``spline_filter1d`` have analytical boundary conditions
that match modes ``mirror``, ``grid-wrap`` and ``reflect``.
`scipy.ndimage` interpolation functions now accept complex-valued inputs. In
this case, the interpolation is applied independently to the real and
imaginary components.
The ``ndimage`` tutorials
(https://docs.scipy.org/doc/scipy/reference/tutorial/ndimage.html) have been
updated with new figures to better clarify the exact behavior of all of the
interpolation boundary modes.
`scipy.ndimage.zoom` now has a ``grid_mode`` option that changes the coordinate
of the center of the first pixel along an axis from 0 to 0.5. This allows
resizing in a manner that is consistent with the behavior of scikit-image's
``resize`` and ``rescale`` functions (and OpenCV's ``cv2.resize``).
`scipy.optimize` improvements
------------------------------
`scipy.optimize.linprog` has fast, new methods for large, sparse problems from
the ``HiGHS`` C++ library. ``method='highs-ds'`` uses a high performance dual
revised simplex implementation (HSOL), ``method='highs-ipm'`` uses an
interior-point method with crossover, and ``method='highs'`` chooses between
the two automatically. These methods are typically much faster and often exceed
the accuracy of other ``linprog`` methods, so we recommend explicitly
specifying one of these three method values when using ``linprog``.
`scipy.optimize.quadratic_assignment` has been added for approximate solution
of the quadratic assignment problem.
`scipy.optimize.linear_sum_assignment` now has a substantially reduced overhead
for small cost matrix sizes
`scipy.optimize.least_squares` has improved performance when the user provides
the jacobian as a sparse jacobian already in ``csr_matrix`` format
`scipy.optimize.linprog` now has an ``rr_method`` argument for specification
of the method used for redundancy handling, and a new method for this purpose
is available based on the interpolative decomposition approach.
`scipy.signal` improvements
----------------------------
`scipy.signal.gammatone` has been added to design FIR or IIR filters that
model the human auditory system.
`scipy.signal.iircomb` has been added to design IIR peaking/notching comb
filters that can boost/attenuate a frequency from a signal.
`scipy.signal.sosfilt` performance has been improved to avoid some previously-
observed slowdowns
`scipy.signal.windows.taylor` has been added--the Taylor window function is
commonly used in radar digital signal processing
`scipy.signal.gauss_spline` now supports ``list`` type input for consistency
with other related SciPy functions
`scipy.signal.correlation_lags` has been added to allow calculation of the lag/
displacement indices array for 1D cross-correlation.
`scipy.sparse` improvements
----------------------------
A solver for the minimum weight full matching problem for bipartite graphs,
also known as the linear assignment problem, has been added in
`scipy.sparse.csgraph.min_weight_full_bipartite_matching`. In particular, this
provides functionality analogous to that of
`scipy.optimize.linear_sum_assignment`, but with improved performance for sparse
inputs, and the ability to handle inputs whose dense representations would not
fit in memory.
The time complexity of `scipy.sparse.block_diag` has been improved dramatically
from quadratic to linear.
`scipy.sparse.linalg` improvements
-----------------------------------
The vendored version of ``SuperLU`` has been updated
`scipy.fft` improvements
-------------------------
The vendored ``pocketfft`` library now supports compiling with ARM neon vector
extensions and has improved thread pool behavior.
`scipy.spatial` improvements
-----------------------------
The python implementation of ``KDTree`` has been dropped and ``KDTree`` is now
implemented in terms of ``cKDTree``. You can now expect ``cKDTree``-like
performance by default. This also means ``sys.setrecursionlimit`` no longer
needs to be increased for querying large trees.
``transform.Rotation`` has been updated with support for Modified Rodrigues
Parameters alongside the existing rotation representations (PR gh-12667).
`scipy.spatial.transform.Rotation` has been partially cythonized, with some
performance improvements observed
`scipy.spatial.distance.cdist` has improved performance with the ``minkowski``
metric, especially for p-norm values of 1 or 2.
`scipy.stats` improvements
---------------------------
New distributions have been added to `scipy.stats`:
- The asymmetric Laplace continuous distribution has been added as
`scipy.stats.laplace_asymmetric`.
- The negative hypergeometric distribution has been added as `scipy.stats.nhypergeom`.
- The multivariate t distribution has been added as `scipy.stats.multivariate_t`.
- The multivariate hypergeometric distribution has been added as `scipy.stats.multivariate_hypergeom`.
The ``fit`` method has been overridden for several distributions (``laplace``,
``pareto``, ``rayleigh``, ``invgauss``, ``logistic``, ``gumbel_l``,
``gumbel_r``); they now use analytical, distribution-specific maximum
likelihood estimation results for greater speed and accuracy than the generic
(numerical optimization) implementation.
The one-sample Cramér-von Mises test has been added as
`scipy.stats.cramervonmises`.
An option to compute one-sided p-values was added to `scipy.stats.ttest_1samp`,
`scipy.stats.ttest_ind_from_stats`, `scipy.stats.ttest_ind` and
`scipy.stats.ttest_rel`.
The function `scipy.stats.kendalltau` now has an option to compute Kendall's
tau-c (also known as Stuart's tau-c), and support has been added for exact
p-value calculations for sample sizes ``> 171``.
`stats.trapz` was renamed to `stats.trapezoid`, with the former name retained
as an alias for backwards compatibility reasons.
The function `scipy.stats.linregress` now includes the standard error of the
intercept in its return value.
The ``_logpdf``, ``_sf``, and ``_isf`` methods have been added to
`scipy.stats.nakagami`; ``_sf`` and ``_isf`` methods also added to
`scipy.stats.gumbel_r`
The ``sf`` method has been added to `scipy.stats.levy` and `scipy.stats.levy_l`
for improved precision.
`scipy.stats.binned_statistic_dd` performance improvements for the following
computed statistics: ``max``, ``min``, ``median``, and ``std``.
We gratefully acknowledge the Chan-Zuckerberg Initiative Essential Open Source
Software for Science program for supporting many of these improvements to
`scipy.stats`.
Deprecated features
===================
`scipy.spatial` changes
------------------------
Calling ``KDTree.query`` with ``k=None`` to find all neighbours is deprecated.
Use ``KDTree.query_ball_point`` instead.
``distance.wminkowski`` was deprecated; use ``distance.minkowski`` and supply
weights with the ``w`` keyword instead.
Backwards incompatible changes
==============================
`scipy` changes
----------------
Using `scipy.fft` as a function aliasing ``numpy.fft.fft`` was removed after
being deprecated in SciPy ``1.4.0``. As a result, the `scipy.fft` submodule
must be explicitly imported now, in line with other SciPy subpackages.
`scipy.signal` changes
-----------------------
The output of ``decimate``, ``lfilter_zi``, ``lfiltic``, ``sos2tf``, and
``sosfilt_zi`` have been changed to match ``numpy.result_type`` of their inputs.
The window function ``slepian`` was removed. It had been deprecated since SciPy
``1.1``.
`scipy.spatial` changes
------------------------
``cKDTree.query`` now returns 64-bit rather than 32-bit integers on Windows,
making behaviour consistent between platforms (PR gh-12673).
`scipy.stats` changes
----------------------
The ``frechet_l`` and ``frechet_r`` distributions were removed. They were
deprecated since SciPy ``1.0``.
Other changes
=============
``setup_requires`` was removed from ``setup.py``. This means that users
invoking ``python setup.py install`` without having numpy already installed
will now get an error, rather than having numpy installed for them via
``easy_install``. This install method was always fragile and problematic, users
are encouraged to use ``pip`` when installing from source.
- Fixed a bug in `scipy.optimize.dual_annealing` ``accept_reject`` calculation
that caused uphill jumps to be accepted less frequently.
- The time required for (un)pickling of `scipy.stats.rv_continuous`,
`scipy.stats.rv_discrete`, and `scipy.stats.rv_frozen` has been significantly
reduced (gh12550). Inheriting subclasses should note that ``__setstate__`` no
longer calls ``__init__`` upon unpickling.
Authors
=======
* endolith
* vkk800
* aditya +
* George Bateman +
* Christoph Baumgarten
* Peter Bell
* Tobias Biester +
* Keaton J. Burns +
* Evgeni Burovski
* Rüdiger Busche +
* Matthias Bussonnier
* Dominic C +
* Corallus Caninus +
* CJ Carey
* Thomas A Caswell
* chapochn +
* Lucía Cheung
* Zach Colbert +
* Coloquinte +
* Yannick Copin +
* Devin Crowley +
* Terry Davis +
* Michaël Defferrard +
* devonwp +
* Didier +
* divenex +
* Thomas Duvernay +
* Eoghan O'Connell +
* Gökçen Eraslan
* Kristian Eschenburg +
* Ralf Gommers
* Thomas Grainger +
* GreatV +
* Gregory Gundersen +
* h-vetinari +
* Matt Haberland
* Mark Harfouche +
* He He +
* Alex Henrie
* Chun-Ming Huang +
* Martin James McHugh III +
* Alex Izvorski +
* Joey +
* ST John +
* Jonas Jonker +
* Julius Bier Kirkegaard
* Marcin Konowalczyk +
* Konrad0
* Sam Van Kooten +
* Sergey Koposov +
* Peter Mahler Larsen
* Eric Larson
* Antony Lee
* Gregory R. Lee
* Loïc Estève
* Jean-Luc Margot +
* MarkusKoebis +
* Nikolay Mayorov
* G. D. McBain
* Andrew McCluskey +
* Nicholas McKibben
* Sturla Molden
* Denali Molitor +
* Eric Moore
* Shashaank N +
* Prashanth Nadukandi +
* nbelakovski +
* Andrew Nelson
* Nick +
* Nikola Forró +
* odidev
* ofirr +
* Sambit Panda
* Dima Pasechnik
* Tirth Patel +
* Paweł Redzyński +
* Vladimir Philipenko +
* Philipp Thölke +
* Ilhan Polat
* Eugene Prilepin +
* Vladyslav Rachek
* Ram Rachum +
* Tyler Reddy
* Martin Reinecke +
* Simon Segerblom Rex +
* Lucas Roberts
* Benjamin Rowell +
* Eli Rykoff +
* Atsushi Sakai
* Moritz Schulte +
* Daniel B. Smith
* Steve Smith +
* Jan Soedingrekso +
* Victor Stinner +
* Jose Storopoli +
* Diana Sukhoverkhova +
* Søren Fuglede Jørgensen
* taoky +
* Mike Taves +
* Ian Thomas +
* Will Tirone +
* Frank Torres +
* Seth Troisi
* Ronald van Elburg +
* Hugo van Kemenade
* Paul van Mulbregt
* Saul Ivan Rivas Vega +
* Pauli Virtanen
* Jan Vleeshouwers
* Samuel Wallan
* Warren Weckesser
* Ben West +
* Eric Wieser
* WillTirone +
* Levi John Wolf +
* Zhiqing Xiao
* Rory Yorke +
* Yun Wang (Maigo) +
* Egor Zemlyanoy +
* ZhihuiChen0903 +
* Jacob Zhong +
A total of 121 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.5.4
```
compared to `1.5.3`. Importantly, wheels are now available
for Python `3.9` and a more complete fix has been applied for
issues building with XCode `12`.
Authors
=====
* Peter Bell
* CJ Carey
* Andrew McCluskey +
* Andrew Nelson
* Tyler Reddy
* Eli Rykoff +
* Ian Thomas +
A total of 7 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.5.3
```
compared to `1.5.2`. In particular, Linux ARM64 wheels are now
available and a compatibility issue with XCode 12 has
been fixed.
Authors
=======
* Peter Bell
* CJ Carey
* Thomas Duvernay +
* Gregory Lee
* Eric Moore
* odidev
* Dima Pasechnik
* Tyler Reddy
* Simon Segerblom Rex +
* Daniel B. Smith
* Will Tirone +
* Warren Weckesser
A total of 12 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.5.2
```
compared to `1.5.1`.
Authors
=====
* Peter Bell
* Tobias Biester +
* Evgeni Burovski
* Thomas A Caswell
* Ralf Gommers
* Sturla Molden
* Andrew Nelson
* ofirr +
* Sambit Panda
* Ilhan Polat
* Tyler Reddy
* Atsushi Sakai
* Pauli Virtanen
A total of 13 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.5.1
```
compared to `1.5.0`. In particular, an issue where DLL loading
can fail for SciPy wheels on Windows with Python `3.6` has been
fixed.
Authors
=======
* Peter Bell
* Loïc Estève
* Philipp Thölke +
* Tyler Reddy
* Paul van Mulbregt
* Pauli Virtanen
* Warren Weckesser
A total of 7 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
```
### 1.5.0
```
many new features, numerous bug-fixes, improved test coverage and better
documentation. There have been a number of deprecations and 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 ``DeprecationWarning`` s).
Our development attention will now shift to bug-fix releases on the
1.5.x branch, and on adding new features on the master branch.
This release requires Python `3.6+` and NumPy `1.14.5` or greater.
For running on PyPy, PyPy3 `6.0+` and NumPy `1.15.0` are required.
Highlights of this release
----------------------------
- wrappers for more than a dozen new ``LAPACK`` routines are now available
in `scipy.linalg.lapack`
- Improved support for leveraging 64-bit integer size from linear algebra
backends
- addition of the probability distribution for two-sided one-sample
Kolmogorov-Smirnov tests
New features
=========
`scipy.cluster` improvements
--------------------------------
Initialization of `scipy.cluster.vq.kmeans2` using ``minit="++"`` had a
quadratic complexity in the number of samples. It has been improved, resulting
in a much faster initialization with quasi-linear complexity.
`scipy.cluster.hierarchy.dendrogram` now respects the ``matplotlib`` color
palette
`scipy.fft` improvements
------------------------------
A new keyword-only argument ``plan`` is added to all FFT functions in this
module. It is reserved for passing in a precomputed plan from libraries
providing a FFT backend (such as ``PyFFTW`` and ``mkl-fft``), and it is
currently not used in SciPy.
`scipy.integrate` improvements
----------------------------------
`scipy.interpolate` improvements
-------------------------------------
`scipy.io` improvements
---------------------------
`scipy.io.wavfile` error messages are more explicit about what's wrong, and
extraneous bytes at the ends of files are ignored instead of raising an error
when the data has successfully been read.
`scipy.io.loadmat` gained a ``simplify_cells`` parameter, which if set to
``True`` simplifies the structure of the return value if the ``.mat`` file
contains cell arrays.
``pathlib.Path`` objects are now supported in `scipy.io` Matrix Market I/O
functions
`scipy.linalg` improvements
-------------------------------
`scipy.linalg.eigh` has been improved. Now various ``LAPACK`` drivers can be
selected at will and also subsets of eigenvalues can be requested via
``subset_by_value`` keyword. Another keyword ``subset_by_index`` is introduced.
Keywords ``turbo`` and ``eigvals`` are deprecated.
Similarly, standard and generalized Hermitian eigenvalue ``LAPACK`` routines
``?<sy/he>evx`` are added and existing ones now have full ``_lwork``
counterparts.
Wrappers for the following ``LAPACK`` routines have been added to
`scipy.linalg.lapack`:
- ``?getc2``: computes the LU factorization of a general matrix with complete
pivoting
- ``?gesc2``: solves a linear system given an LU factorization from ``?getc2``
- ``?gejsv``: computes the singular value decomposition of a general matrix
with higher accuracy calculation of tiny singular values and their
corresponding singular vectors
- ``?geqrfp``: computes the QR factorization of a general matrix with
non-negative elements on the diagonal of R
- ``?gtsvx``: solves a linear system with general tridiagonal matrix
- ``?gttrf``: computes the LU factorization of a tridiagonal matrix
- ``?gttrs``: solves a linear system given an LU factorization from ``?gttrf``
- ``?ptsvx``: solves a linear system with symmetric positive definite
tridiagonal matrix
- ``?pttrf``: computes the LU factorization of a symmetric positive definite
tridiagonal matrix
- ``?pttrs``: solves a linear system given an LU factorization from ``?pttrf``
- ``?pteqr``: computes the eigenvectors and eigenvalues of a positive definite
tridiagonal matrix
- ``?tbtrs``: solves a linear system with a triangular banded matrix
- ``?csd``: computes the Cosine Sine decomposition of an orthogonal/unitary
matrix
Generalized QR factorization routines (``?geqrf``) now have full ``_lwork``
counterparts.
`scipy.linalg.cossin` Cosine Sine decomposition of unitary matrices has been
added.
The function `scipy.linalg.khatri_rao`, which computes the Khatri-Rao product,
was added.
The new function `scipy.linalg.convolution_matrix` constructs the Toeplitz
matrix representing one-dimensional convolution.
`scipy.ndimage` improvements
----------------------------------
`scipy.optimize` improvements
----------------------------------
The finite difference numerical differentiation used in various ``minimize``
methods that use gradients has several new features:
- 2-point, 3-point, or complex step finite differences can be used. Previously
only a 2-step finite difference was available.
- There is now the possibility to use a relative step size, previously only an
absolute step size was available.
- If the ``minimize`` method uses bounds the numerical differentiation strictly
obeys those limits.
- The numerical differentiation machinery now makes use of a simple cache,
which in some cases can reduce the number of function evaluations.
- ``minimize``'s ``method= 'powell'`` now supports simple bound constraints
There have been several improvements to `scipy.optimize.linprog`:
- The ``linprog`` benchmark suite has been expanded considerably.
- ``linprog``'s dense pivot-based redundancy removal routine and sparse
presolve are faster
- When ``scikit-sparse`` is available, solving sparse problems with
``method='interior-point'`` is faster
The caching of values when optimizing a function returning both value and
gradient together has been improved, avoiding repeated function evaluations
when using a ``HessianApproximation`` such as ``BFGS``.
``differential_evolution`` can now use the modern ``np.random.Generator`` as
well as the legacy ``np.random.RandomState`` as a seed.
`scipy.signal` improvements
-------------------------------
A new optional argument ``include_nyquist`` is added to ``freqz`` functions in
this module. It is used for including the last frequency (Nyquist frequency).
`scipy.signal.find_peaks_cwt` now accepts a ``window_size`` parameter for the
size of the window used to calculate the noise floor.
`scipy.sparse` improvements
--------------------------------
Outer indexing is now faster when using a 2d column vector to select column
indices.
`scipy.sparse.lil.tocsr` is faster
Fixed/improved comparisons between pydata sparse arrays and sparse matrices
BSR format sparse multiplication performance has been improved.
`scipy.sparse.linalg.LinearOperator` has gained the new ``ndim`` class
attribute
`scipy.spatial` improvements
--------------------------------
`scipy.spatial.geometric_slerp` has been added to enable geometric
spherical linear interpolation on an n-sphere
`scipy.spatial.SphericalVoronoi` now supports calculation of region areas in 2D
and 3D cases
The tree building algorithm used by ``cKDTree`` has improved from quadratic
worst case time complexity to loglinear. Benchmarks are also now available for
building and querying of balanced/unbalanced kd-trees.
`scipy.special` improvements
---------------------------------
The following functions now have Cython interfaces in `cython_special`:
- `scipy.special.erfinv`
- `scipy.special.erfcinv`
- `scipy.special.spherical_jn`
- `scipy.special.spherical_yn`
- `scipy.special.spherical_in`
- `scipy.special.spherical_kn`
`scipy.special.log_softmax` has been added to calculate the logarithm of softmax
function. It provides better accuracy than ``log(scipy.special.softmax(x))`` for
inputs that make softmax saturate.
`scipy.stats` improvements
-------------------------------
The function for generating random samples in `scipy.stats.dlaplace` has been
improved. The new function is approximately twice as fast with a memory
footprint reduction between 25 % and 60 % (see gh-11069).
`scipy.stats` functions that accept a seed for reproducible calculations using
random number generation (e.g. random variates from distributions) can now use
the modern ``np.random.Generator`` as well as the legacy
``np.random.RandomState`` as a seed.
The ``axis`` parameter was added to `scipy.stats.rankdata`. This allows slices
of an array along the given axis to be ranked independently.
The ``axis`` parameter was added to `scipy.stats.f_oneway`, allowing it to
compute multiple one-way ANOVA tests for data stored in n-dimensional
arrays. The performance of ``f_oneway`` was also improved for some cases.
The PDF and CDF methods for ``stats.geninvgauss`` are now significantly faster
as the numerical integration to calculate the CDF uses a Cython based
``LowLevelCallable``.
Moments of the normal distribution (`scipy.stats.norm`) are now calculated using
analytical formulas instead of numerical integration for greater speed and
accuracy
Moments and entropy trapezoidal distribution (`scipy.stats.trapz`) are now
calculated using analytical formulas instead of numerical integration for
greater speed and accuracy
Methods of the truncated normal distribution (`scipy.stats.truncnorm`),
especially ``_rvs``, are significantly faster after a complete rewrite.
The `fit` method of the Laplace distribution, `scipy.stats.laplace`, now uses
the analytical formulas for the maximum likelihood estimates of the parameters.
Generation of random variates is now thread safe for all SciPy distributions.
3rd-party distributions may need to modify the signature of the ``_rvs()``
method to conform to ``_rvs(self, ..., size=None, random_state=None)``. (A
one-time VisibleDeprecationWarning is emitted when using non-conformant
distributions.)
The Kolmogorov-Smirnov two-sided test statistic distribution
(`scipy.stats.kstwo`) was added. Calculates the distribution of the K-S
two-sided statistic ``D_n`` for a sample of size n, using a mixture of exact
and asymptotic algorithms.
The new function ``median_abs_deviation`` replaces the deprecated
``median_absolute_deviation``.
The ``wilcoxon`` function now computes the p-value for Wilcoxon's signed rank
test using the exact distribution for inputs up to length 25. The function has
a new ``mode`` parameter to specify how the p-value is to be computed. The
default is ``"auto"``, which uses the exact distribution for inputs up to length
25 and the normal approximation for larger inputs.
Added a new Cython-based implementation to evaluate guassian kernel estimates,
which should improve the performance of ``gaussian_kde``
The ``winsorize`` function now has a ``nan_policy`` argument for refined
handling of ``nan`` input values.
The ``binned_statistic_dd`` function with ``statistic="std"`` performance was
improved by ~4x.
``scipy.stats.kstest(rvs, cdf,...)`` now handles both one-sample and
two-sample testing. The one-sample variation uses `scipy.stats.ksone`
(or `scipy.stats.kstwo` with back off to `scipy.stats.kstwobign`) to calculate
the p-value. The two-sample variation, invoked if ``cdf`` is array_like, uses
an algorithm described by Hodges to compute the probability directly, only
backing off to `scipy.stats.kstwo` in case of overflow. The result in both
cases is more accurate p-values, especially for two-sample testing with
smaller (or quite different) sizes.
`scipy.stats.maxwell` performance improvements include a 20 % speed up for
`fit()`` and 5 % for ``pdf()``
`scipy.stats.shapiro` and `scipy.stats.jarque_bera` now return a named tuple
for greater consistency with other ``stats`` functions
Deprecated features
=============
`scipy` deprecations
----------------------
`scipy.special` changes
--------------------------
The ``bdtr``, ``bdtrc``, and ``bdtri`` functions are deprecating non-negative
non-integral ``n`` arguments.
`scipy.stats` changes
-----------------------
The function ``median_absolute_deviation`` is deprecated. Use
``median_abs_deviation`` instead.
The use of the string ``"raw"`` with the ``scale`` parameter of ``iqr`` is
deprecated. Use ``scale=1`` instead.
Backwards incompatible changes
======================
`scipy.interpolate` c
This PR updates scipy from 1.2.0 to 1.8.1.
Changelog
### 1.8.1 ``` compared to `1.8.0`. Notably, usage of Pythran has been restored for Windows builds/binaries. Authors ======= * Henry Schreiner * Maximilian Nöthe * Sebastian Berg (1) * Sameer Deshmukh (1) + * Niels Doucet (1) + * DWesl (4) * Isuru Fernando (1) * Ralf Gommers (4) * Matt Haberland (1) * Andrew Nelson (1) * Dimitri Papadopoulos Orfanos (1) + * Tirth Patel (3) * Tyler Reddy (46) * Pamphile Roy (7) * Niyas Sait (1) + * H. Vetinari (2) * Warren Weckesser (1) A total of 17 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.8.0 ``` many new features, numerous bug-fixes, improved test coverage and better documentation. There have been a number of deprecations and 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 ``DeprecationWarning`` s). Our development attention will now shift to bug-fix releases on the 1.8.x branch, and on adding new features on the master branch. This release requires Python `3.8`+ and NumPy `1.17.3` or greater. For running on PyPy, PyPy3 `6.0`+ is required. Highlights of this release ------------------------- - A sparse array API has been added for early testing and feedback; this work is ongoing, and users should expect minor API refinements over the next few releases. - The sparse SVD library PROPACK is now vendored with SciPy, and an interface is exposed via `scipy.sparse.svds` with ``solver='PROPACK'``. - A new `scipy.stats.sampling` submodule that leverages the ``UNU.RAN`` C library to sample from arbitrary univariate non-uniform continuous and discrete distributions - All namespaces that were private but happened to miss underscores in their names have been deprecated. New features ------------- `scipy.fft` improvements ======================== Added an ``orthogonalize=None`` parameter to the real transforms in `scipy.fft` which controls whether the modified definition of DCT/DST is used without changing the overall scaling. `scipy.fft` backend registration is now smoother, operating with a single registration call and no longer requiring a context manager. `scipy.integrate` improvements ============================== `scipy.integrate.quad_vec` introduces a new optional keyword-only argument, ``args``. ``args`` takes in a tuple of extra arguments if any (default is ``args=()``), which is then internally used to pass into the callable function (needing these extra arguments) which we wish to integrate. `scipy.interpolate` improvements ================================ `scipy.interpolate.BSpline` has a new method, ``design_matrix``, which constructs a design matrix of b-splines in the sparse CSR format. A new method ``from_cubic`` in ``BSpline`` class allows to convert a ``CubicSpline`` object to ``BSpline`` object. `scipy.linalg` improvements =========================== `scipy.linalg` gained three new public array structure investigation functions. `scipy.linalg.bandwidth` returns information about the bandedness of an array and can be used to test for triangular structure discovery, while `scipy.linalg.issymmetric` and `scipy.linalg.ishermitian` test the array for exact and approximate symmetric/Hermitian structure. `scipy.optimize` improvements ============================= `scipy.optimize.check_grad` introduces two new optional keyword only arguments, ``direction`` and ``seed``. ``direction`` can take values, ``'all'`` (default), in which case all the one hot direction vectors will be used for verifying the input analytical gradient function and ``'random'``, in which case a random direction vector will be used for the same purpose. ``seed`` (default is ``None``) can be used for reproducing the return value of ``check_grad`` function. It will be used only when ``direction='random'``. The `scipy.optimize.minimize` ``TNC`` method has been rewritten to use Cython bindings. This also fixes an issue with the callback altering the state of the optimization. Added optional parameters ``target_accept_rate`` and ``stepwise_factor`` for adapative step size adjustment in ``basinhopping``. The ``epsilon`` argument to ``approx_fprime`` is now optional so that it may have a default value consistent with most other functions in `scipy.optimize`. `scipy.signal` improvements =========================== Add ``analog`` argument, default ``False``, to ``zpk2sos``, and add new pairing option ``'minimal'`` to construct analog and minimal discrete SOS arrays. ``tf2sos`` uses zpk2sos; add ``analog`` argument here as well, and pass it on to ``zpk2sos``. ``savgol_coeffs`` and ``savgol_filter`` now work for even window lengths. Added the Chirp Z-transform and Zoom FFT available as `scipy.signal.CZT` and `scipy.signal.ZoomFFT`. `scipy.sparse` improvements =========================== An array API has been added for early testing and feedback; this work is ongoing, and users should expect minor API refinements over the next few releases. Please refer to the `scipy.sparse` docstring for more information. ``maximum_flow`` introduces optional keyword only argument, ``method`` which accepts either, ``'edmonds-karp'`` (Edmonds Karp algorithm) or ``'dinic'`` (Dinic's algorithm). Moreover, ``'dinic'`` is used as default value for ``method`` which means that Dinic's algorithm is used for computing maximum flow unless specified. See, the comparison between the supported algorithms in `this comment <https://github.com/scipy/scipy/pull/14358#issue-684212523>`_. Parameters ``atol``, ``btol`` now default to 1e-6 in `scipy.sparse.linalg.lsmr` to match with default values in `scipy.sparse.linalg.lsqr`. Add the Transpose-Free Quasi-Minimal Residual algorithm (TFQMR) for general nonsingular non-Hermitian linear systems in `scipy.sparse.linalg.tfqmr`. The sparse SVD library PROPACK is now vendored with SciPy, and an interface is exposed via `scipy.sparse.svds` with ``solver='PROPACK'``. For some problems, this may be faster and/or more accurate than the default, ARPACK. ``sparse.linalg`` iterative solvers now have a nonzero initial guess option, which may be specified as ``x0 = 'Mb'``. The ``trace`` method has been added for sparse matrices. `scipy.spatial` improvements ============================ `scipy.spatial.transform.Rotation` now supports item assignment and has a new ``concatenate`` method. Add `scipy.spatial.distance.kulczynski1` in favour of `scipy.spatial.distance.kulsinski` which will be deprecated in the next release. `scipy.spatial.distance.minkowski` now also supports ``0<p<1``. `scipy.special` improvements ============================ The new function `scipy.special.log_expit` computes the logarithm of the logistic sigmoid function. The function is formulated to provide accurate results for large positive and negative inputs, so it avoids the problems that would occur in the naive implementation ``log(expit(x))``. A suite of five new functions for elliptic integrals: ``scipy.special.ellipr{c,d,f,g,j}``. These are the `Carlson symmetric elliptic integrals <https://dlmf.nist.gov/19.16>`_, which have computational advantages over the classical Legendre integrals. Previous versions included some elliptic integrals from the Cephes library (``scipy.special.ellip{k,km1,kinc,e,einc}``) but was missing the integral of third kind (Legendre's Pi), which can be evaluated using the new Carlson functions. The new Carlson elliptic integral functions can be evaluated in the complex plane, whereas the Cephes library's functions are only defined for real inputs. Several defects in `scipy.special.hyp2f1` have been corrected. Approximately correct values are now returned for ``z`` near ``exp(+-i*pi/3)``, fixing `8054 <https://github.com/scipy/scipy/issues/8054>`_. Evaluation for such ``z`` is now calculated through a series derived by `López and Temme (2013) <https://arxiv.org/abs/1306.2046>`_ that converges in these regions. In addition, degenerate cases with one or more of ``a``, ``b``, and/or ``c`` a non-positive integer are now handled in a manner consistent with `mpmath's hyp2f1 implementation <https://mpmath.org/doc/current/functions/hypergeometric.html>`_, which fixes `7340 <https://github.com/scipy/scipy/issues/7340>`_. These fixes were made as part of an effort to rewrite the Fortran 77 implementation of hyp2f1 in Cython piece by piece. This rewriting is now roughly 50% complete. `scipy.stats` improvements ========================== `scipy.stats.qmc.LatinHypercube` introduces two new optional keyword-only arguments, ``optimization`` and ``strength``. ``optimization`` is either ``None`` or ``random-cd``. In the latter, random permutations are performed to improve the centered discrepancy. ``strength`` is either 1 or 2. 1 corresponds to the classical LHS while 2 has better sub-projection properties. This construction is referred to as an orthogonal array based LHS of strength 2. In both cases, the output is still a LHS. `scipy.stats.qmc.Halton` is faster as the underlying Van der Corput sequence was ported to Cython. The ``alternative`` parameter was added to the ``kendalltau`` and ``somersd`` functions to allow one-sided hypothesis testing. Similarly, the masked versions of ``skewtest``, ``kurtosistest``, ``ttest_1samp``, ``ttest_ind``, and ``ttest_rel`` now also have an ``alternative`` parameter. Add `scipy.stats.gzscore` to calculate the geometrical z score. Random variate generators to sample from arbitrary univariate non-uniform continuous and discrete distributions have been added to the new `scipy.stats.sampling` submodule. Implementations of a C library `UNU.RAN <http://statmath.wu.ac.at/software/unuran/>`_ are used for performance. The generators added are: - TransformedDensityRejection - DiscreteAliasUrn - NumericalInversePolynomial - DiscreteGuideTable - SimpleRatioUniforms The ``binned_statistic`` set of functions now have improved performance for the ``std``, ``min``, ``max``, and ``median`` statistic calculations. ``somersd`` and ``_tau_b`` now have faster Pythran-based implementations. Some general efficiency improvements to handling of ``nan`` values in several ``stats`` functions. Added the Tukey-Kramer test as `scipy.stats.tukey_hsd`. Improved performance of `scipy.stats.argus` ``rvs`` method. Added the parameter ``keepdims`` to `scipy.stats.variation` and prevent the undesirable return of a masked array from the function in some cases. ``permutation_test`` performs an exact or randomized permutation test of a given statistic on provided data. Deprecated features --------------------- Clear split between public and private API ========================================== SciPy has always documented what its public API consisted of in :ref:`its API reference docs <scipy-api>`, however there never was a clear split between public and private namespaces in the code base. In this release, all namespaces that were private but happened to miss underscores in their names have been deprecated. These include (as examples, there are many more): - ``scipy.signal.spline`` - ``scipy.ndimage.filters`` - ``scipy.ndimage.fourier`` - ``scipy.ndimage.measurements`` - ``scipy.ndimage.morphology`` - ``scipy.ndimage.interpolation`` - ``scipy.sparse.linalg.solve`` - ``scipy.sparse.linalg.eigen`` - ``scipy.sparse.linalg.isolve`` All functions and other objects in these namespaces that were meant to be public are accessible from their respective public namespace (e.g. `scipy.signal`). The design principle is that any public object must be accessible from a single namespace only; there are a few exceptions, mostly for historical reasons (e.g., ``stats`` and ``stats.distributions`` overlap). For other libraries aiming to provide a SciPy-compatible API, it is now unambiguous what namespace structure to follow. See `gh-14360 <https://github.com/scipy/scipy/issues/14360>`_ for more details. Other deprecations -------------------- ``NumericalInverseHermite`` has been deprecated from `scipy.stats` and moved to the `scipy.stats.sampling` submodule. It now uses the C implementation of the UNU.RAN library so the result of methods like ``ppf`` may vary slightly. Parameter ``tol`` has been deprecated and renamed to ``u_resolution``. The parameter ``max_intervals`` has also been deprecated and will be removed in a future release of SciPy. Backwards incompatible changes ---------------------------------- - SciPy has raised the minimum compiler versions to GCC 6.3 on linux and VS2019 on windows. In particular, this means that SciPy may now use C99 and C++14 features. For more details see `here <https://docs.scipy.org/doc/scipy/reference/dev/toolchain.html>`_. - The result for empty bins for `scipy.stats.binned_statistic` with the builtin ``'std'`` metric is now ``nan``, for consistency with ``np.std``. - The function `scipy.spatial.distance.wminkowski` has been removed. To achieve the same results as before, please use the ``minkowski`` distance function with the (optional) ``w=`` keyword-argument for the given weight. Other changes --------------- Some Fortran 77 code was modernized to be compatible with NAG's nagfor Fortran compiler (see, e.g., `PR 13229 <https://github.com/scipy/scipy/pull/13229>`_). ``threadpoolctl`` may now be used by our test suite to substantially improve the efficiency of parallel test suite runs. Authors --------- * endolith * adamadanandy + * akeemlh + * Anton Akhmerov * Marvin Albert + * alegresor + * Andrew Annex + * Pantelis Antonoudiou + * Ross Barnowski + * Christoph Baumgarten * Stephen Becker + * Nickolai Belakovski * Peter Bell * berberto + * Georgii Bocharov + * Evgeni Burovski * Matthias Bussonnier * CJ Carey * Justin Charlong + * Dennis Collaris + * David Cottrell + * cruyffturn + * da-woods + * Anirudh Dagar * Tiger Du + * Thomas Duvernay * Dani El-Ayyass + * Castedo Ellerman + * Donnie Erb + * Andreas Esders-Kopecky + * Livio F + * Isuru Fernando * Evelyn Fitzgerald + * Sara Fridovich-Keil + * Mark E Fuller + * Ralf Gommers * Kevin Richard Green + * guiweber + * Nitish Gupta + * h-vetinari * Matt Haberland * J. Hariharan + * Charles Harris * Trever Hines * Ian Hunt-Isaak + * ich + * Itrimel + * Jan-Hendrik Müller + * Jebby993 + * Evan W Jones + * Nathaniel Jones + * Jeffrey Kelling + * Malik Idrees Hasan Khan + * Sergey B Kirpichev * Kadatatlu Kishore + * Andrew Knyazev * Ravin Kumar + * Peter Mahler Larsen * Eric Larson * Antony Lee * Gregory R. Lee * Tim Leslie * lezcano + * Xingyu Liu * Christian Lorentzen * Lorenzo + * Smit Lunagariya + * Lv101Magikarp + * Yair M + * Cong Ma * Lorenzo Maffioli + * majiang + * Brian McFee + * Nicholas McKibben * John Speed Meyers + * millivolt9 + * Jarrod Millman * Harsh Mishra + * Boaz Mohar + * naelsondouglas + * Andrew Nelson * Nico Schlömer * Thomas Nowotny + * nullptr + * Teddy Ort + * Nick Papior * ParticularMiner + * Dima Pasechnik * Tirth Patel * Matti Picus * Ilhan Polat * Adrian Price-Whelan + * Quentin Barthélemy + * Sundar R + * Judah Rand + * Tyler Reddy * Renal-Of-Loon + * Frederic Renner + * Pamphile Roy * Bharath Saiguhan + * Atsushi Sakai * Eric Schanet + * Sebastian Wallkötter * serge-sans-paille * Reshama Shaikh + * Namami Shanker * Walter Simson + * Gagandeep Singh + * Leo C. Stein + * Albert Steppi * Kai Striega * Diana Sukhoverkhova * Søren Fuglede Jørgensen * Mike Taves * Ben Thompson + * Bas van Beek * Jacob Vanderplas * Dhruv Vats + * H. Vetinari + * Thomas Viehmann + * Pauli Virtanen * Vlad + * Arthur Volant * Samuel Wallan * Stefan van der Walt * Warren Weckesser * Josh Wilson * Haoyin Xu + * Rory Yorke * Egor Zemlyanoy * Gang Zhao + * 赵丰 (Zhao Feng) + A total of 132 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.7.3 ``` for MacOS arm64 with Python `3.8`, `3.9`, and `3.10`. The MacOS arm64 wheels are only available for MacOS version `12.0` and greater, as explained in [Issue 14688](https://github.com/scipy/scipy/issues/14688). Authors ======= * Anirudh Dagar * Ralf Gommers * Tyler Reddy * Pamphile Roy * Olivier Grisel * Isuru Fernando A total of 6 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.7.2 ``` compared to `1.7.1`. Notably, the release includes wheels for Python `3.10`, and wheels are now built with a newer version of OpenBLAS, `0.3.17`. Python `3.10` wheels are provided for MacOS x86_64 (thin, not universal2 or arm64 at this time), and Windows/Linux 64-bit. Many wheels are now built with newer versions of manylinux, which may require newer versions of pip. Authors ======= * Peter Bell * da-woods + * Isuru Fernando * Ralf Gommers * Matt Haberland * Nicholas McKibben * Ilhan Polat * Judah Rand + * Tyler Reddy * Pamphile Roy * Charles Harris * Matti Picus * Hugo van Kemenade * Jacob Vanderplas A total of 14 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.7.1 ``` compared to `1.7.0`. Authors ======= * Peter Bell * Evgeni Burovski * Justin Charlong + * Ralf Gommers * Matti Picus * Tyler Reddy * Pamphile Roy * Sebastian Wallkötter * Arthur Volant A total of 9 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.7.0 ``` many new features, numerous bug-fixes, improved test coverage and better documentation. There have been a number of deprecations and 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 ``DeprecationWarning`` s). Our development attention will now shift to bug-fix releases on the 1.7.x branch, and on adding new features on the master branch. This release requires Python `3.7+` and NumPy `1.16.5` or greater. For running on PyPy, PyPy3 `6.0+` is required. Highlights of this release - A new submodule for quasi-Monte Carlo, `scipy.stats.qmc`, was added - The documentation design was updated to use the same PyData-Sphinx theme as other NumFOCUS packages like NumPy. - We now vendor and leverage the Boost C++ library to enable numerous improvements for long-standing weaknesses in `scipy.stats` - `scipy.stats` has six new distributions, eight new (or overhauled) hypothesis tests, a new function for bootstrapping, a class that enables fast random variate sampling and percentile point function evaluation, and many other enhancements. - ``cdist`` and ``pdist`` distance calculations are faster for several metrics, especially weighted cases, thanks to a rewrite to a new C++ backend framework - A new class for radial basis function interpolation, `RBFInterpolator`, was added to address issues with the `Rbf` class. *We gratefully acknowledge the Chan-Zuckerberg Initiative Essential Open Source Software for Science program for supporting many of the improvements to* `scipy.stats`. New features `scipy.cluster` improvements An optional argument, ``seed``, has been added to ``kmeans`` and ``kmeans2`` to set the random generator and random state. `scipy.interpolate` improvements Improved input validation and error messages for ``fitpack.bispev`` and ``fitpack.parder`` for scenarios that previously caused substantial confusion for users. The class `RBFInterpolator` was added to supersede the `Rbf` class. The new class has usage that more closely follows other interpolator classes, corrects sign errors that caused unexpected smoothing behavior, includes polynomial terms in the interpolant (which are necessary for some RBF choices), and supports interpolation using only the k-nearest neighbors for memory efficiency. `scipy.linalg` improvements An LAPACK wrapper was added for access to the ``tgexc`` subroutine. `scipy.ndimage` improvements `scipy.ndimage.affine_transform` is now able to infer the ``output_shape`` from the ``out`` array. `scipy.optimize` improvements The optional parameter ``bounds`` was added to ``_minimize_neldermead`` to support bounds constraints for the Nelder-Mead solver. ``trustregion`` methods ``trust-krylov``, ``dogleg`` and ``trust-ncg`` can now estimate ``hess`` by finite difference using one of ``["2-point", "3-point", "cs"]``. ``halton`` was added as a ``sampling_method`` in `scipy.optimize.shgo`. ``sobol`` was fixed and is now using `scipy.stats.qmc.Sobol`. ``halton`` and ``sobol`` were added as ``init`` methods in `scipy.optimize.differential_evolution.` ``differential_evolution`` now accepts an ``x0`` parameter to provide an initial guess for the minimization. ``least_squares`` has a modest performance improvement when SciPy is built with Pythran transpiler enabled. When ``linprog`` is used with ``method`` ``'highs'``, ``'highs-ipm'``, or ``'highs-ds'``, the result object now reports the marginals (AKA shadow prices, dual values) and residuals associated with each constraint. `scipy.signal` improvements ``get_window`` supports ``general_cosine`` and ``general_hamming`` window functions. `scipy.signal.medfilt2d` now releases the GIL where appropriate to enable performance gains via multithreaded calculations. `scipy.sparse` improvements Addition of ``dia_matrix`` sparse matrices is now faster. `scipy.spatial` improvements ``distance.cdist`` and ``distance.pdist`` performance has greatly improved for certain weighted metrics. Namely: ``minkowski``, ``euclidean``, ``chebyshev``, ``canberra``, and ``cityblock``. Modest performance improvements for many of the unweighted ``cdist`` and ``pdist`` metrics noted above. The parameter ``seed`` was added to `scipy.spatial.vq.kmeans` and `scipy.spatial.vq.kmeans2`. The parameters ``axis`` and ``keepdims`` where added to `scipy.spatial.distance.jensenshannon`. The ``rotation`` methods ``from_rotvec`` and ``as_rotvec`` now accept a ``degrees`` argument to specify usage of degrees instead of radians. `scipy.special` improvements Wright's generalized Bessel function for positive arguments was added as `scipy.special.wright_bessel.` An implementation of the inverse of the Log CDF of the Normal Distribution is now available via `scipy.special.ndtri_exp`. `scipy.stats` improvements Hypothesis Tests The Mann-Whitney-Wilcoxon test, ``mannwhitneyu``, has been rewritten. It now supports n-dimensional input, an exact test method when there are no ties, and improved documentation. Please see "Other changes" for adjustments to default behavior. The new function `scipy.stats.binomtest` replaces `scipy.stats.binom_test`. The new function returns an object that calculates a confidence intervals of the proportion parameter. Also, performance was improved from O(n) to O(log(n)) by using binary search. The two-sample version of the Cramer-von Mises test is implemented in `scipy.stats.cramervonmises_2samp`. The Alexander-Govern test is implemented in the new function `scipy.stats.alexandergovern`. The new functions `scipy.stats.barnard_exact` and `scipy.stats. boschloo_exact` respectively perform Barnard's exact test and Boschloo's exact test for 2x2 contingency tables. The new function `scipy.stats.page_trend_test` performs Page's test for ordered alternatives. The new function `scipy.stats.somersd` performs Somers' D test for ordinal association between two variables. An option, ``permutations``, has been added in `scipy.stats.ttest_ind` to perform permutation t-tests. A ``trim`` option was also added to perform a trimmed (Yuen's) t-test. The ``alternative`` parameter was added to the ``skewtest``, ``kurtosistest``, ``ranksums``, ``mood``, ``ansari``, ``linregress``, and ``spearmanr`` functions to allow one-sided hypothesis testing. Sample statistics The new function `scipy.stats.differential_entropy` estimates the differential entropy of a continuous distribution from a sample. The ``boxcox`` and ``boxcox_normmax`` now allow the user to control the optimizer used to minimize the negative log-likelihood function. A new function `scipy.stats.contingency.relative_risk` calculates the relative risk, or risk ratio, of a 2x2 contingency table. The object returned has a method to compute the confidence interval of the relative risk. Performance improvements in the ``skew`` and ``kurtosis`` functions achieved by removal of repeated/redundant calculations. Substantial performance improvements in `scipy.stats.mstats.hdquantiles_sd`. The new function `scipy.stats.contingency.association` computes several measures of association for a contingency table: Pearsons contingency coefficient, Cramer's V, and Tschuprow's T. The parameter ``nan_policy`` was added to `scipy.stats.zmap` to provide options for handling the occurrence of ``nan`` in the input data. The parameter ``ddof`` was added to `scipy.stats.variation` and `scipy.stats.mstats.variation`. The parameter ``weights`` was added to `scipy.stats.gmean`. Statistical Distributions We now vendor and leverage the Boost C++ library to address a number of previously reported issues in ``stats``. Notably, ``beta``, ``binom``, ``nbinom`` now have Boost backends, and it is straightforward to leverage the backend for additional functions. The skew Cauchy probability distribution has been implemented as `scipy.stats.skewcauchy`. The Zipfian probability distribution has been implemented as `scipy.stats.zipfian`. The new distributions ``nchypergeom_fisher`` and ``nchypergeom_wallenius`` implement the Fisher and Wallenius versions of the noncentral hypergeometric distribution, respectively. The generalized hyperbolic distribution was added in `scipy.stats.genhyperbolic`. The studentized range distribution was added in `scipy.stats.studentized_range`. `scipy.stats.argus` now has improved handling for small parameter values. Better argument handling/preparation has resulted in performance improvements for many distributions. The ``cosine`` distribution has added ufuncs for ``ppf``, ``cdf``, ``sf``, and ``isf`` methods including numerical precision improvements at the edges of the support of the distribution. An option to fit the distribution to data by the method of moments has been added to the ``fit`` method of the univariate continuous distributions. Other `scipy.stats.bootstrap` has been added to allow estimation of the confidence interval and standard error of a statistic. The new function `scipy.stats.contingency.crosstab` computes a contingency table (i.e. a table of counts of unique entries) for the given data. `scipy.stats.NumericalInverseHermite` enables fast random variate sampling and percentile point function evaluation of an arbitrary univariate statistical distribution. New `scipy.stats.qmc` module This new module provides Quasi-Monte Carlo (QMC) generators and associated helper functions. It provides a generic class `scipy.stats.qmc.QMCEngine` which defines a QMC engine/sampler. An engine is state aware: it can be continued, advanced and reset. 3 base samplers are available: - `scipy.stats.qmc.Sobol` the well known Sobol low discrepancy sequence. Several warnings have been added to guide the user into properly using this sampler. The sequence is scrambled by default. - `scipy.stats.qmc.Halton`: Halton low discrepancy sequence. The sequence is scrambled by default. - `scipy.stats.qmc.LatinHypercube`: plain LHS design. And 2 special samplers are available: - `scipy.stats.qmc.MultinomialQMC`: sampling from a multinomial distribution using any of the base `scipy.stats.qmc.QMCEngine`. - `scipy.stats.qmc.MultivariateNormalQMC`: sampling from a multivariate Normal using any of the base `scipy.stats.qmc.QMCEngine`. The module also provide the following helpers: - `scipy.stats.qmc.discrepancy`: assess the quality of a set of points in terms of space coverage. - `scipy.stats.qmc.update_discrepancy`: can be used in an optimization loop to construct a good set of points. - `scipy.stats.qmc.scale`: easily scale a set of points from (to) the unit interval to (from) a given range. Deprecated features `scipy.linalg` deprecations - `scipy.linalg.pinv2` is deprecated and its functionality is completely subsumed into `scipy.linalg.pinv` - Both ``rcond``, ``cond`` keywords of `scipy.linalg.pinv` and `scipy.linalg.pinvh` were not working and now are deprecated. They are now replaced with functioning ``atol`` and ``rtol`` keywords with clear usage. `scipy.spatial` deprecations - `scipy.spatial.distance` metrics expect 1d input vectors but will call ``np.squeeze`` on their inputs to accept any extra length-1 dimensions. That behaviour is now deprecated. Backwards incompatible changes Other changes We now accept and leverage performance improvements from the ahead-of-time Python-to-C++ transpiler, Pythran, which can be optionally disabled (via ``export SCIPY_USE_PYTHRAN=0``) but is enabled by default at build time. There are two changes to the default behavior of `scipy.stats.mannwhitenyu`: - For years, use of the default ``alternative=None`` was deprecated; explicit ``alternative`` specification was required. Use of the new default value of ``alternative``, "two-sided", is now permitted. - Previously, all p-values were based on an asymptotic approximation. Now, for small samples without ties, the p-values returned are exact by default. Support has been added for PEP 621 (project metadata in ``pyproject.toml``) We now support a Gitpod environment to reduce the barrier to entry for SciPy development; for more details see `quickstart-gitpod`. Authors * endolith * Jelle Aalbers + * Adam + * Tania Allard + * Sven Baars + * Max Balandat + * baumgarc + * Christoph Baumgarten * Peter Bell * Lilian Besson * Robinson Besson + * Max Bolingbroke * Blair Bonnett + * Jordão Bragantini * Harm Buisman + * Evgeni Burovski * Matthias Bussonnier * Dominic C * CJ Carey * Ramón Casero + * Chachay + * charlotte12l + * Benjamin Curtice Corbett + * Falcon Dai + * Ian Dall + * Terry Davis * droussea2001 + * DWesl + * dwight200 + * Thomas J. Fan + * Joseph Fox-Rabinovitz * Max Frei + * Laura Gutierrez Funderburk + * gbonomib + * Matthias Geier + * Pradipta Ghosh + * Ralf Gommers * Evan H + * h-vetinari * Matt Haberland * Anselm Hahn + * Alex Henrie * Piet Hessenius + * Trever Hines + * Elisha Hollander + * Stephan Hoyer * Tom Hu + * Kei Ishikawa + * Julien Jerphanion * Robert Kern * Shashank KS + * Peter Mahler Larsen * Eric Larson * Cheng H. Lee + * Gregory R. Lee * Jean-Benoist Leger + * lgfunderburk + * liam-o-marsh + * Xingyu Liu + * Alex Loftus + * Christian Lorentzen + * Cong Ma * Marc + * MarkPundurs + * Markus Löning + * Liam Marsh + * Nicholas McKibben * melissawm + * Jamie Morton * Andrew Nelson * Nikola Forró * Tor Nordam + * Olivier Gauthé + * Rohit Pandey + * Avanindra Kumar Pandeya + * Tirth Patel * paugier + * Alex H. Wagner, PhD + * Jeff Plourde + * Ilhan Polat * pranavrajpal + * Vladyslav Rachek * Bharat Raghunathan * Recursing + * Tyler Reddy * Lucas Roberts * Gregor Robinson + * Pamphile Roy + * Atsushi Sakai * Benjamin Santos * Martin K. Scherer + * Thomas Schmelzer + * Daniel Scott + * Sebastian Wallkötter + * serge-sans-paille + * Namami Shanker + * Masashi Shibata + * Alexandre de Siqueira + * Albert Steppi + * Adam J. Stewart + * Kai Striega * Diana Sukhoverkhova * Søren Fuglede Jørgensen * Mike Taves * Dan Temkin + * Nicolas Tessore + * tsubota20 + * Robert Uhl * christos val + * Bas van Beek + * Ashutosh Varma + * Jose Vazquez + * Sebastiano Vigna * Aditya Vijaykumar * VNMabus * Arthur Volant + * Samuel Wallan * Stefan van der Walt * Warren Weckesser * Anreas Weh * Josh Wilson * Rory Yorke * Egor Zemlyanoy * Marc Zoeller + * zoj613 + * 秋纫 + A total of 126 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.6.3 ``` compared to `1.6.2`. Authors ====== * Peter Bell * Ralf Gommers * Matt Haberland * Peter Mahler Larsen * Tirth Patel * Tyler Reddy * Pamphile ROY + * Xingyu Liu + A total of 8 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.6.2 ``` compared to `1.6.1`. This is also the first SciPy release to place upper bounds on some dependencies to improve the long-term repeatability of source builds. Authors ======= * Pradipta Ghosh + * Tyler Reddy * Ralf Gommers * Martin K. Scherer + * Robert Uhl * Warren Weckesser A total of 6 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.6.1 ``` compared to `1.6.0`. Please note that for SciPy wheels to correctly install with pip on macOS 11, pip `>= 20.3.3` is needed. Authors ======= * Peter Bell * Evgeni Burovski * CJ Carey * Ralf Gommers * Peter Mahler Larsen * Cheng H. Lee + * Cong Ma * Nicholas McKibben * Nikola Forró * Tyler Reddy * Warren Weckesser A total of 11 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.6.0 ``` many new features, numerous bug-fixes, improved test coverage and better documentation. There have been a number of deprecations and 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 ``DeprecationWarning`` s). Our development attention will now shift to bug-fix releases on the 1.6.x branch, and on adding new features on the master branch. This release requires Python `3.7`+ and NumPy `1.16.5` or greater. For running on PyPy, PyPy3 `6.0`+ is required. Highlights of this release ---------------------------- - `scipy.ndimage` improvements: Fixes and ehancements to boundary extension modes for interpolation functions. Support for complex-valued inputs in many filtering and interpolation functions. New ``grid_mode`` option for `scipy.ndimage.zoom` to enable results consistent with scikit-image's ``rescale``. - `scipy.optimize.linprog` has fast, new methods for large, sparse problems from the ``HiGHS`` library. - `scipy.stats` improvements including new distributions, a new test, and enhancements to existing distributions and tests New features ============ `scipy.special` improvements ----------------------------- `scipy.special` now has improved support for 64-bit ``LAPACK`` backend `scipy.odr` improvements ------------------------- `scipy.odr` now has support for 64-bit integer ``BLAS`` `scipy.odr.ODR` has gained an optional ``overwrite`` argument so that existing files may be overwritten. `scipy.integrate` improvements ------------------------------- Some renames of functions with poor names were done, with the old names retained without being in the reference guide for backwards compatibility reasons: - ``integrate.simps`` was renamed to ``integrate.simpson`` - ``integrate.trapz`` was renamed to ``integrate.trapezoid`` - ``integrate.cumtrapz`` was renamed to ``integrate.cumulative_trapezoid`` `scipy.cluster` improvements ------------------------------- `scipy.cluster.hierarchy.DisjointSet` has been added for incremental connectivity queries. `scipy.cluster.hierarchy.dendrogram` return value now also includes leaf color information in `leaves_color_list`. `scipy.interpolate` improvements --------------------------------- `scipy.interpolate.interp1d` has a new method ``nearest-up``, similar to the existing method ``nearest`` but rounds half-integers up instead of down. `scipy.io` improvements ------------------------ Support has been added for reading arbitrary bit depth integer PCM WAV files from 1- to 32-bit, including the commonly-requested 24-bit depth. `scipy.linalg` improvements ---------------------------- The new function `scipy.linalg.matmul_toeplitz` uses the FFT to compute the product of a Toeplitz matrix with another matrix. `scipy.linalg.sqrtm` and `scipy.linalg.logm` have performance improvements thanks to additional Cython code. Python ``LAPACK`` wrappers have been added for ``pptrf``, ``pptrs``, ``ppsv``, ``pptri``, and ``ppcon``. `scipy.linalg.norm` and the ``svd`` family of functions will now use 64-bit integer backends when available. `scipy.ndimage` improvements ----------------------------- `scipy.ndimage.convolve`, `scipy.ndimage.correlate` and their 1d counterparts now accept both complex-valued images and/or complex-valued filter kernels. All convolution-based filters also now accept complex-valued inputs (e.g. ``gaussian_filter``, ``uniform_filter``, etc.). Multiple fixes and enhancements to boundary handling were introduced to `scipy.ndimage` interpolation functions (i.e. ``affine_transform``, ``geometric_transform``, ``map_coordinates``, ``rotate``, ``shift``, ``zoom``). A new boundary mode, ``grid-wrap`` was added which wraps images periodically, using a period equal to the shape of the input image grid. This is in contrast to the existing ``wrap`` mode which uses a period that is one sample smaller than the original signal extent along each dimension. A long-standing bug in the ``reflect`` boundary condition has been fixed and the mode ``grid-mirror`` was introduced as a synonym for ``reflect``. A new boundary mode, ``grid-constant`` is now available. This is similar to the existing ndimage ``constant`` mode, but interpolation will still performed at coordinate values outside of the original image extent. This ``grid-constant`` mode is consistent with OpenCV's ``BORDER_CONSTANT`` mode and scikit-image's ``constant`` mode. Spline pre-filtering (used internally by ``ndimage`` interpolation functions when ``order >= 2``), now supports all boundary modes rather than always defaulting to mirror boundary conditions. The standalone functions ``spline_filter`` and ``spline_filter1d`` have analytical boundary conditions that match modes ``mirror``, ``grid-wrap`` and ``reflect``. `scipy.ndimage` interpolation functions now accept complex-valued inputs. In this case, the interpolation is applied independently to the real and imaginary components. The ``ndimage`` tutorials (https://docs.scipy.org/doc/scipy/reference/tutorial/ndimage.html) have been updated with new figures to better clarify the exact behavior of all of the interpolation boundary modes. `scipy.ndimage.zoom` now has a ``grid_mode`` option that changes the coordinate of the center of the first pixel along an axis from 0 to 0.5. This allows resizing in a manner that is consistent with the behavior of scikit-image's ``resize`` and ``rescale`` functions (and OpenCV's ``cv2.resize``). `scipy.optimize` improvements ------------------------------ `scipy.optimize.linprog` has fast, new methods for large, sparse problems from the ``HiGHS`` C++ library. ``method='highs-ds'`` uses a high performance dual revised simplex implementation (HSOL), ``method='highs-ipm'`` uses an interior-point method with crossover, and ``method='highs'`` chooses between the two automatically. These methods are typically much faster and often exceed the accuracy of other ``linprog`` methods, so we recommend explicitly specifying one of these three method values when using ``linprog``. `scipy.optimize.quadratic_assignment` has been added for approximate solution of the quadratic assignment problem. `scipy.optimize.linear_sum_assignment` now has a substantially reduced overhead for small cost matrix sizes `scipy.optimize.least_squares` has improved performance when the user provides the jacobian as a sparse jacobian already in ``csr_matrix`` format `scipy.optimize.linprog` now has an ``rr_method`` argument for specification of the method used for redundancy handling, and a new method for this purpose is available based on the interpolative decomposition approach. `scipy.signal` improvements ---------------------------- `scipy.signal.gammatone` has been added to design FIR or IIR filters that model the human auditory system. `scipy.signal.iircomb` has been added to design IIR peaking/notching comb filters that can boost/attenuate a frequency from a signal. `scipy.signal.sosfilt` performance has been improved to avoid some previously- observed slowdowns `scipy.signal.windows.taylor` has been added--the Taylor window function is commonly used in radar digital signal processing `scipy.signal.gauss_spline` now supports ``list`` type input for consistency with other related SciPy functions `scipy.signal.correlation_lags` has been added to allow calculation of the lag/ displacement indices array for 1D cross-correlation. `scipy.sparse` improvements ---------------------------- A solver for the minimum weight full matching problem for bipartite graphs, also known as the linear assignment problem, has been added in `scipy.sparse.csgraph.min_weight_full_bipartite_matching`. In particular, this provides functionality analogous to that of `scipy.optimize.linear_sum_assignment`, but with improved performance for sparse inputs, and the ability to handle inputs whose dense representations would not fit in memory. The time complexity of `scipy.sparse.block_diag` has been improved dramatically from quadratic to linear. `scipy.sparse.linalg` improvements ----------------------------------- The vendored version of ``SuperLU`` has been updated `scipy.fft` improvements ------------------------- The vendored ``pocketfft`` library now supports compiling with ARM neon vector extensions and has improved thread pool behavior. `scipy.spatial` improvements ----------------------------- The python implementation of ``KDTree`` has been dropped and ``KDTree`` is now implemented in terms of ``cKDTree``. You can now expect ``cKDTree``-like performance by default. This also means ``sys.setrecursionlimit`` no longer needs to be increased for querying large trees. ``transform.Rotation`` has been updated with support for Modified Rodrigues Parameters alongside the existing rotation representations (PR gh-12667). `scipy.spatial.transform.Rotation` has been partially cythonized, with some performance improvements observed `scipy.spatial.distance.cdist` has improved performance with the ``minkowski`` metric, especially for p-norm values of 1 or 2. `scipy.stats` improvements --------------------------- New distributions have been added to `scipy.stats`: - The asymmetric Laplace continuous distribution has been added as `scipy.stats.laplace_asymmetric`. - The negative hypergeometric distribution has been added as `scipy.stats.nhypergeom`. - The multivariate t distribution has been added as `scipy.stats.multivariate_t`. - The multivariate hypergeometric distribution has been added as `scipy.stats.multivariate_hypergeom`. The ``fit`` method has been overridden for several distributions (``laplace``, ``pareto``, ``rayleigh``, ``invgauss``, ``logistic``, ``gumbel_l``, ``gumbel_r``); they now use analytical, distribution-specific maximum likelihood estimation results for greater speed and accuracy than the generic (numerical optimization) implementation. The one-sample Cramér-von Mises test has been added as `scipy.stats.cramervonmises`. An option to compute one-sided p-values was added to `scipy.stats.ttest_1samp`, `scipy.stats.ttest_ind_from_stats`, `scipy.stats.ttest_ind` and `scipy.stats.ttest_rel`. The function `scipy.stats.kendalltau` now has an option to compute Kendall's tau-c (also known as Stuart's tau-c), and support has been added for exact p-value calculations for sample sizes ``> 171``. `stats.trapz` was renamed to `stats.trapezoid`, with the former name retained as an alias for backwards compatibility reasons. The function `scipy.stats.linregress` now includes the standard error of the intercept in its return value. The ``_logpdf``, ``_sf``, and ``_isf`` methods have been added to `scipy.stats.nakagami`; ``_sf`` and ``_isf`` methods also added to `scipy.stats.gumbel_r` The ``sf`` method has been added to `scipy.stats.levy` and `scipy.stats.levy_l` for improved precision. `scipy.stats.binned_statistic_dd` performance improvements for the following computed statistics: ``max``, ``min``, ``median``, and ``std``. We gratefully acknowledge the Chan-Zuckerberg Initiative Essential Open Source Software for Science program for supporting many of these improvements to `scipy.stats`. Deprecated features =================== `scipy.spatial` changes ------------------------ Calling ``KDTree.query`` with ``k=None`` to find all neighbours is deprecated. Use ``KDTree.query_ball_point`` instead. ``distance.wminkowski`` was deprecated; use ``distance.minkowski`` and supply weights with the ``w`` keyword instead. Backwards incompatible changes ============================== `scipy` changes ---------------- Using `scipy.fft` as a function aliasing ``numpy.fft.fft`` was removed after being deprecated in SciPy ``1.4.0``. As a result, the `scipy.fft` submodule must be explicitly imported now, in line with other SciPy subpackages. `scipy.signal` changes ----------------------- The output of ``decimate``, ``lfilter_zi``, ``lfiltic``, ``sos2tf``, and ``sosfilt_zi`` have been changed to match ``numpy.result_type`` of their inputs. The window function ``slepian`` was removed. It had been deprecated since SciPy ``1.1``. `scipy.spatial` changes ------------------------ ``cKDTree.query`` now returns 64-bit rather than 32-bit integers on Windows, making behaviour consistent between platforms (PR gh-12673). `scipy.stats` changes ---------------------- The ``frechet_l`` and ``frechet_r`` distributions were removed. They were deprecated since SciPy ``1.0``. Other changes ============= ``setup_requires`` was removed from ``setup.py``. This means that users invoking ``python setup.py install`` without having numpy already installed will now get an error, rather than having numpy installed for them via ``easy_install``. This install method was always fragile and problematic, users are encouraged to use ``pip`` when installing from source. - Fixed a bug in `scipy.optimize.dual_annealing` ``accept_reject`` calculation that caused uphill jumps to be accepted less frequently. - The time required for (un)pickling of `scipy.stats.rv_continuous`, `scipy.stats.rv_discrete`, and `scipy.stats.rv_frozen` has been significantly reduced (gh12550). Inheriting subclasses should note that ``__setstate__`` no longer calls ``__init__`` upon unpickling. Authors ======= * endolith * vkk800 * aditya + * George Bateman + * Christoph Baumgarten * Peter Bell * Tobias Biester + * Keaton J. Burns + * Evgeni Burovski * Rüdiger Busche + * Matthias Bussonnier * Dominic C + * Corallus Caninus + * CJ Carey * Thomas A Caswell * chapochn + * Lucía Cheung * Zach Colbert + * Coloquinte + * Yannick Copin + * Devin Crowley + * Terry Davis + * Michaël Defferrard + * devonwp + * Didier + * divenex + * Thomas Duvernay + * Eoghan O'Connell + * Gökçen Eraslan * Kristian Eschenburg + * Ralf Gommers * Thomas Grainger + * GreatV + * Gregory Gundersen + * h-vetinari + * Matt Haberland * Mark Harfouche + * He He + * Alex Henrie * Chun-Ming Huang + * Martin James McHugh III + * Alex Izvorski + * Joey + * ST John + * Jonas Jonker + * Julius Bier Kirkegaard * Marcin Konowalczyk + * Konrad0 * Sam Van Kooten + * Sergey Koposov + * Peter Mahler Larsen * Eric Larson * Antony Lee * Gregory R. Lee * Loïc Estève * Jean-Luc Margot + * MarkusKoebis + * Nikolay Mayorov * G. D. McBain * Andrew McCluskey + * Nicholas McKibben * Sturla Molden * Denali Molitor + * Eric Moore * Shashaank N + * Prashanth Nadukandi + * nbelakovski + * Andrew Nelson * Nick + * Nikola Forró + * odidev * ofirr + * Sambit Panda * Dima Pasechnik * Tirth Patel + * Paweł Redzyński + * Vladimir Philipenko + * Philipp Thölke + * Ilhan Polat * Eugene Prilepin + * Vladyslav Rachek * Ram Rachum + * Tyler Reddy * Martin Reinecke + * Simon Segerblom Rex + * Lucas Roberts * Benjamin Rowell + * Eli Rykoff + * Atsushi Sakai * Moritz Schulte + * Daniel B. Smith * Steve Smith + * Jan Soedingrekso + * Victor Stinner + * Jose Storopoli + * Diana Sukhoverkhova + * Søren Fuglede Jørgensen * taoky + * Mike Taves + * Ian Thomas + * Will Tirone + * Frank Torres + * Seth Troisi * Ronald van Elburg + * Hugo van Kemenade * Paul van Mulbregt * Saul Ivan Rivas Vega + * Pauli Virtanen * Jan Vleeshouwers * Samuel Wallan * Warren Weckesser * Ben West + * Eric Wieser * WillTirone + * Levi John Wolf + * Zhiqing Xiao * Rory Yorke + * Yun Wang (Maigo) + * Egor Zemlyanoy + * ZhihuiChen0903 + * Jacob Zhong + A total of 121 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.5.4 ``` compared to `1.5.3`. Importantly, wheels are now available for Python `3.9` and a more complete fix has been applied for issues building with XCode `12`. Authors ===== * Peter Bell * CJ Carey * Andrew McCluskey + * Andrew Nelson * Tyler Reddy * Eli Rykoff + * Ian Thomas + A total of 7 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.5.3 ``` compared to `1.5.2`. In particular, Linux ARM64 wheels are now available and a compatibility issue with XCode 12 has been fixed. Authors ======= * Peter Bell * CJ Carey * Thomas Duvernay + * Gregory Lee * Eric Moore * odidev * Dima Pasechnik * Tyler Reddy * Simon Segerblom Rex + * Daniel B. Smith * Will Tirone + * Warren Weckesser A total of 12 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.5.2 ``` compared to `1.5.1`. Authors ===== * Peter Bell * Tobias Biester + * Evgeni Burovski * Thomas A Caswell * Ralf Gommers * Sturla Molden * Andrew Nelson * ofirr + * Sambit Panda * Ilhan Polat * Tyler Reddy * Atsushi Sakai * Pauli Virtanen A total of 13 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.5.1 ``` compared to `1.5.0`. In particular, an issue where DLL loading can fail for SciPy wheels on Windows with Python `3.6` has been fixed. Authors ======= * Peter Bell * Loïc Estève * Philipp Thölke + * Tyler Reddy * Paul van Mulbregt * Pauli Virtanen * Warren Weckesser A total of 7 people contributed to this release. People with a "+" by their names contributed a patch for the first time. This list of names is automatically generated, and may not be fully complete. ``` ### 1.5.0 ``` many new features, numerous bug-fixes, improved test coverage and better documentation. There have been a number of deprecations and 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 ``DeprecationWarning`` s). Our development attention will now shift to bug-fix releases on the 1.5.x branch, and on adding new features on the master branch. This release requires Python `3.6+` and NumPy `1.14.5` or greater. For running on PyPy, PyPy3 `6.0+` and NumPy `1.15.0` are required. Highlights of this release ---------------------------- - wrappers for more than a dozen new ``LAPACK`` routines are now available in `scipy.linalg.lapack` - Improved support for leveraging 64-bit integer size from linear algebra backends - addition of the probability distribution for two-sided one-sample Kolmogorov-Smirnov tests New features ========= `scipy.cluster` improvements -------------------------------- Initialization of `scipy.cluster.vq.kmeans2` using ``minit="++"`` had a quadratic complexity in the number of samples. It has been improved, resulting in a much faster initialization with quasi-linear complexity. `scipy.cluster.hierarchy.dendrogram` now respects the ``matplotlib`` color palette `scipy.fft` improvements ------------------------------ A new keyword-only argument ``plan`` is added to all FFT functions in this module. It is reserved for passing in a precomputed plan from libraries providing a FFT backend (such as ``PyFFTW`` and ``mkl-fft``), and it is currently not used in SciPy. `scipy.integrate` improvements ---------------------------------- `scipy.interpolate` improvements ------------------------------------- `scipy.io` improvements --------------------------- `scipy.io.wavfile` error messages are more explicit about what's wrong, and extraneous bytes at the ends of files are ignored instead of raising an error when the data has successfully been read. `scipy.io.loadmat` gained a ``simplify_cells`` parameter, which if set to ``True`` simplifies the structure of the return value if the ``.mat`` file contains cell arrays. ``pathlib.Path`` objects are now supported in `scipy.io` Matrix Market I/O functions `scipy.linalg` improvements ------------------------------- `scipy.linalg.eigh` has been improved. Now various ``LAPACK`` drivers can be selected at will and also subsets of eigenvalues can be requested via ``subset_by_value`` keyword. Another keyword ``subset_by_index`` is introduced. Keywords ``turbo`` and ``eigvals`` are deprecated. Similarly, standard and generalized Hermitian eigenvalue ``LAPACK`` routines ``?<sy/he>evx`` are added and existing ones now have full ``_lwork`` counterparts. Wrappers for the following ``LAPACK`` routines have been added to `scipy.linalg.lapack`: - ``?getc2``: computes the LU factorization of a general matrix with complete pivoting - ``?gesc2``: solves a linear system given an LU factorization from ``?getc2`` - ``?gejsv``: computes the singular value decomposition of a general matrix with higher accuracy calculation of tiny singular values and their corresponding singular vectors - ``?geqrfp``: computes the QR factorization of a general matrix with non-negative elements on the diagonal of R - ``?gtsvx``: solves a linear system with general tridiagonal matrix - ``?gttrf``: computes the LU factorization of a tridiagonal matrix - ``?gttrs``: solves a linear system given an LU factorization from ``?gttrf`` - ``?ptsvx``: solves a linear system with symmetric positive definite tridiagonal matrix - ``?pttrf``: computes the LU factorization of a symmetric positive definite tridiagonal matrix - ``?pttrs``: solves a linear system given an LU factorization from ``?pttrf`` - ``?pteqr``: computes the eigenvectors and eigenvalues of a positive definite tridiagonal matrix - ``?tbtrs``: solves a linear system with a triangular banded matrix - ``?csd``: computes the Cosine Sine decomposition of an orthogonal/unitary matrix Generalized QR factorization routines (``?geqrf``) now have full ``_lwork`` counterparts. `scipy.linalg.cossin` Cosine Sine decomposition of unitary matrices has been added. The function `scipy.linalg.khatri_rao`, which computes the Khatri-Rao product, was added. The new function `scipy.linalg.convolution_matrix` constructs the Toeplitz matrix representing one-dimensional convolution. `scipy.ndimage` improvements ---------------------------------- `scipy.optimize` improvements ---------------------------------- The finite difference numerical differentiation used in various ``minimize`` methods that use gradients has several new features: - 2-point, 3-point, or complex step finite differences can be used. Previously only a 2-step finite difference was available. - There is now the possibility to use a relative step size, previously only an absolute step size was available. - If the ``minimize`` method uses bounds the numerical differentiation strictly obeys those limits. - The numerical differentiation machinery now makes use of a simple cache, which in some cases can reduce the number of function evaluations. - ``minimize``'s ``method= 'powell'`` now supports simple bound constraints There have been several improvements to `scipy.optimize.linprog`: - The ``linprog`` benchmark suite has been expanded considerably. - ``linprog``'s dense pivot-based redundancy removal routine and sparse presolve are faster - When ``scikit-sparse`` is available, solving sparse problems with ``method='interior-point'`` is faster The caching of values when optimizing a function returning both value and gradient together has been improved, avoiding repeated function evaluations when using a ``HessianApproximation`` such as ``BFGS``. ``differential_evolution`` can now use the modern ``np.random.Generator`` as well as the legacy ``np.random.RandomState`` as a seed. `scipy.signal` improvements ------------------------------- A new optional argument ``include_nyquist`` is added to ``freqz`` functions in this module. It is used for including the last frequency (Nyquist frequency). `scipy.signal.find_peaks_cwt` now accepts a ``window_size`` parameter for the size of the window used to calculate the noise floor. `scipy.sparse` improvements -------------------------------- Outer indexing is now faster when using a 2d column vector to select column indices. `scipy.sparse.lil.tocsr` is faster Fixed/improved comparisons between pydata sparse arrays and sparse matrices BSR format sparse multiplication performance has been improved. `scipy.sparse.linalg.LinearOperator` has gained the new ``ndim`` class attribute `scipy.spatial` improvements -------------------------------- `scipy.spatial.geometric_slerp` has been added to enable geometric spherical linear interpolation on an n-sphere `scipy.spatial.SphericalVoronoi` now supports calculation of region areas in 2D and 3D cases The tree building algorithm used by ``cKDTree`` has improved from quadratic worst case time complexity to loglinear. Benchmarks are also now available for building and querying of balanced/unbalanced kd-trees. `scipy.special` improvements --------------------------------- The following functions now have Cython interfaces in `cython_special`: - `scipy.special.erfinv` - `scipy.special.erfcinv` - `scipy.special.spherical_jn` - `scipy.special.spherical_yn` - `scipy.special.spherical_in` - `scipy.special.spherical_kn` `scipy.special.log_softmax` has been added to calculate the logarithm of softmax function. It provides better accuracy than ``log(scipy.special.softmax(x))`` for inputs that make softmax saturate. `scipy.stats` improvements ------------------------------- The function for generating random samples in `scipy.stats.dlaplace` has been improved. The new function is approximately twice as fast with a memory footprint reduction between 25 % and 60 % (see gh-11069). `scipy.stats` functions that accept a seed for reproducible calculations using random number generation (e.g. random variates from distributions) can now use the modern ``np.random.Generator`` as well as the legacy ``np.random.RandomState`` as a seed. The ``axis`` parameter was added to `scipy.stats.rankdata`. This allows slices of an array along the given axis to be ranked independently. The ``axis`` parameter was added to `scipy.stats.f_oneway`, allowing it to compute multiple one-way ANOVA tests for data stored in n-dimensional arrays. The performance of ``f_oneway`` was also improved for some cases. The PDF and CDF methods for ``stats.geninvgauss`` are now significantly faster as the numerical integration to calculate the CDF uses a Cython based ``LowLevelCallable``. Moments of the normal distribution (`scipy.stats.norm`) are now calculated using analytical formulas instead of numerical integration for greater speed and accuracy Moments and entropy trapezoidal distribution (`scipy.stats.trapz`) are now calculated using analytical formulas instead of numerical integration for greater speed and accuracy Methods of the truncated normal distribution (`scipy.stats.truncnorm`), especially ``_rvs``, are significantly faster after a complete rewrite. The `fit` method of the Laplace distribution, `scipy.stats.laplace`, now uses the analytical formulas for the maximum likelihood estimates of the parameters. Generation of random variates is now thread safe for all SciPy distributions. 3rd-party distributions may need to modify the signature of the ``_rvs()`` method to conform to ``_rvs(self, ..., size=None, random_state=None)``. (A one-time VisibleDeprecationWarning is emitted when using non-conformant distributions.) The Kolmogorov-Smirnov two-sided test statistic distribution (`scipy.stats.kstwo`) was added. Calculates the distribution of the K-S two-sided statistic ``D_n`` for a sample of size n, using a mixture of exact and asymptotic algorithms. The new function ``median_abs_deviation`` replaces the deprecated ``median_absolute_deviation``. The ``wilcoxon`` function now computes the p-value for Wilcoxon's signed rank test using the exact distribution for inputs up to length 25. The function has a new ``mode`` parameter to specify how the p-value is to be computed. The default is ``"auto"``, which uses the exact distribution for inputs up to length 25 and the normal approximation for larger inputs. Added a new Cython-based implementation to evaluate guassian kernel estimates, which should improve the performance of ``gaussian_kde`` The ``winsorize`` function now has a ``nan_policy`` argument for refined handling of ``nan`` input values. The ``binned_statistic_dd`` function with ``statistic="std"`` performance was improved by ~4x. ``scipy.stats.kstest(rvs, cdf,...)`` now handles both one-sample and two-sample testing. The one-sample variation uses `scipy.stats.ksone` (or `scipy.stats.kstwo` with back off to `scipy.stats.kstwobign`) to calculate the p-value. The two-sample variation, invoked if ``cdf`` is array_like, uses an algorithm described by Hodges to compute the probability directly, only backing off to `scipy.stats.kstwo` in case of overflow. The result in both cases is more accurate p-values, especially for two-sample testing with smaller (or quite different) sizes. `scipy.stats.maxwell` performance improvements include a 20 % speed up for `fit()`` and 5 % for ``pdf()`` `scipy.stats.shapiro` and `scipy.stats.jarque_bera` now return a named tuple for greater consistency with other ``stats`` functions Deprecated features ============= `scipy` deprecations ---------------------- `scipy.special` changes -------------------------- The ``bdtr``, ``bdtrc``, and ``bdtri`` functions are deprecating non-negative non-integral ``n`` arguments. `scipy.stats` changes ----------------------- The function ``median_absolute_deviation`` is deprecated. Use ``median_abs_deviation`` instead. The use of the string ``"raw"`` with the ``scale`` parameter of ``iqr`` is deprecated. Use ``scale=1`` instead. Backwards incompatible changes ====================== `scipy.interpolate` c