NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #106 most downloaded on PyPI
Fundamental algorithms for scientific computing in Python
Last release 1 months ago
21 Aug 2026
Ships fairly regularly
a new release about every 6 weeks
Nearly every release is documented
notes for 55 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
16 years old
108 releases · first in 2010
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
Note: SciPy 1.11.0 is not released yet!
SciPy 1.11.0 is the culmination of 6 months of hard work. It contains
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.11.x branch, and on adding new features on the main branch.
This release requires Python 3.9+ and NumPy 1.21.6 or greater.
For running on PyPy, PyPy3 6.0+ is required.
scipy.sparse array API improvements, including sparse.sparray, a new
public base class distinct from the older sparse.spmatrix class,
proper 64-bit index support, and numerous deprecations paving the way to a
modern sparse array experience.scipy.stats added tools for survival analysis, multiple hypothesis testing,
sensitivity analysis, and working with censored data.det and lu now accept nD-arrays.axes argument was added broadly to ndimage functions, facilitating
analysis of stacked image data.scipy.integrate improvementsscipy.integrate.qmc_quad for quasi-Monte Carlo integration.scipy.integrate.simpson now calculates
a parabolic segment over the last three points which gives improved
accuracy over the previous implementation.scipy.cluster improvementsdisjoint_set has a new method subset_size for providing the size
of a particular subset.scipy.constants improvementsquetta, ronna, ronto, and quecto SI prefixes were added.scipy.linalg improvementsscipy.linalg.det is improved and now accepts nD-arrays.scipy.linalg.lu is improved and now accepts nD-arrays. With the new
p_indices switch the output permutation argument can be 1D (n,)
permutation index instead of the full (n, n) array.scipy.ndimage improvementsaxes argument was added to rank_filter, percentile_filter,
median_filter, uniform_filter, minimum_filter,
maximum_filter, and gaussian_filter, which can be useful for
processing stacks of image data.scipy.optimize improvementsscipy.optimize.linprog now passes unrecognized options directly to HiGHS.scipy.optimize.root_scalar now uses Newton's method to be used without
providing fprime and the secant method to be used without a second
guess.scipy.optimize.lsq_linear now accepts bounds arguments of type
scipy.optimize.Bounds.scipy.optimize.minimize method='cobyla' now supports simple bound
constraints.scipy.optimize.minimize: If the provided callback callable accepts
a single keyword argument, intermediate_result, scipy.optimize.minimize
now passes both the current solution and the optimal value of the objective
function to the callback as an instance of scipy.optimize.OptimizeResult.
It also allows the user to terminate optimization by raising a
StopIteration exception from the callback function.
scipy.optimize.minimize will return normally, and the latest solution
information is provided in the result object.scipy.optimize.curve_fit now supports an optional nan_policy argument.scipy.optimize.shgo now has parallelization with the workers argument,
symmetry arguments that can improve performance, class-based design to
improve usability, and generally improved performance.scipy.signal improvementsistft has an improved warning message when the NOLA condition fails.scipy.sparse improvementsscipy.sparse.sparray was introduced, allowing further
extension of the sparse array API (such as the support for 1-dimensional
sparse arrays) without breaking backwards compatibility.
isinstance(x, scipy.sparse.sparray) to select the new sparse array classes,
while isinstance(x, scipy.sparse.spmatrix) selects only the old sparse
matrix classes.scipy.sparse.isspmatrix now only returns True for the sparse matrices instances.
scipy.sparse.issparse now has to be used instead to check for instances of sparse
arrays or instances of sparse matrices.argmin and argmax methods now return the correct result when explicit
zeros are present.scipy.sparse.linalg improvementsLinearOperator by a number now returns a
_ScaledLinearOperatorLinearOperator now supports right multiplication by arrayslobpcg should be more efficient following removal of an extraneous
QR decomposition.scipy.spatial improvementsscipy.special improvementsfactorial, factorial2 and factorialk
were made consistent in their behavior (in terms of dimensionality,
errors etc.). Additionally, factorial2 can now handle arrays with
exact=True, and factorialk can handle arrays.scipy.stats improvementsscipy.stats.sobol_indices, a method to compute Sobol' sensitivity indices.scipy.stats.dunnett, which performs Dunnett's test of the means of multiple
experimental groups against the mean of a control group.scipy.stats.ecdf for computing the empirical CDF and complementary
CDF (survival function / SF) from uncensored or right-censored data. This
function is also useful for survival analysis / Kaplan-Meier estimation.scipy.stats.logrank to compare survival functions underlying samples.scipy.stats.false_discovery_control for adjusting p-values to control the
false discovery rate of multiple hypothesis tests using the
Benjamini-Hochberg or Benjamini-Yekutieli procedures.scipy.stats.CensoredData to represent censored data. It can be used as
input to the fit method of univariate distributions and to the new
ecdf function.method='Filliben' of
scipy.stats.goodness_of_fit.scipy.stats.ttest_ind has a new method, confidence_interval for
computing a confidence interval of the difference between means.scipy.stats.MonteCarloMethod, scipy.stats.PermutationMethod, and
scipy.stats.BootstrapMethod are new classes to configure resampling and/or
Monte Carlo versions of hypothesis tests. They can currently be used with
scipy.stats.pearsonr.Added the von-Mises Fisher distribution as scipy.stats.vonmises_fisher.
This distribution is the most common analogue of the normal distribution
on the unit sphere.
Added the relativistic Breit-Wigner distribution as
scipy.stats.rel_breitwigner.
It is used in high energy physics to model resonances.
Added the Dirichlet multinomial distribution as
scipy.stats.dirichlet_multinomial.
Improved the speed and precision of several univariate statistical distributions.
scipy.stats.anglit sfscipy.stats.beta entropyscipy.stats.betaprime cdf, sf, ppfscipy.stats.chi entropyscipy.stats.chi2 entropyscipy.stats.dgamma entropy, cdf, sf, ppf, and isfscipy.stats.dweibull entropy, sf, and isfscipy.stats.exponweib sf and isfscipy.stats.f entropyscipy.stats.foldcauchy sfscipy.stats.foldnorm cdf and sfscipy.stats.gamma entropyscipy.stats.genexpon ppf, isf, rvsscipy.stats.gengamma entropyscipy.stats.geom entropyscipy.stats.genlogistic entropy, logcdf, sf, ppf,
and isfscipy.stats.genhyperbolic cdf and sfscipy.stats.gibrat sf and isfscipy.stats.gompertz entropy, sf. and isfscipy.stats.halflogistic sf, and isfscipy.stats.halfcauchy sf and isfscipy.stats.halfnorm cdf, sf, and isfscipy.stats.invgamma entropyscipy.stats.invgauss entropyscipy.stats.johnsonsb pdf, cdf, sf, ppf, and isfscipy.stats.johnsonsu pdf, sf, isf, and statsscipy.stats.lognorm fitscipy.stats.loguniform entropy, logpdf, pdf, cdf, ppf,
and statsscipy.stats.maxwell sf and isfscipy.stats.nakagami entropyscipy.stats.powerlaw sfscipy.stats.powerlognorm logpdf, logsf, sf, and isfscipy.stats.powernorm sf and isfscipy.stats.t entropy, logpdf, and pdfscipy.stats.truncexpon sf, and isfscipy.stats.truncnorm entropyscipy.stats.truncpareto fitscipy.stats.vonmises fitscipy.stats.multivariate_t now has cdf and entropy methods.
scipy.stats.multivariate_normal, scipy.stats.matrix_normal, and
scipy.stats.invwishart now have an entropy method.
scipy.stats.monte_carlo_test now supports multi-sample statistics.scipy.stats.bootstrap can now produce one-sided confidence intervals.scipy.stats.rankdata performance was improved for method=ordinal and
method=dense.scipy.stats.moment now supports non-central moment calculation.scipy.stats.anderson now supports the weibull_min distribution.scipy.stats.sem and scipy.stats.iqr now support axis, nan_policy,
and masked array input.asfptype, getrow,
getcol, get_shape, getmaxprint, set_shape,
getnnz, and getformat. Additionally, the .A and .H
attributes were deprecated. Sparse matrix types are not affected.scipy.linalg functions tri, triu & tril are deprecated and
will be removed in SciPy 1.13. Users are recommended to use the NumPy
versions of these functions with identical names.scipy.signal functions bspline, quadratic & cubic are
deprecated and will be removed in SciPy 1.13. Users are recommended to use
scipy.interpolate.BSpline instead.even keyword of scipy.integrate.simpson is deprecated and will be
removed in SciPy 1.13.0. Users should leave this as the default as this
gives improved accuracy compared to the other methods.exact=True when passing integers in a float array to factorial
is deprecated and will be removed in SciPy 1.13.0.scipy.signal.medfilt and
scipy.signal.order_filterscipy.signal.{lsim2, impulse2, step2} had long been
deprecated in documentation only. They now raise a DeprecationWarning and
will be removed in SciPy 1.13.0.scipy.window has been soft
deprecated since SciPy 1.1.0. They now raise a DeprecationWarning and
will be removed in SciPy 1.13.0. Users should instead import them from
scipy.signal.window or use the convenience function
scipy.signal.get_window.legacy keyword of scipy.special.comb has changed
from True to False, as announced since its introduction.There is an ongoing effort to follow through on long-standing deprecations. The following previously deprecated features are affected:
n keyword has been removed from scipy.stats.moment.alpha keyword has been removed from scipy.stats.interval.gilbrat distribution has been removed (use
scipy.stats.gibrat).kulsinski distance metric has been
removed (use scipy.spatial.distance.kulczynski1).vertices keyword of scipy.spatial.Delauney.qhull has been removed
(use simplices).residual property of scipy.sparse.csgraph.maximum_flow has been
removed (use flow).extradoc keyword of scipy.stats.rv_continuous,
scipy.stats.rv_discrete and scipy.stats.rv_sample has been removed.sym_pos keyword of scipy.linalg.solve has been removed.scipy.optimize.minimize function now raises an error for x0 with
x0.ndim > 1.scipy.stats.mode, the default value of keepdims is now False,
and support for non-numeric input has been removed.scipy.signal.lsim does not support non-uniform time steps
anymore.A total of 134 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.
One column per quarter.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
Note: SciPy 1.11.0 is not released yet!
SciPy 1.11.0 is the culmination of 6 months of hard work. It contains
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.11.x branch, and on adding new features on the main branch.
This release requires Python 3.9+ and NumPy 1.21.6 or greater.
For running on PyPy, PyPy3 6.0+ is required.
scipy.sparse array API improvements, including a new public base
class distinct from the older matrix class, proper 64-bit index support,
and numerous deprecations paving the way to a modern sparse array experience.det and lu now accept nD-arrays.axes argument was added broadly to ndimage functions, facilitating
analysis of stacked image data.scipy.integrate improvementsscipy.integrate.qmc_quad for quasi-Monte Carlo integration.scipy.integrate.simpson now calculates
a parabolic segment over the last three points which gives improved
accuracy over the previous implementation.scipy.cluster improvementsdisjoint_set has a new method subset_size for providing the size
of a particular subset.scipy.constants improvementsquetta, ronna, ronto, and quecto SI prefixes were added.scipy.linalg improvementsscipy.linalg.det is improved and now accepts nD-arrays.scipy.linalg.lu is improved and now accepts nD-arrays. With the new
p_indices switch the output permutation argument can be 1D (n,)
permutation index instead of the full (n, n) array.scipy.ndimage improvementsaxes argument was added to rank_filter, percentile_filter,
median_filter, uniform_filter, minimum_filter,
maximum_filter, and gaussian_filter, which can be useful for
processing stacks of image data.scipy.optimize improvementsscipy.optimize.linprog now passes unrecognized options directly to HiGHS.scipy.optimize.root_scalar now uses Newton's method to be used without
providing fprime and the secant method to be used without a second
guess.scipy.optimize.lsq_linear now accepts bounds arguments of type
scipy.optimize.Bounds.scipy.optimize.minimize method='cobyla' now supports simple bound
constraints.scipy.optimize.minimize: If the provided callback callable accepts
a single keyword argument, intermediate_result, scipy.optimize.minimize
now passes both the current solution and the optimal value of the objective
function to the callback as an instance of scipy.optimize.OptimizeResult.
It also allows the user to terminate optimization by raising a
StopIteration exception from the callback function.
scipy.optimize.minimize will return normally, and the latest solution
information is provided in the result object.scipy.optimize.curve_fit now supports an optional nan_policy argument.scipy.optimize.shgo now has parallelization with the workers argument,
symmetry arguments that can improve performance, class-based design to
improve usability, and generally improved performance.scipy.signal improvementsistft has an improved warning message when the NOLA condition fails.scipy.sparse improvementsscipy.sparse array (not matrix) classes now return a sparse array instead
of a dense array when divided by a dense array.scipy.sparse.sparray was introduced, allowing
isinstance(x, scipy.sparse.sparray) to select the new sparse array classes,
while isinstance(x, scipy.sparse.spmatrix) selects only the old sparse
matrix types.scipy.sparse.isspmatrix() was updated to return True for
only the sparse matrix types. If you want to check for either sparse arrays
or sparse matrices, use scipy.sparse.issparse() instead. (Previously,
these had identical behavior.)scipy.sparse.diags_array function was added, which behaves like the
existing scipy.sparse.diags function except that it returns a sparse
array instead of a sparse matrix.argmin and argmax methods now return the correct result when no
implicit zeros are present.scipy.sparse.linalg improvementsLinearOperator by a number now returns a
_ScaledLinearOperatorLinearOperator now supports right multiplication by arrayslobpcg should be more efficient following removal of an extraneous
QR decomposition.scipy.spatial improvementsscipy.special improvementsfactorial, factorial2 and factorialk
were made consistent in their behavior (in terms of dimensionality,
errors etc.). Additionally, factorial2 can now handle arrays with
exact=True, and factorialk can handle arrays.scipy.stats improvementsscipy.stats.sobol_indices, a method to compute Sobol' sensitivity indices.scipy.stats.dunnett, which performs Dunnett's test of the means of multiple
experimental groups against the mean of a control group.scipy.stats.ecdf for computing the empirical CDF and complementary
CDF (survival function / SF) from uncensored or right-censored data. This
function is also useful for survival analysis / Kaplain-Meier estimation.scipy.stats.logrank to compare survival functions underlying samples.scipy.stats.false_discovery_control for adjusting p-values to control the
false discovery rate of multiple hypothesis tests using the
Benjamini-Hochberg or Benjamini-Yekutieli procedures.scipy.stats.CensoredData to represent censored data. It can be used as
input to the fit method of univariate distributions and to the new
ecdf function.method='Filliben' of
scipy.stats.goodness_of_fit.scipy.stats.ttest_ind has a new method, confidence_interval for
computing confidence intervals.scipy.stats.MonteCarloMethod, scipy.stats.PermutationMethod, and
scipy.stats.BootstrapMethod are new classes to configure resampling and/or
Monte Carlo versions of hypothesis tests. They can currently be used with
scipy.stats.pearsonr.Added the von-Mises Fisher distribution as scipy.stats.vonmises_fisher.
This distribution is the most common analogue of the normal distribution
on the unit sphere.
Added the relativistic Breit-Wigner distribution as
scipy.stats.rel_breitwigner.
It is used in high energy physics to model resonances.
Added the Dirichlet multinomial distribution as
scipy.stats.dirichlet_multinomial.
Improved the speed and precision of several univariate statistical distributions.
scipy.stats.anglit sfscipy.stats.beta entropyscipy.stats.betaprime cdf, sf, ppfscipy.stats.chi entropyscipy.stats.chi2 entropyscipy.stats.dgamma entropy, cdf, sf, ppf, and isfscipy.stats.dweibull entropy, sf, and isfscipy.stats.exponweib sf and isfscipy.stats.f entropyscipy.stats.foldcauchy sfscipy.stats.foldnorm cdf and sfscipy.stats.gamma entropyscipy.stats.genexpon ppf, isf, rvsscipy.stats.gengamma entropyscipy.stats.geom entropyscipy.stats.genlogistic entropy, logcdf, sf, ppf,
and isfscipy.stats.genhyperbolic cdf and sfscipy.stats.gibrat sf and isfscipy.stats.gompertz entropy, sf. and isfscipy.stats.halflogistic sf, and isfscipy.stats.halfcauchy sf and isfscipy.stats.halfnorm cdf, sf, and isfscipy.stats.invgamma entropyscipy.stats.invgauss entropyscipy.stats.johnsonsb pdf, cdf, sf, ppf, and isfscipy.stats.johnsonsu pdf, sf, isf, and statsscipy.stats.lognorm fitscipy.stats.loguniform entropy, logpdf, pdf, cdf, ppf,
and statsscipy.stats.maxwell sf and isfscipy.stats.nakagami entropyscipy.stats.powerlaw sfscipy.stats.powerlognorm logpdf, logsf, sf, and isfscipy.stats.powernorm sf and isfscipy.stats.t entropy, logpdf, and pdfscipy.stats.truncexpon sf, and isfscipy.stats.truncnorm entropyscipy.stats.truncpareto fitscipy.stats.vonmises fitscipy.stats.multivariate_t now has cdf and entropy methods.
scipy.stats.multivariate_normal, scipy.stats.matrix_normal, and
scipy.stats.invwishart now have an entropy method.
scipy.stats.monte_carlo_test now supports multi-sample statistics.scipy.stats.bootstrap can now produce one-sided confidence intervals.scipy.stats.rankdata performance was improved for method=ordinal and
method=dense.scipy.stats.moment now supports non-central moment calculation.scipy.stats.anderson now supports the weibull_min distribution.scipy.stats.sem and scipy.stats.iqr now support axis, nan_policy,
and masked array input.asfptype, getrow,
getcol, get_shape, getmaxprint, set_shape,
getnnz, and getformat. Additionally, the .A and .H
attributes were deprecated. Sparse matrix types are not affected.scipy.linalg functions tri, triu & tril are deprecated and
will be removed in SciPy 1.13. Users are recommended to use the NumPy
versions of these functions with identical names.scipy.signal functions bspline, quadratic & cubic are
deprecated and will be removed in SciPy 1.13. Users are recommended to use
scipy.interpolate.BSpline instead.even keyword of scipy.integrate.simpson is deprecated and will be
removed in SciPy 1.13.0. Users should leave this as the default as this
gives improved accuracy compared to the other methods.exact=True when passing integers in a float array to factorial
is deprecated and will be removed in SciPy 1.13.0.scipy.signal.medfilt and
scipy.signal.order_filterscipy.signal.{lsim2, impulse2, step2} had long been
deprecated in documentation only. They now raise a DeprecationWarning and
will be removed in SciPy 1.13.0.scipy.window has been soft
deprecated since SciPy 1.1.0. They now raise a DeprecationWarning and
will be removed in SciPy 1.13.0. Users should instead import them from
scipy.signal.window or use the convenience function
scipy.signal.get_window.legacy keyword of scipy.special.comb has changed
from True to False, as announced since its introduction.There is an ongoing effort to follow through on long-standing deprecations. The following previously deprecated features are affected:
n keyword has been removed from scipy.stats.moment.alpha keyword has been removed from scipy.stats.interval.gilbrat distribution has been removed (use
scipy.stats.gibrat).kulsinski distance metric has been
removed (use scipy.spatial.distance.kulczynski1).vertices keyword of scipy.spatial.Delauney.qhull has been removed
(use simplices).residual property of scipy.sparse.csgraph.maximum_flow has been
removed (use flow).extradoc keyword of scipy.stats.rv_continuous,
scipy.stats.rv_discrete and scipy.stats.rv_sample has been removed.sym_pos keyword of scipy.linalg.solve has been removed.scipy.optimize.minimize function now raises an error for x0 with
x0.ndim > 1.scipy.stats.mode, the default value of keepdims is now False,
and support for non-numeric input has been removed.scipy.signal.lsim does not support non-uniform time steps
anymore.A total of 131 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.
SciPy 1.10.1 is a bug-fix release with no new features compared to 1.10.0.
SciPy 1.10.1 is a bug-fix release with no new features
compared to 1.10.0.
A total of 21 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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
SciPy 1.10.0 is the culmination of 6 months of hard work. It contains
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.10.x branch, and on adding new features on the main branch.
This release requires Python 3.8+ and NumPy 1.19.5 or greater.
For running on PyPy, PyPy3 6.0+ is required.
scipy.datasets) has been added, and is
now preferred over usage of scipy.misc for dataset retrieval.scipy.interpolate.make_smoothing_spline function was added. This
function constructs a smoothing cubic spline from noisy data, using the
generalized cross-validation (GCV) criterion to find the tradeoff between
smoothness and proximity to data points.scipy.stats has three new distributions, two new hypothesis tests, three
new sample statistics, a class for greater control over calculations
involving covariance matrices, and many other enhancements.scipy.datasets introductionA new dedicated datasets submodule has been added. The submodules
is meant for datasets that are relevant to other SciPy submodules ands
content (tutorials, examples, tests), as well as contain a curated
set of datasets that are of wider interest. As of this release, all
the datasets from scipy.misc have been added to scipy.datasets
(and deprecated in scipy.misc).
The submodule is based on Pooch (a new optional dependency for SciPy), a Python package to simplify fetching data files. This move will, in a subsequent release, facilitate SciPy to trim down the sdist/wheel sizes, by decoupling the data files and moving them out of the SciPy repository, hosting them externally and downloading them when requested. After downloading the datasets once, the files are cached to avoid network dependence and repeated usage.
Added datasets from scipy.misc: scipy.datasets.face,
scipy.datasets.ascent, scipy.datasets.electrocardiogram
Added download and caching functionality:
scipy.datasets.download_all: a function to download all the scipy.datasets
associated files at once.scipy.datasets.clear_cache: a simple utility function to clear cached dataset
files from the file system.scipy/datasets/_download_all.py can be run as a standalone script for
packaging purposes to avoid any external dependency at build or test time.
This can be used by SciPy packagers (e.g., for Linux distros) which may
have to adhere to rules that forbid downloading sources from external
repositories at package build time.scipy.integrate improvementscomplex_func to scipy.integrate.quad, which can be set
True to integrate a complex integrand.scipy.interpolate improvementsscipy.interpolate.interpn now supports tensor-product interpolation methods
(slinear, cubic, quintic and pchip)slinear, cubic, quintic and
pchip) in scipy.interpolate.interpn and
scipy.interpolate.RegularGridInterpolator now allow values with trailing
dimensions.scipy.interpolate.RegularGridInterpolator has a new fast path for
method="linear" with 2D data, and RegularGridInterpolator is now
easier to subclassscipy.interpolate.interp1d now can take a single value for non-spline
methods.extrapolate argument is available to scipy.interpolate.BSpline.design_matrix,
allowing extrapolation based on the first and last intervals.scipy.interpolate.make_smoothing_spline has been added. It is an
implementation of the generalized cross-validation spline smoothing
algorithm. The lam=None (default) mode of this function is a clean-room
reimplementation of the classic gcvspl.f Fortran algorithm for
constructing GCV splines.method="pchip" mode was aded to
scipy.interpolate.RegularGridInterpolator. This mode constructs an
interpolator using tensor products of C1-continuous monotone splines
(essentially, a scipy.interpolate.PchipInterpolator instance per
dimension).scipy.sparse.linalg improvementsThe spectral 2-norm is now available in scipy.sparse.linalg.norm.
The performance of scipy.sparse.linalg.norm for the default case (Frobenius
norm) has been improved.
LAPACK wrappers were added for trexc and trsen.
The scipy.sparse.linalg.lobpcg algorithm was rewritten, yielding
the following improvements:
LinearOperator format input and thus allow
a simple function handle of a callable object as an input,scipy.linalg improvementsscipy.linalg.lu_factor now accepts rectangular arrays instead of being restricted
to square arrays.scipy.ndimage improvementsscipy.ndimage.value_indices function provides a time-efficient method to
search for the locations of individual values with an array of image data.radius argument is supported by scipy.ndimage.gaussian_filter1d and
scipy.ndimage.gaussian_filter for adjusting the kernel size of the filter.scipy.optimize improvementsscipy.optimize.brute now coerces non-iterable/single-value args into a
tuple.scipy.optimize.least_squares and scipy.optimize.curve_fit now accept
scipy.optimize.Bounds for bounds constraints.scipy.optimize.milp.scipy.optimize.OptimizeResult objects.parallel, threads, mip_rel_gap) can now
be passed to scipy.optimize.linprog with method='highs'.scipy.signal improvementsscipy.signal.windows.lanczos was added to compute a
Lanczos window, also known as a sinc window.scipy.sparse.csgraph improvementsscipy.sparse.csgraph.dijkstra has been improved, and
star graphs in particular see a marked performance improvementscipy.special improvementsscipy.special.powm1, a ufunc with signature
powm1(x, y), computes x**y - 1. The function avoids the loss of
precision that can result when y is close to 0 or when x is close to
1.scipy.special.erfinv is now more accurate as it leverages the Boost equivalent under
the hood.scipy.stats improvementsAdded scipy.stats.goodness_of_fit, a generalized goodness-of-fit test for
use with any univariate distribution, any combination of known and unknown
parameters, and several choices of test statistic (Kolmogorov-Smirnov,
Cramer-von Mises, and Anderson-Darling).
Improved scipy.stats.bootstrap: Default method 'BCa' now supports
multi-sample statistics. Also, the bootstrap distribution is returned in the
result object, and the result object can be passed into the function as
parameter bootstrap_result to add additional resamples or change the
confidence interval level and type.
Added maximum spacing estimation to scipy.stats.fit.
Added the Poisson means test ("E-test") as scipy.stats.poisson_means_test.
Added new sample statistics.
scipy.stats.contingency.odds_ratio to compute both the conditional
and unconditional odds ratios and corresponding confidence intervals for
2x2 contingency tables.scipy.stats.directional_stats to compute sample statistics of
n-dimensional directional data.scipy.stats.expectile, which generalizes the expected value in the
same way as quantiles are a generalization of the median.Added new statistical distributions.
scipy.stats.uniform_direction, a multivariate distribution to
sample uniformly from the surface of a hypersphere.scipy.stats.random_table, a multivariate distribution to sample
uniformly from m x n contingency tables with provided marginals.scipy.stats.truncpareto, the truncated Pareto distribution.Improved the fit method of several distributions.
scipy.stats.skewnorm and scipy.stats.weibull_min now use an analytical
solution when method='mm', which also serves a starting guess to
improve the performance of method='mle'.scipy.stats.gumbel_r and scipy.stats.gumbel_l: analytical maximum
likelihood estimates have been extended to the cases in which location or
scale are fixed by the user.scipy.stats.powerlaw.Improved random variate sampling of several distributions.
scipy.stats.matrix_normal,
scipy.stats.ortho_group, scipy.stats.special_ortho_group, and
scipy.stats.unitary_group is faster.rvs method of scipy.stats.vonmises now wraps to the interval
[-np.pi, np.pi].scipy.stats.loggamma rvs method for small
values of the shape parameter.Improved the speed and/or accuracy of functions of several statistical distributions.
scipy.stats.Covariance for better speed, accuracy, and user control
in multivariate normal calculations.scipy.stats.skewnorm methods cdf, sf, ppf, and isf
methods now use the implementations from Boost, improving speed while
maintaining accuracy. The calculation of higher-order moments is also
faster and more accurate.scipy.stats.invgauss methods ppf and isf methods now use the
implementations from Boost, improving speed and accuracy.scipy.stats.invweibull methods sf and isf are more accurate for
small probability masses.scipy.stats.nct and scipy.stats.ncx2 now rely on the implementations
from Boost, improving speed and accuracy.logpdf method of scipy.stats.vonmises for reliability
in extreme tails.isf method of scipy.stats.levy for speed and
accuracy.scipy.stats.studentized_range for large df
by adding an infinite degree-of-freedom approximation.lower_limit to scipy.stats.multivariate_normal,
allowing the user to change the integration limit from -inf to a desired
value.entropy of scipy.stats.vonmises for large
concentration values.Enhanced scipy.stats.gaussian_kde.
scipy.stats.gaussian_kde.marginal, which returns the desired
marginal distribution of the original kernel density estimate distribution.cdf method of scipy.stats.gaussian_kde now accepts a
lower_limit parameter for integrating the PDF over a rectangular region.scipy.stats.gaussian_kde.logpdf to Cython,
improving speed.pdf method of
scipy.stats.gaussian_kde for improved multithreading performance.Enhanced the result objects returned by many scipy.stats functions
confidence_interval method to the result object returned by
scipy.stats.ttest_1samp and scipy.stats.ttest_rel.scipy.stats functions combine_pvalues, fisher_exact,
chi2_contingency, median_test and mood now return
bunch objects rather than plain tuples, allowing attributes to be
accessed by name.multiscale_graphcorr,
anderson_ksamp, binomtest, crosstab, pointbiserialr,
spearmanr, kendalltau, and weightedtau have been renamed to
statistic and pvalue for consistency throughout scipy.stats.
Old attribute names are still allowed for backward compatibility.scipy.stats.anderson now returns the parameters of the fitted
distribution in a scipy.stats._result_classes.FitResult object.plot method of scipy.stats._result_classes.FitResult now accepts
a plot_type parameter; the options are 'hist' (histogram, default),
'qq' (Q-Q plot), 'pp' (P-P plot), and 'cdf' (empirical CDF
plot).scipy.stats.kstest) now return the
location (argmax) at which the statistic is calculated and the variant
of the statistic used.Improved the performance of several scipy.stats functions.
scipy.stats.cramervonmises_2samp and
scipy.stats.ks_2samp with method='exact'.scipy.stats.siegelslopes.scipy.stats.mstats.hdquantile_sd.scipy.stats.binned_statistic_dd for several
NumPy statistics, and binned statistics methods now support complex data.Added the scramble optional argument to scipy.stats.qmc.LatinHypercube.
It replaces centered, which is now deprecated.
Added a parameter optimization to all scipy.stats.qmc.QMCEngine
subclasses to improve characteristics of the quasi-random variates.
Added tie correction to scipy.stats.mood.
Added tutorials for resampling methods in scipy.stats.
scipy.stats.bootstrap, scipy.stats.permutation_test, and
scipy.stats.monte_carlo_test now automatically detect whether the provided
statistic is vectorized, so passing the vectorized argument
explicitly is no longer required to take advantage of vectorized statistics.
Improved the speed of scipy.stats.permutation_test for permutation types
'samples' and 'pairings'.
Added axis, nan_policy, and masked array support to
scipy.stats.jarque_bera.
Added the nan_policy optional argument to scipy.stats.rankdata.
scipy.misc module and all the methods in misc are deprecated in v1.10
and will be completely removed in SciPy v2.0.0. Users are suggested to
utilize the scipy.datasets module instead for the dataset methods.scipy.stats.qmc.LatinHypercube parameter centered has been deprecated.
It is replaced by the scramble argument for more consistency with other
QMC engines.scipy.interpolate.interp2d class has been deprecated. The docstring of the
deprecated routine lists recommended replacements.There is an ongoing effort to follow through on long-standing deprecations.
The following previously deprecated features are affected:
cond & rcond kwargs in linalg.pinvscipy.linalg.blas.{clapack, flapack}scipy.stats.NumericalInverseHermite and removed tol & max_intervals kwargs from scipy.stats.sampling.NumericalInverseHermitelocal_search_options kwarg frrom scipy.optimize.dual_annealing.scipy.stats.bootstrap, scipy.stats.permutation_test, and
scipy.stats.monte_carlo_test now automatically detect whether the provided
statistic is vectorized by looking for an axis parameter in the
signature of statistic. If an axis parameter is present in
statistic but should not be relied on for vectorized calls, users must
pass option vectorized==False explicitly.scipy.stats.multivariate_normal will now raise a ValueError when the
covariance matrix is not positive semidefinite, regardless of which method
is called.A total of 184 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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
Note: SciPy 1.10.0 is not released yet!
SciPy 1.10.0 is the culmination of 6 months of hard work. It contains
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.10.x branch, and on adding new features on the main branch.
This release requires Python 3.8+ and NumPy 1.19.5 or greater.
For running on PyPy, PyPy3 6.0+ is required.
scipy.datasets) has been added, and is
now preferred over usage of scipy.misc for dataset retrieval.scipy.interpolate.make_smoothing_spline function was added. This
function constructs a smoothing cubic spline from noisy data, using the
generalized cross-validation (GCV) criterion to find the tradeoff between
smoothness and proximity to data points.scipy.stats has three new distributions, two new hypothesis tests, three
new sample statistics, a class for greater control over calculations
involving covariance matrices, and many other enhancements.scipy.datasets introductionA new dedicated datasets submodule has been added. The submodules
is meant for datasets that are relevant to other SciPy submodules ands
content (tutorials, examples, tests), as well as contain a curated
set of datasets that are of wider interest. As of this release, all
the datasets from scipy.misc have been added to scipy.datasets
(and deprecated in scipy.misc).
The submodule is based on Pooch (a new optional dependency for SciPy), a Python package to simplify fetching data files. This move will, in a subsequent release, facilitate SciPy to trim down the sdist/wheel sizes, by decoupling the data files and moving them out of the SciPy repository, hosting them externally and downloading them when requested. After downloading the datasets once, the files are cached to avoid network dependence and repeated usage.
Added datasets from scipy.misc: scipy.datasets.face,
scipy.datasets.ascent, scipy.datasets.electrocardiogram
Added download and caching functionality:
scipy.datasets.download_all: a function to download all the scipy.datasets
associated files at once.scipy.datasets.clear_cache: a simple utility function to clear cached dataset
files from the file system.scipy/datasets/_download_all.py can be run as a standalone script for
packaging purposes to avoid any external dependency at build or test time.
This can be used by SciPy packagers (e.g., for Linux distros) which may
have to adhere to rules that forbid downloading sources from external
repositories at package build time.scipy.integrate improvementsscipy.integrate.qmc_quad, which performs quadrature using Quasi-Monte
Carlo points.complex_func to scipy.integrate.quad, which can be set
True to integrate a complex integrand.scipy.interpolate improvementsscipy.interpolate.interpn now supports tensor-product interpolation methods
(slinear, cubic, quintic and pchip)slinear, cubic, quintic and
pchip) in scipy.interpolate.interpn and
scipy.interpolate.RegularGridInterpolator now allow values with trailing
dimensions.scipy.interpolate.RegularGridInterpolator has a new fast path for
method="linear" with 2D data, and RegularGridInterpolator is now
easier to subclassscipy.interpolate.interp1d now can take a single value for non-spline
methods.extrapolate argument is available to scipy.interpolate.BSpline.design_matrix,
allowing extrapolation based on the first and last intervals.scipy.interpolate.make_smoothing_spline has been added. It is an
implementation of the generalized cross-validation spline smoothing
algorithm. The lam=None (default) mode of this function is a clean-room
reimplementation of the classic gcvspl.f Fortran algorithm for
constructing GCV splines.method="pchip" mode was aded to
scipy.interpolate.RegularGridInterpolator. This mode constructs an
interpolator using tensor products of C1-continuous monotone splines
(essentially, a scipy.interpolate.PchipInterpolator instance per
dimension).scipy.sparse.linalg improvementsThe spectral 2-norm is now available in scipy.sparse.linalg.norm.
The performance of scipy.sparse.linalg.norm for the default case (Frobenius
norm) has been improved.
LAPACK wrappers were added for trexc and trsen.
The scipy.sparse.linalg.lobpcg algorithm was rewritten, yielding
the following improvements:
LinearOperator format input and thus allow
a simple function handle of a callable object as an input,scipy.linalg improvementsscipy.linalg.lu_factor now accepts rectangular arrays instead of being restricted
to square arrays.scipy.ndimage improvementsscipy.ndimage.value_indices function provides a time-efficient method to
search for the locations of individual values with an array of image data.radius argument is supported by scipy.ndimage.gaussian_filter1d and
scipy.ndimage.gaussian_filter for adjusting the kernel size of the filter.scipy.optimize improvementsscipy.optimize.brute now coerces non-iterable/single-value args into a
tuple.scipy.optimize.least_squares and scipy.optimize.curve_fit now accept
scipy.optimize.Bounds for bounds constraints.scipy.optimize.milp.scipy.optimize.OptimizeResult objects.parallel, threads, mip_rel_gap) can now
be passed to scipy.optimize.linprog with method='highs'.scipy.signal improvementsscipy.signal.windows.lanczos was added to compute a
Lanczos window, also known as a sinc window.scipy.sparse.csgraph improvementsscipy.sparse.csgraph.dijkstra has been improved, and
star graphs in particular see a marked performance improvementscipy.special improvementsscipy.special.powm1, a ufunc with signature
powm1(x, y), computes x**y - 1. The function avoids the loss of
precision that can result when y is close to 0 or when x is close to
1.scipy.special.erfinv is now more accurate as it leverages the Boost equivalent under
the hood.scipy.stats improvementsAdded scipy.stats.goodness_of_fit, a generalized goodness-of-fit test for
use with any univariate distribution, any combination of known and unknown
parameters, and several choices of test statistic (Kolmogorov-Smirnov,
Cramer-von Mises, and Anderson-Darling).
Improved scipy.stats.bootstrap: Default method 'BCa' now supports
multi-sample statistics. Also, the bootstrap distribution is returned in the
result object, and the result object can be passed into the function as
parameter bootstrap_result to add additional resamples or change the
confidence interval level and type.
Added maximum spacing estimation to scipy.stats.fit.
Added the Poisson means test ("E-test") as scipy.stats.poisson_means_test.
Added new sample statistics.
scipy.stats.contingency.odds_ratio to compute both the conditional
and unconditional odds ratios and corresponding confidence intervals for
2x2 contingency tables.scipy.stats.directional_stats to compute sample statistics of
n-dimensional directional data.scipy.stats.expectile, which generalizes the expected value in the
same way as quantiles are a generalization of the median.Added new statistical distributions.
scipy.stats.uniform_direction, a multivariate distribution to
sample uniformly from the surface of a hypersphere.scipy.stats.random_table, a multivariate distribution to sample
uniformly from m x n contingency tables with provided marginals.scipy.stats.truncpareto, the truncated Pareto distribution.Improved the fit method of several distributions.
scipy.stats.skewnorm and scipy.stats.weibull_min now use an analytical
solution when method='mm', which also serves a starting guess to
improve the performance of method='mle'.scipy.stats.gumbel_r and scipy.stats.gumbel_l: analytical maximum
likelihood estimates have been extended to the cases in which location or
scale are fixed by the user.scipy.stats.powerlaw.Improved random variate sampling of several distributions.
scipy.stats.matrix_normal,
scipy.stats.ortho_group, scipy.stats.special_ortho_group, and
scipy.stats.unitary_group is faster.rvs method of scipy.stats.vonmises now wraps to the interval
[-np.pi, np.pi].scipy.stats.loggamma rvs method for small
values of the shape parameter.Improved the speed and/or accuracy of functions of several statistical distributions.
scipy.stats.Covariance for better speed, accuracy, and user control
in multivariate normal calculations.scipy.stats.skewnorm methods cdf, sf, ppf, and isf
methods now use the implementations from Boost, improving speed while
maintaining accuracy. The calculation of higher-order moments is also
faster and more accurate.scipy.stats.invgauss methods ppf and isf methods now use the
implementations from Boost, improving speed and accuracy.scipy.stats.invweibull methods sf and isf are more accurate for
small probability masses.scipy.stats.nct and scipy.stats.ncx2 now rely on the implementations
from Boost, improving speed and accuracy.logpdf method of scipy.stats.vonmises for reliability
in extreme tails.isf method of scipy.stats.levy for speed and
accuracy.scipy.stats.studentized_range for large df
by adding an infinite degree-of-freedom approximation.lower_limit to scipy.stats.multivariate_normal,
allowing the user to change the integration limit from -inf to a desired
value.entropy of scipy.stats.vonmises for large
concentration values.Enhanced scipy.stats.gaussian_kde.
scipy.stats.gaussian_kde.marginal, which returns the desired
marginal distribution of the original kernel density estimate distribution.cdf method of scipy.stats.gaussian_kde now accepts a
lower_limit parameter for integrating the PDF over a rectangular region.scipy.stats.gaussian_kde.logpdf to Cython,
improving speed.pdf method of
scipy.stats.gaussian_kde for improved multithreading performance.Enhanced the result objects returned by many scipy.stats functions
confidence_interval method to the result object returned by
scipy.stats.ttest_1samp and scipy.stats.ttest_rel.scipy.stats functions combine_pvalues, fisher_exact,
chi2_contingency, median_test and mood now return
bunch objects rather than plain tuples, allowing attributes to be
accessed by name.multiscale_graphcorr,
anderson_ksamp, binomtest, crosstab, pointbiserialr,
spearmanr, kendalltau, and weightedtau have been renamed to
statistic and pvalue for consistency throughout scipy.stats.
Old attribute names are still allowed for backward compatibility.scipy.stats.anderson now returns the parameters of the fitted
distribution in a scipy.stats._result_classes.FitResult object.plot method of scipy.stats._result_classes.FitResult now accepts
a plot_type parameter; the options are 'hist' (histogram, default),
'qq' (Q-Q plot), 'pp' (P-P plot), and 'cdf' (empirical CDF
plot).scipy.stats.kstest) now return the
location (argmax) at which the statistic is calculated and the variant
of the statistic used.Improved the performance of several scipy.stats functions.
scipy.stats.cramervonmises_2samp and
scipy.stats.ks_2samp with method='exact'.scipy.stats.siegelslopes.scipy.stats.mstats.hdquantile_sd.scipy.stats.binned_statistic_dd for several
NumPy statistics, and binned statistics methods now support complex data.Added the scramble optional argument to scipy.stats.qmc.LatinHypercube.
It replaces centered, which is now deprecated.
Added a parameter optimization to all scipy.stats.qmc.QMCEngine
subclasses to improve characteristics of the quasi-random variates.
Added tie correction to scipy.stats.mood.
Added tutorials for resampling methods in scipy.stats.
scipy.stats.bootstrap, scipy.stats.permutation_test, and
scipy.stats.monte_carlo_test now automatically detect whether the provided
statistic is vectorized, so passing the vectorized argument
explicitly is no longer required to take advantage of vectorized statistics.
Improved the speed of scipy.stats.permutation_test for permutation types
'samples' and 'pairings'.
Added axis, nan_policy, and masked array support to
scipy.stats.jarque_bera.
Added the nan_policy optional argument to scipy.stats.rankdata.
scipy.misc module and all the methods in misc are deprecated in v1.10
and will be completely removed in SciPy v2.0.0. Users are suggested to
utilize the scipy.datasets module instead for the dataset methods.scipy.stats.qmc.LatinHypercube parameter centered has been deprecated.
It is replaced by the scramble argument for more consistency with other
QMC engines.scipy.interpolate.interp2d class has been deprecated. The docstring of the
deprecated routine lists recommended replacements.There is an ongoing effort to follow through on long-standing deprecations.
The following previously deprecated features are affected:
cond & rcond kwargs in linalg.pinvscipy.linalg.blas.{clapack, flapack}scipy.stats.NumericalInverseHermite and removed tol & max_intervals kwargs from scipy.stats.sampling.NumericalInverseHermitelocal_search_options kwarg frrom scipy.optimize.dual_annealing.scipy.stats.bootstrap, scipy.stats.permutation_test, and
scipy.stats.monte_carlo_test now automatically detect whether the provided
statistic is vectorized by looking for an axis parameter in the
signature of statistic. If an axis parameter is present in
statistic but should not be relied on for vectorized calls, users must
pass option vectorized==False explicitly.scipy.stats.multivariate_normal will now raise a ValueError when the
covariance matrix is not positive semidefinite, regardless of which method
is called.A total of 182 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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
Note: SciPy 1.10.0 is not released yet!
SciPy 1.10.0 is the culmination of 6 months of hard work. It contains
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.10.x branch, and on adding new features on the main branch.
This release requires Python 3.8+ and NumPy 1.19.5 or greater.
For running on PyPy, PyPy3 6.0+ is required.
scipy.datasets) has been added, and is
now preferred over usage of scipy.misc for dataset retrieval.scipy.interpolate.make_smoothing_spline function was added. This
function constructs a smoothing cubic spline from noisy data, using the
generalized cross-validation (GCV) criterion to find the tradeoff between
smoothness and proximity to data points.scipy.stats has three new distributions, two new hypothesis tests, three
new sample statistics, a class for greater control over calculations
involving covariance matrices, and many other enhancements.scipy.datasets introductionA new dedicated datasets submodule has been added. The submodules
is meant for datasets that are relevant to other SciPy submodules ands
content (tutorials, examples, tests), as well as contain a curated
set of datasets that are of wider interest. As of this release, all
the datasets from scipy.misc have been added to scipy.datasets
(and deprecated in scipy.misc).
The submodule is based on Pooch (a new optional dependency for SciPy), a Python package to simplify fetching data files. This move will, in a subsequent release, facilitate SciPy to trim down the sdist/wheel sizes, by decoupling the data files and moving them out of the SciPy repository, hosting them externally and downloading them when requested. After downloading the datasets once, the files are cached to avoid network dependence and repeated usage.
Added datasets from scipy.misc: scipy.datasets.face,
scipy.datasets.ascent, scipy.datasets.electrocardiogram
Added download and caching functionality:
scipy.datasets.download_all: a function to download all the scipy.datasets
associated files at once.scipy.datasets.clear_cache: a simple utility function to clear cached dataset
files from the file system.scipy/datasets/_download_all.py can be run as a standalone script for
packaging purposes to avoid any external dependency at build or test time.
This can be used by SciPy packagers (e.g., for Linux distros) which may
have to adhere to rules that forbid downloading sources from external
repositories at package build time.scipy.integrate improvementsscipy.integrate.qmc_quad, which performs quadrature using Quasi-Monte
Carlo points.complex_func to scipy.integrate.quad, which can be set
True to integrate a complex integrand.scipy.interpolate improvementsscipy.interpolate.interpn now supports tensor-product interpolation methods
(slinear, cubic, quintic and pchip)slinear, cubic, quintic and
pchip) in scipy.interpolate.interpn and
scipy.interpolate.RegularGridInterpolator now allow values with trailing
dimensions.scipy.interpolate.RegularGridInterpolator has a new fast path for
method="linear" with 2D data, and RegularGridInterpolator is now
easier to subclassscipy.interpolate.interp1d now can take a single value for non-spline
methods.extrapolate argument is available to scipy.interpolate.BSpline.design_matrix,
allowing extrapolation based on the first and last intervals.scipy.interpolate.make_smoothing_spline has been added. It is an
implementation of the generalized cross-validation spline smoothing
algorithm. The lam=None (default) mode of this function is a clean-room
reimplementation of the classic gcvspl.f Fortran algorithm for
constructing GCV splines.method="pchip" mode was aded to
scipy.interpolate.RegularGridInterpolator. This mode constructs an
interpolator using tensor products of C1-continuous monotone splines
(essentially, a scipy.interpolate.PchipInterpolator instance per
dimension).scipy.sparse.linalg improvementsThe spectral 2-norm is now available in scipy.sparse.linalg.norm.
The performance of scipy.sparse.linalg.norm for the default case (Frobenius
norm) has been improved.
LAPACK wrappers were added for trexc and trsen.
The scipy.sparse.linalg.lobpcg algorithm was rewritten, yielding
the following improvements:
LinearOperator format input and thus allow
a simple function handle of a callable object as an input,scipy.linalg improvementsscipy.linalg.lu_factor now accepts rectangular arrays instead of being restricted
to square arrays.scipy.ndimage improvementsscipy.ndimage.value_indices function provides a time-efficient method to
search for the locations of individual values with an array of image data.radius argument is supported by scipy.ndimage.gaussian_filter1d and
scipy.ndimage.gaussian_filter for adjusting the kernel size of the filter.scipy.optimize improvementsscipy.optimize.brute now coerces non-iterable/single-value args into a
tuple.scipy.optimize.least_squares and scipy.optimize.curve_fit now accept
scipy.optimize.Bounds for bounds constraints.scipy.optimize.milp.scipy.optimize.OptimizeResult objects.parallel, threads, mip_rel_gap) can now
be passed to scipy.optimize.linprog with method='highs'.scipy.signal improvementsscipy.signal.windows.lanczos was added to compute a
Lanczos window, also known as a sinc window.scipy.sparse.csgraph improvementsscipy.sparse.csgraph.dijkstra has been improved, and
star graphs in particular see a marked performance improvementscipy.special improvementsscipy.special.powm1, a ufunc with signature
powm1(x, y), computes x**y - 1. The function avoids the loss of
precision that can result when y is close to 0 or when x is close to
1.scipy.special.erfinv is now more accurate as it leverages the Boost equivalent under
the hood.scipy.stats improvementsAdded scipy.stats.goodness_of_fit, a generalized goodness-of-fit test for
use with any univariate distribution, any combination of known and unknown
parameters, and several choices of test statistic (Kolmogorov-Smirnov,
Cramer-von Mises, and Anderson-Darling).
Improved scipy.stats.bootstrap: Default method 'BCa' now supports
multi-sample statistics. Also, the bootstrap distribution is returned in the
result object, and the result object can be passed into the function as
parameter bootstrap_result to add additional resamples or change the
confidence interval level and type.
Added maximum spacing estimation to scipy.stats.fit.
Added the Poisson means test ("E-test") as scipy.stats.poisson_means_test.
Added new sample statistics.
scipy.stats.contingency.odds_ratio to compute both the conditional
and unconditional odds ratios and corresponding confidence intervals for
2x2 contingency tables.scipy.stats.directional_stats to compute sample statistics of
n-dimensional directional data.scipy.stats.expectile, which generalizes the expected value in the
same way as quantiles are a generalization of the median.Added new statistical distributions.
scipy.stats.uniform_direction, a multivariate distribution to
sample uniformly from the surface of a hypersphere.scipy.stats.random_table, a multivariate distribution to sample
uniformly from m x n contingency tables with provided marginals.scipy.stats.truncpareto, the truncated Pareto distribution.Improved the fit method of several distributions.
scipy.stats.skewnorm and scipy.stats.weibull_min now use an analytical
solution when method='mm', which also serves a starting guess to
improve the performance of method='mle'.scipy.stats.gumbel_r and scipy.stats.gumbel_l: analytical maximum
likelihood estimates have been extended to the cases in which location or
scale are fixed by the user.scipy.stats.powerlaw.Improved random variate sampling of several distributions.
scipy.stats.matrix_normal,
scipy.stats.ortho_group, scipy.stats.special_ortho_group, and
scipy.stats.unitary_group is faster.rvs method of scipy.stats.vonmises now wraps to the interval
[-np.pi, np.pi].scipy.stats.loggamma rvs method for small
values of the shape parameter.Improved the speed and/or accuracy of functions of several statistical distributions.
scipy.stats.Covariance for better speed, accuracy, and user control
in multivariate normal calculations.scipy.stats.skewnorm methods cdf, sf, ppf, and isf
methods now use the implementations from Boost, improving speed while
maintaining accuracy. The calculation of higher-order moments is also
faster and more accurate.scipy.stats.invgauss methods ppf and isf methods now use the
implementations from Boost, improving speed and accuracy.scipy.stats.invweibull methods sf and isf are more accurate for
small probability masses.scipy.stats.nct and scipy.stats.ncx2 now rely on the implementations
from Boost, improving speed and accuracy.logpdf method of scipy.stats.vonmises for reliability
in extreme tails.isf method of scipy.stats.levy for speed and
accuracy.scipy.stats.studentized_range for large df
by adding an infinite degree-of-freedom approximation.lower_limit to scipy.stats.multivariate_normal,
allowing the user to change the integration limit from -inf to a desired
value.entropy of scipy.stats.vonmises for large
concentration values.Enhanced scipy.stats.gaussian_kde.
scipy.stats.gaussian_kde.marginal, which returns the desired
marginal distribution of the original kernel density estimate distribution.cdf method of scipy.stats.gaussian_kde now accepts a
lower_limit parameter for integrating the PDF over a rectangular region.scipy.stats.gaussian_kde.logpdf to Cython,
improving speed.pdf method of
scipy.stats.gaussian_kde for improved multithreading performance.Enhanced the result objects returned by many scipy.stats functions
confidence_interval method to the result object returned by
scipy.stats.ttest_1samp and scipy.stats.ttest_rel.scipy.stats functions combine_pvalues, fisher_exact,
chi2_contingency, median_test and mood now return
bunch objects rather than plain tuples, allowing attributes to be
accessed by name.multiscale_graphcorr,
anderson_ksamp, binomtest, crosstab, pointbiserialr,
spearmanr, kendalltau, and weightedtau have been renamed to
statistic and pvalue for consistency throughout scipy.stats.
Old attribute names are still allowed for backward compatibility.scipy.stats.anderson now returns the parameters of the fitted
distribution in a scipy.stats._result_classes.FitResult object.plot method of scipy.stats._result_classes.FitResult now accepts
a plot_type parameter; the options are 'hist' (histogram, default),
'qq' (Q-Q plot), 'pp' (P-P plot), and 'cdf' (empirical CDF
plot).scipy.stats.kstest) now return the
location (argmax) at which the statistic is calculated and the variant
of the statistic used.Improved the performance of several scipy.stats functions.
scipy.stats.cramervonmises_2samp and
scipy.stats.ks_2samp with method='exact'.scipy.stats.siegelslopes.scipy.stats.mstats.hdquantile_sd.scipy.stats.binned_statistic_dd for several
NumPy statistics, and binned statistics methods now support complex data.Added the scramble optional argument to scipy.stats.qmc.LatinHypercube.
It replaces centered, which is now deprecated.
Added a parameter optimization to all scipy.stats.qmc.QMCEngine
subclasses to improve characteristics of the quasi-random variates.
Added tie correction to scipy.stats.mood.
Added tutorials for resampling methods in scipy.stats.
scipy.stats.bootstrap, scipy.stats.permutation_test, and
scipy.stats.monte_carlo_test now automatically detect whether the provided
statistic is vectorized, so passing the vectorized argument
explicitly is no longer required to take advantage of vectorized statistics.
Improved the speed of scipy.stats.permutation_test for permutation types
'samples' and 'pairings'.
Added axis, nan_policy, and masked array support to
scipy.stats.jarque_bera.
Added the nan_policy optional argument to scipy.stats.rankdata.
scipy.misc module and all the methods in misc are deprecated in v1.10
and will be completely removed in SciPy v2.0.0. Users are suggested to
utilize the scipy.datasets module instead for the dataset methods.scipy.stats.qmc.LatinHypercube parameter centered has been deprecated.
It is replaced by the scramble argument for more consistency with other
QMC engines.scipy.interpolate.interp2d class has been deprecated. The docstring of the
deprecated routine lists recommended replacements.There is an ongoing effort to follow through on long-standing deprecations.
The following previously deprecated features are affected:
cond & rcond kwargs in linalg.pinvscipy.linalg.blas.{clapack, flapack}scipy.stats.NumericalInverseHermite and removed tol & max_intervals kwargs from scipy.stats.sampling.NumericalInverseHermitelocal_search_options kwarg frrom scipy.optimize.dual_annealing.scipy.stats.bootstrap, scipy.stats.permutation_test, and
scipy.stats.monte_carlo_test now automatically detect whether the provided
statistic is vectorized by looking for an axis parameter in the
signature of statistic. If an axis parameter is present in
statistic but should not be relied on for vectorized calls, users must
pass option vectorized==False explicitly.scipy.stats.multivariate_normal will now raise a ValueError when the
covariance matrix is not positive semidefinite, regardless of which method
is called.A total of 180 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.
SciPy 1.9.3 is a bug-fix release with no new features compared to 1.9.2.
SciPy 1.9.3 is a bug-fix release with no new features
compared to 1.9.2.
A total of 31 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.
SciPy 1.9.2 is a bug-fix release with no new features compared to 1.9.1. It also provides wheels for Python 3.11 on several platforms.
SciPy 1.9.2 is a bug-fix release with no new features
compared to 1.9.1. It also provides wheels for Python 3.11
on several platforms.
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.
SciPy 1.9.1 is a bug-fix release with no new features compared to 1.9.0. Notably, some important meson build fixes are included.
SciPy 1.9.1 is a bug-fix release with no new features
compared to 1.9.0. Notably, some important meson build
fixes are included.
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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
SciPy 1.9.0 is the culmination of 6 months of hard work. It contains
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.9.x branch, and on adding new features on the main branch.
This release requires Python 3.8-3.11 and NumPy 1.18.5 or greater.
For running on PyPy, PyPy3 6.0+ is required.
meson, substantially improving
our build performance, and providing better build-time configuration and
cross-compilation support,scipy.optimize.milp, new function for mixed-integer linear
programming,scipy.stats.fit for fitting discrete and continuous distributions
to data,scipy.interpolate.RegularGridInterpolator,scipy.optimize.direct.scipy.interpolate improvementsRBFInterpolator evaluation with high dimensional
interpolants.scipy.interpolate.RegularGridInterpolator and its tutorial.scipy.interpolate.RegularGridInterpolator and scipy.interpolate.interpn
now accept descending ordered points.RegularGridInterpolator now handles length-1 grid axes.BivariateSpline subclasses have a new method partial_derivative
which constructs a new spline object representing a derivative of an
original spline. This mirrors the corresponding functionality for univariate
splines, splder and BSpline.derivative, and can substantially speed
up repeated evaluation of derivatives.scipy.linalg improvementsscipy.linalg.expm now accepts nD arrays. Its speed is also improved.3.7.1.scipy.fft improvementsuarray multimethods for scipy.fft.fht and scipy.fft.ifht
to allow provision of third party backend implementations such as those
recently added to CuPy.scipy.optimize improvementsA new global optimizer, scipy.optimize.direct (DIviding RECTangles algorithm)
was added. For problems with inexpensive function evaluations, like the ones
in the SciPy benchmark suite, direct is competitive with the best other
solvers in SciPy (dual_annealing and differential_evolution) in terms
of execution time. See
gh-14300 <https://github.com/scipy/scipy/pull/14300>__ for more details.
Add a full_output parameter to scipy.optimize.curve_fit to output
additional solution information.
Add a integrality parameter to scipy.optimize.differential_evolution,
enabling integer constraints on parameters.
Add a vectorized parameter to call a vectorized objective function only
once per iteration. This can improve minimization speed by reducing
interpreter overhead from the multiple objective function calls.
The default method of scipy.optimize.linprog is now 'highs'.
Added scipy.optimize.milp, new function for mixed-integer linear
programming.
Added Newton-TFQMR method to newton_krylov.
Added support for the Bounds class in shgo and dual_annealing for
a more uniform API across scipy.optimize.
Added the vectorized keyword to differential_evolution.
approx_fprime now works with vector-valued functions.
scipy.signal improvementsscipy.signal.windows.kaiser_bessel_derived was
added to compute the Kaiser-Bessel derived window.hilbert operations are now faster as a result of more
consistent dtype handling.scipy.sparse improvementscopy parameter to scipy.sparce.csgraph.laplacian. Using inplace
computation with copy=False reduces the memory footprint.dtype parameter to scipy.sparce.csgraph.laplacian for type casting.symmetrized parameter to scipy.sparce.csgraph.laplacian to produce
symmetric Laplacian for directed graphs.form parameter to scipy.sparce.csgraph.laplacian taking one of the
three values: array, or function, or lo determining the format of
the output Laplacian:
array is a numpy array (backward compatible default);function is a pointer to a lambda-function evaluating the
Laplacian-vector or Laplacian-matrix product;lo results in the format of the LinearOperator.scipy.sparse.linalg improvementslobpcg performance improvements for small input cases.scipy.spatial improvementsorder parameter to scipy.spatial.transform.Rotation.from_quat
and scipy.spatial.transform.Rotation.as_quat to specify quaternion format.scipy.stats improvementsscipy.stats.monte_carlo_test performs one-sample Monte Carlo hypothesis
tests to assess whether a sample was drawn from a given distribution. Besides
reproducing the results of hypothesis tests like scipy.stats.ks_1samp,
scipy.stats.normaltest, and scipy.stats.cramervonmises without small sample
size limitations, it makes it possible to perform similar tests using arbitrary
statistics and distributions.
Several scipy.stats functions support new axis (integer or tuple of
integers) and nan_policy ('raise', 'omit', or 'propagate'), and
keepdims arguments.
These functions also support masked arrays as inputs, even if they do not have
a scipy.stats.mstats counterpart. Edge cases for multidimensional arrays,
such as when axis-slices have no unmasked elements or entire inputs are of
size zero, are handled consistently.
Add a weight parameter to scipy.stats.hmean.
Several improvements have been made to scipy.stats.levy_stable. Substantial
improvement has been made for numerical evaluation of the pdf and cdf,
resolving #12658 and
#14944. The improvement is
particularly dramatic for stability parameter alpha close to or equal to 1
and for alpha below but approaching its maximum value of 2. The alternative
fast Fourier transform based method for pdf calculation has also been updated
to use the approach of Wang and Zhang from their 2008 conference paper
Simpson’s rule based FFT method to compute densities of stable distribution,
making this method more competitive with the default method. In addition,
users now have the option to change the parametrization of the Levy Stable
distribution to Nolan's "S0" parametrization which is used internally by
SciPy's pdf and cdf implementations. The "S0" parametrization is described in
Nolan's paper Numerical calculation of stable densities and distribution
functions upon which SciPy's
implementation is based. "S0" has the advantage that delta and gamma
are proper location and scale parameters. With delta and gamma fixed,
the location and scale of the resulting distribution remain unchanged as
alpha and beta change. This is not the case for the default "S1"
parametrization. Finally, more options have been exposed to allow users to
trade off between runtime and accuracy for both the default and FFT methods of
pdf and cdf calculation. More information can be found in the documentation
here (to be linked).
Added scipy.stats.fit for fitting discrete and continuous distributions to
data.
The methods "pearson" and "tippet" from scipy.stats.combine_pvalues
have been fixed to return the correct p-values, resolving
#15373. In addition, the
documentation for scipy.stats.combine_pvalues has been expanded and improved.
Unlike other reduction functions, stats.mode didn't consume the axis
being operated on and failed for negative axis inputs. Both the bugs have been
fixed. Note that stats.mode will now consume the input axis and return an
ndarray with the axis dimension removed.
Replaced implementation of scipy.stats.ncf with the implementation from
Boost for improved reliability.
Add a bits parameter to scipy.stats.qmc.Sobol. It allows to use from 0
to 64 bits to compute the sequence. Default is None which corresponds to
30 for backward compatibility. Using a higher value allow to sample more
points. Note: bits does not affect the output dtype.
Add a integers method to scipy.stats.qmc.QMCEngine. It allows sampling
integers using any QMC sampler.
Improved the fit speed and accuracy of stats.pareto.
Added qrvs method to NumericalInversePolynomial to match the
situation for NumericalInverseHermite.
Faster random variate generation for gennorm and nakagami.
lloyd_centroidal_voronoi_tessellation has been added to allow improved
sample distributions via iterative application of Voronoi diagrams and
centering operations
Add scipy.stats.qmc.PoissonDisk to sample using the Poisson disk sampling
method. It guarantees that samples are separated from each other by a
given radius.
Add scipy.stats.pmean to calculate the weighted power mean also called
generalized mean.
n of several distributions,
use of the distribution moment method with keyword argument n is
deprecated. Keyword n is replaced with keyword order.interval method with keyword arguments
alpha is deprecated. Keyword alpha is replaced with keyword
confidence.'simplex', 'revised simplex', and 'interior-point' methods
of scipy.optimize.linprog are deprecated. Methods highs, highs-ds,
or highs-ipm should be used in new code.stats.mode.
pandas.DataFrame.mode can be used instead.spatial.distance.kulsinski has been deprecated in favor
of spatial.distance.kulczynski1.maxiter keyword of the truncated Newton (TNC) algorithm has been
deprecated in favour of maxfun.vertices keyword of Delauney.qhull now raises a
DeprecationWarning, after having been deprecated in documentation only
for a long time.extradoc keyword of rv_continuous, rv_discrete and
rv_sample now raises a DeprecationWarning, after having been deprecated in
documentation only for a long time.There is an ongoing effort to follow through on long-standing deprecations. The following previously deprecated features are affected:
radius=None to scipy.spatial.SphericalVoronoi now raises an
error (not adding radius defaults to 1, as before).ndim > 1._rvs method of statistical distributions now requires a size
parameter.fillvalue that cannot be cast to the output type in
scipy.signal.convolve2d now raises an error.scipy.spatial.distance now enforces that the input vectors are
one-dimensional.stats.itemfreq.stats.median_absolute_deviation.n_jobs keyword argument and use of k=None from
kdtree.query.right keyword from interpolate.PPoly.extend.debug keyword from scipy.linalg.solve_*._ppform scipy.interpolate.matvec and matmat.mlab truncation mode from cluster.dendrogram.cluster.vq.py_vq2.ftol and xtol from
optimize.minimize(method='Nelder-Mead').signal.windows.hanning.gegv functions from linalg; this raises the minimally
required LAPACK version to 3.7.1.spatial.distance.matching.scipy.random for numpy.random.scipy.misc (docformat,
inherit_docstring_from, extend_notes_in_docstring,
replace_notes_in_docstring, indentcount_lines, filldoc,
unindent_dict, unindent_string).linalg.pinv2.scipy.stats functions now convert np.matrix to np.ndarrays
before the calculation is performed. In this case, the output will be a scalar
or np.ndarray of appropriate shape rather than a 2D np.matrix.
Similarly, while masked elements of masked arrays are still ignored, the
output will be a scalar or np.ndarray rather than a masked array with
mask=False.scipy.optimize.linprog is now 'highs', not
'interior-point' (which is now deprecated), so callback functions and
some options are no longer supported with the default method. With the
default method, the x attribute of the returned OptimizeResult is
now None (instead of a non-optimal array) when an optimal solution
cannot be found (e.g. infeasible problem).scipy.stats.combine_pvalues, the sign of the test statistic returned
for the method "pearson" has been flipped so that higher values of the
statistic now correspond to lower p-values, making the statistic more
consistent with those of the other methods and with the majority of the
literature.scipy.linalg.expm due to historical reasons was using the sparse
implementation and thus was accepting sparse arrays. Now it only works with
nDarrays. For sparse usage, scipy.sparse.linalg.expm needs to be used
explicitly.scipy.stats.circvar has reverted to the one that is
standard in the literature; note that this is not the same as the square of
scipy.stats.circstd.QMCEngine in MultinomialQMC and
MultivariateNormalQMC. It removes the methods fast_forward and reset.MultinomialQMC now require the number of trials with n_trials.
Hence, MultinomialQMC.random output has now the correct shape (n, pvals).F_onewayConstantInputWarning,
F_onewayBadInputSizesWarning, PearsonRConstantInputWarning,
PearsonRNearConstantInputWarning, SpearmanRConstantInputWarning, and
BootstrapDegenerateDistributionWarning) have been replaced with more
general warnings.A draft developer CLI is available for SciPy, leveraging the doit,
click and rich-click tools. For more details, see
gh-15959.
The SciPy contributor guide has been reorganized and updated (see #15947 for details).
QUADPACK Fortran routines in scipy.integrate, which power
scipy.integrate.quad, have been marked as recursive. This should fix rare
issues in multivariate integration (nquad and friends) and obviate the need
for compiler-specific compile flags (/recursive for ifort etc). Please file
an issue if this change turns out problematic for you. This is also true for
FITPACK routines in scipy.interpolate, which power splrep,
splev etc., and *UnivariateSpline and *BivariateSpline classes.
the USE_PROPACK environment variable has been renamed to
SCIPY_USE_PROPACK; setting to a non-zero value will enable
the usage of the PROPACK library as before
Building SciPy on windows with MSVC now requires at least the vc142 toolset (available in Visual Studio 2019 and higher).
Before this release, all subpackages of SciPy (cluster, fft, ndimage,
etc.) had to be explicitly imported. Now, these subpackages are lazily loaded
as soon as they are accessed, so that the following is possible (if desired
for interactive use, it's not actually recommended for code,
see :ref:scipy-api):
import scipy as sp; sp.fft.dct([1, 2, 3]). Advantages include: making it
easier to navigate SciPy in interactive terminals, reducing subpackage import
conflicts (which before required
import networkx.linalg as nla; import scipy.linalg as sla),
and avoiding repeatedly having to update imports during teaching &
experimentation. Also see
the related community specification document.
This is the first release that ships with Meson as
the build system. When installing with pip or pypa/build, Meson will be
used (invoked via the meson-python build hook). This change brings
significant benefits - most importantly much faster build times, but also
better support for cross-compilation and cleaner build logs.
Note:
This release still ships with support for numpy.distutils-based builds
as well. Those can be invoked through the setup.py command-line
interface (e.g., python setup.py install). It is planned to remove
numpy.distutils support before the 1.10.0 release.
When building from source, a number of things have changed compared to building
with numpy.distutils:
meson, ninja, and pkg-config.
setuptools and wheel are no longer needed.pkg-config instead of hardcoded
paths or a site.cfg file.blas-lapack-selection for
details.The two CLIs that can be used to build wheels are pip and build. In
addition, the SciPy repo contains a python dev.py CLI for any kind of
development task (see its --help for details). For a comparison between old
(distutils) and new (meson) build commands, see :ref:meson-faq.
For more information on the introduction of Meson support in SciPy, see
gh-13615 <https://github.com/scipy/scipy/issues/13615>__ and
this blog post <https://labs.quansight.org/blog/2021/07/moving-scipy-to-meson/>__.
A total of 154 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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
Note: SciPy 1.9.0 is not released yet!
SciPy 1.9.0 is the culmination of 6 months of hard work. It contains
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.9.x branch, and on adding new features on the main branch.
This release requires Python 3.8-3.11 and NumPy 1.18.5 or greater.
For running on PyPy, PyPy3 6.0+ is required.
meson, substantially improving
our build performance, and providing better build-time configuration and
cross-compilation support,scipy.optimize.milp, new function for mixed-integer linear
programming,scipy.stats.fit for fitting discrete and continuous distributions
to data,scipy.interpolate.RegularGridInterpolator,scipy.optimize.direct.scipy.interpolate improvementsRBFInterpolator evaluation with high dimensional
interpolants.scipy.interpolate.RegularGridInterpolator and its tutorial.scipy.interpolate.RegularGridInterpolator and scipy.interpolate.interpn
now accept descending ordered points.RegularGridInterpolator now handles length-1 grid axes.BivariateSpline subclasses have a new method partial_derivative
which constructs a new spline object representing a derivative of an
original spline. This mirrors the corresponding functionality for univariate
splines, splder and BSpline.derivative, and can substantially speed
up repeated evaluation of derivatives.scipy.linalg improvementsscipy.linalg.expm now accepts nD arrays. Its speed is also improved.3.7.1.scipy.fft improvementsuarray multimethods for scipy.fft.fht and scipy.fft.ifht
to allow provision of third party backend implementations such as those
recently added to CuPy.scipy.optimize improvementsA new global optimizer, scipy.optimize.direct (DIviding RECTangles algorithm)
was added. For problems with inexpensive function evaluations, like the ones
in the SciPy benchmark suite, direct is competitive with the best other
solvers in SciPy (dual_annealing and differential_evolution) in terms
of execution time. See
gh-14300 <https://github.com/scipy/scipy/pull/14300>__ for more details.
Add a full_output parameter to scipy.optimize.curve_fit to output
additional solution information.
Add a integrality parameter to scipy.optimize.differential_evolution,
enabling integer constraints on parameters.
Add a vectorized parameter to call a vectorized objective function only
once per iteration. This can improve minimization speed by reducing
interpreter overhead from the multiple objective function calls.
The default method of scipy.optimize.linprog is now 'highs'.
Added scipy.optimize.milp, new function for mixed-integer linear
programming.
Added Newton-TFQMR method to newton_krylov.
Added support for the Bounds class in shgo and dual_annealing for
a more uniform API across scipy.optimize.
Added the vectorized keyword to differential_evolution.
approx_fprime now works with vector-valued functions.
scipy.signal improvementsscipy.signal.windows.kaiser_bessel_derived was
added to compute the Kaiser-Bessel derived window.hilbert operations are now faster as a result of more
consistent dtype handling.scipy.sparse improvementscopy parameter to scipy.sparce.csgraph.laplacian. Using inplace
computation with copy=False reduces the memory footprint.dtype parameter to scipy.sparce.csgraph.laplacian for type casting.symmetrized parameter to scipy.sparce.csgraph.laplacian to produce
symmetric Laplacian for directed graphs.form parameter to scipy.sparce.csgraph.laplacian taking one of the
three values: array, or function, or lo determining the format of
the output Laplacian:
array is a numpy array (backward compatible default);function is a pointer to a lambda-function evaluating the
Laplacian-vector or Laplacian-matrix product;lo results in the format of the LinearOperator.scipy.sparse.linalg improvementslobpcg performance improvements for small input cases.scipy.spatial improvementsorder parameter to scipy.spatial.transform.Rotation.from_quat
and scipy.spatial.transform.Rotation.as_quat to specify quaternion format.scipy.stats improvementsscipy.stats.monte_carlo_test performs one-sample Monte Carlo hypothesis
tests to assess whether a sample was drawn from a given distribution. Besides
reproducing the results of hypothesis tests like scipy.stats.ks_1samp,
scipy.stats.normaltest, and scipy.stats.cramervonmises without small sample
size limitations, it makes it possible to perform similar tests using arbitrary
statistics and distributions.
Several scipy.stats functions support new axis (integer or tuple of
integers) and nan_policy ('raise', 'omit', or 'propagate'), and
keepdims arguments.
These functions also support masked arrays as inputs, even if they do not have
a scipy.stats.mstats counterpart. Edge cases for multidimensional arrays,
such as when axis-slices have no unmasked elements or entire inputs are of
size zero, are handled consistently.
Add a weight parameter to scipy.stats.hmean.
Several improvements have been made to scipy.stats.levy_stable. Substantial
improvement has been made for numerical evaluation of the pdf and cdf,
resolving #12658 and
#14944. The improvement is
particularly dramatic for stability parameter alpha close to or equal to 1
and for alpha below but approaching its maximum value of 2. The alternative
fast Fourier transform based method for pdf calculation has also been updated
to use the approach of Wang and Zhang from their 2008 conference paper
Simpson’s rule based FFT method to compute densities of stable distribution,
making this method more competitive with the default method. In addition,
users now have the option to change the parametrization of the Levy Stable
distribution to Nolan's "S0" parametrization which is used internally by
SciPy's pdf and cdf implementations. The "S0" parametrization is described in
Nolan's paper Numerical calculation of stable densities and distribution
functions upon which SciPy's
implementation is based. "S0" has the advantage that delta and gamma
are proper location and scale parameters. With delta and gamma fixed,
the location and scale of the resulting distribution remain unchanged as
alpha and beta change. This is not the case for the default "S1"
parametrization. Finally, more options have been exposed to allow users to
trade off between runtime and accuracy for both the default and FFT methods of
pdf and cdf calculation. More information can be found in the documentation
here (to be linked).
Added scipy.stats.fit for fitting discrete and continuous distributions to
data.
The methods "pearson" and "tippet" from scipy.stats.combine_pvalues
have been fixed to return the correct p-values, resolving
#15373. In addition, the
documentation for scipy.stats.combine_pvalues has been expanded and improved.
Unlike other reduction functions, stats.mode didn't consume the axis
being operated on and failed for negative axis inputs. Both the bugs have been
fixed. Note that stats.mode will now consume the input axis and return an
ndarray with the axis dimension removed.
Replaced implementation of scipy.stats.ncf with the implementation from
Boost for improved reliability.
Add a bits parameter to scipy.stats.qmc.Sobol. It allows to use from 0
to 64 bits to compute the sequence. Default is None which corresponds to
30 for backward compatibility. Using a higher value allow to sample more
points. Note: bits does not affect the output dtype.
Add a integers method to scipy.stats.qmc.QMCEngine. It allows sampling
integers using any QMC sampler.
Improved the fit speed and accuracy of stats.pareto.
Added qrvs method to NumericalInversePolynomial to match the
situation for NumericalInverseHermite.
Faster random variate generation for gennorm and nakagami.
lloyd_centroidal_voronoi_tessellation has been added to allow improved
sample distributions via iterative application of Voronoi diagrams and
centering operations
Add scipy.stats.qmc.PoissonDisk to sample using the Poisson disk sampling
method. It guarantees that samples are separated from each other by a
given radius.
Add scipy.stats.pmean to calculate the weighted power mean also called
generalized mean.
n of several distributions,
use of the distribution moment method with keyword argument n is
deprecated. Keyword n is replaced with keyword order.interval method with keyword arguments
alpha is deprecated. Keyword alpha is replaced with keyword
confidence.'simplex', 'revised simplex', and 'interior-point' methods
of scipy.optimize.linprog are deprecated. Methods highs, highs-ds,
or highs-ipm should be used in new code.stats.mode.
pandas.DataFrame.mode can be used instead.spatial.distance.kulsinski has been deprecated in favor
of spatial.distance.kulczynski1.maxiter keyword of the truncated Newton (TNC) algorithm has been
deprecated in favour of maxfun.vertices keyword of Delauney.qhull now raises a
DeprecationWarning, after having been deprecated in documentation only
for a long time.extradoc keyword of rv_continuous, rv_discrete and
rv_sample now raises a DeprecationWarning, after having been deprecated in
documentation only for a long time.There is an ongoing effort to follow through on long-standing deprecations. The following previously deprecated features are affected:
radius=None to scipy.spatial.SphericalVoronoi now raises an
error (not adding radius defaults to 1, as before).ndim > 1._rvs method of statistical distributions now requires a size
parameter.fillvalue that cannot be cast to the output type in
scipy.signal.convolve2d now raises an error.scipy.spatial.distance now enforces that the input vectors are
one-dimensional.stats.itemfreq.stats.median_absolute_deviation.n_jobs keyword argument and use of k=None from
kdtree.query.right keyword from interpolate.PPoly.extend.debug keyword from scipy.linalg.solve_*._ppform scipy.interpolate.matvec and matmat.mlab truncation mode from cluster.dendrogram.cluster.vq.py_vq2.ftol and xtol from
optimize.minimize(method='Nelder-Mead').signal.windows.hanning.gegv functions from linalg; this raises the minimally
required LAPACK version to 3.7.1.spatial.distance.matching.scipy.random for numpy.random.scipy.misc (docformat,
inherit_docstring_from, extend_notes_in_docstring,
replace_notes_in_docstring, indentcount_lines, filldoc,
unindent_dict, unindent_string).linalg.pinv2.scipy.stats functions now convert np.matrix to np.ndarrays
before the calculation is performed. In this case, the output will be a scalar
or np.ndarray of appropriate shape rather than a 2D np.matrix.
Similarly, while masked elements of masked arrays are still ignored, the
output will be a scalar or np.ndarray rather than a masked array with
mask=False.scipy.optimize.linprog is now 'highs', not
'interior-point' (which is now deprecated), so callback functions and
some options are no longer supported with the default method. With the
default method, the x attribute of the returned OptimizeResult is
now None (instead of a non-optimal array) when an optimal solution
cannot be found (e.g. infeasible problem).scipy.stats.combine_pvalues, the sign of the test statistic returned
for the method "pearson" has been flipped so that higher values of the
statistic now correspond to lower p-values, making the statistic more
consistent with those of the other methods and with the majority of the
literature.scipy.linalg.expm due to historical reasons was using the sparse
implementation and thus was accepting sparse arrays. Now it only works with
nDarrays. For sparse usage, scipy.sparse.linalg.expm needs to be used
explicitly.scipy.stats.circvar has reverted to the one that is
standard in the literature; note that this is not the same as the square of
scipy.stats.circstd.QMCEngine in MultinomialQMC and
MultivariateNormalQMC. It removes the methods fast_forward and reset.MultinomialQMC now require the number of trials with n_trials.
Hence, MultinomialQMC.random output has now the correct shape (n, pvals).F_onewayConstantInputWarning,
F_onewayBadInputSizesWarning, PearsonRConstantInputWarning,
PearsonRNearConstantInputWarning, SpearmanRConstantInputWarning, and
BootstrapDegenerateDistributionWarning) have been replaced with more
general warnings.A draft developer CLI is available for SciPy, leveraging the doit,
click and rich-click tools. For more details, see
gh-15959.
The SciPy contributor guide has been reorganized and updated (see #15947 for details).
QUADPACK Fortran routines in scipy.integrate, which power
scipy.integrate.quad, have been marked as recursive. This should fix rare
issues in multivariate integration (nquad and friends) and obviate the need
for compiler-specific compile flags (/recursive for ifort etc). Please file
an issue if this change turns out problematic for you. This is also true for
FITPACK routines in scipy.interpolate, which power splrep,
splev etc., and *UnivariateSpline and *BivariateSpline classes.
the USE_PROPACK environment variable has been renamed to
SCIPY_USE_PROPACK; setting to a non-zero value will enable
the usage of the PROPACK library as before
Building SciPy on windows with MSVC now requires at least the vc142 toolset (available in Visual Studio 2019 and higher).
Before this release, all subpackages of SciPy (cluster, fft, ndimage,
etc.) had to be explicitly imported. Now, these subpackages are lazily loaded
as soon as they are accessed, so that the following is possible (if desired
for interactive use, it's not actually recommended for code,
see :ref:scipy-api):
import scipy as sp; sp.fft.dct([1, 2, 3]). Advantages include: making it
easier to navigate SciPy in interactive terminals, reducing subpackage import
conflicts (which before required
import networkx.linalg as nla; import scipy.linalg as sla),
and avoiding repeatedly having to update imports during teaching &
experimentation. Also see
the related community specification document.
This is the first release that ships with Meson as
the build system. When installing with pip or pypa/build, Meson will be
used (invoked via the meson-python build hook). This change brings
significant benefits - most importantly much faster build times, but also
better support for cross-compilation and cleaner build logs.
Note:
This release still ships with support for numpy.distutils-based builds
as well. Those can be invoked through the setup.py command-line
interface (e.g., python setup.py install). It is planned to remove
numpy.distutils support before the 1.10.0 release.
When building from source, a number of things have changed compared to building
with numpy.distutils:
meson, ninja, and pkg-config.
setuptools and wheel are no longer needed.pkg-config instead of hardcoded
paths or a site.cfg file.blas-lapack-selection for
details.The two CLIs that can be used to build wheels are pip and build. In
addition, the SciPy repo contains a python dev.py CLI for any kind of
development task (see its --help for details). For a comparison between old
(distutils) and new (meson) build commands, see :ref:meson-faq.
For more information on the introduction of Meson support in SciPy, see
gh-13615 <https://github.com/scipy/scipy/issues/13615>__ and
this blog post <https://labs.quansight.org/blog/2021/07/moving-scipy-to-meson/>__.
A total of 155 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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
Note: SciPy 1.9.0 is not released yet!
SciPy 1.9.0 is the culmination of 6 months of hard work. It contains
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.9.x branch, and on adding new features on the main branch.
This release requires Python 3.8+ and NumPy 1.18.5 or greater.
For running on PyPy, PyPy3 6.0+ is required.
meson, substantially reducing
our source build timesscipy.optimize.milp, new function for mixed-integer linear
programming.scipy.stats.fit for fitting discrete and continuous distributions
to data.scipy.interpolate.RegularGridInterpolator.scipy.optimize.directscipy.interpolate improvementsRBFInterpolator evaluation with high dimensional
interpolants.scipy.interpolate.RegularGridInterpolator and its tutorial.scipy.interpolate.RegularGridInterpolator and scipy.interpolate.interpn
now accept descending ordered points.RegularGridInterpolator now handles length-1 grid axes.BivariateSpline subclasses have a new method partial_derivative
which constructs a new spline object representing a derivative of an
original spline. This mirrors the corresponding functionality for univariate
splines, splder and BSpline.derivative, and can substantially speed
up repeated evaluation of derivatives.scipy.linalg improvementsscipy.linalg.expm now accepts nD arrays. Its speed is also improved.3.7.1.scipy.fft improvementsuarray multimethods for scipy.fft.fht and scipy.fft.ifht
to allow provision of third party backend implementations such as those
recently added to CuPy.scipy.optimize improvementsA new global optimizer, scipy.optimize.direct (DIviding RECTangles algorithm)
was added. For problems with inexpensive function evaluations, like the ones
in the SciPy benchmark suite, direct is competitive with the best other
solvers in SciPy (dual_annealing and differential_evolution) in terms
of execution time. See
gh-14300 <https://github.com/scipy/scipy/pull/14300>__ for more details.
Add a full_output parameter to scipy.optimize.curve_fit to output
additional solution information.
Add a integrality parameter to scipy.optimize.differential_evolution,
enabling integer constraints on parameters.
Add a vectorized parameter to call a vectorized objective function only
once per iteration. This can improve minimization speed by reducing
interpreter overhead from the multiple objective function calls.
The default method of scipy.optimize.linprog is now 'highs'.
Added scipy.optimize.milp, new function for mixed-integer linear
programming.
Added Newton-TFQMR method to newton_krylov.
Added support for the Bounds class in shgo and dual_annealing for
a more uniform API across scipy.optimize.
Added the vectorized keyword to differential_evolution.
approx_fprime now works with vector-valued functions.
scipy.signal improvementsscipy.signal.windows.kaiser_bessel_derived was
added to compute the Kaiser-Bessel derived window.hilbert operations are now faster as a result of more
consistent dtype handling.scipy.sparse improvementscopy parameter to scipy.sparce.csgraph.laplacian. Using inplace
computation with copy=False reduces the memory footprint.dtype parameter to scipy.sparce.csgraph.laplacian for type casting.symmetrized parameter to scipy.sparce.csgraph.laplacian to produce
symmetric Laplacian for directed graphs.form parameter to scipy.sparce.csgraph.laplacian taking one of the
three values: array, or function, or lo determining the format of
the output Laplacian:
array is a numpy array (backward compatible default);function is a pointer to a lambda-function evaluating the
Laplacian-vector or Laplacian-matrix product;lo results in the format of the LinearOperator.scipy.sparse.linalg improvementslobpcg performance improvements for small input cases.scipy.spatial improvementsorder parameter to scipy.spatial.transform.Rotation.from_quat
and scipy.spatial.transform.Rotation.as_quat to specify quaternion format.scipy.stats improvementsscipy.stats.monte_carlo_test performs one-sample Monte Carlo hypothesis
tests to assess whether a sample was drawn from a given distribution. Besides
reproducing the results of hypothesis tests like scipy.stats.ks_1samp,
scipy.stats.normaltest, and scipy.stats.cramervonmises without small sample
size limitations, it makes it possible to perform similar tests using arbitrary
statistics and distributions.
Several scipy.stats functions support new axis (integer or tuple of
integers) and nan_policy ('raise', 'omit', or 'propagate'), and
keepdims arguments.
These functions also support masked arrays as inputs, even if they do not have
a scipy.stats.mstats counterpart. Edge cases for multidimensional arrays,
such as when axis-slices have no unmasked elements or entire inputs are of
size zero, are handled consistently.
Add a weight parameter to scipy.stats.hmean.
Several improvements have been made to scipy.stats.levy_stable. Substantial
improvement has been made for numerical evaluation of the pdf and cdf,
resolving #12658 and
#14944. The improvement is
particularly dramatic for stability parameter alpha close to or equal to 1
and for alpha below but approaching its maximum value of 2. The alternative
fast Fourier transform based method for pdf calculation has also been updated
to use the approach of Wang and Zhang from their 2008 conference paper
Simpson’s rule based FFT method to compute densities of stable distribution,
making this method more competitive with the default method. In addition,
users now have the option to change the parametrization of the Levy Stable
distribution to Nolan's "S0" parametrization which is used internally by
SciPy's pdf and cdf implementations. The "S0" parametrization is described in
Nolan's paper Numerical calculation of stable densities and distribution
functions upon which SciPy's
implementation is based. "S0" has the advantage that delta and gamma
are proper location and scale parameters. With delta and gamma fixed,
the location and scale of the resulting distribution remain unchanged as
alpha and beta change. This is not the case for the default "S1"
parametrization. Finally, more options have been exposed to allow users to
trade off between runtime and accuracy for both the default and FFT methods of
pdf and cdf calculation. More information can be found in the documentation
here (to be linked).
Added scipy.stats.fit for fitting discrete and continuous distributions to
data.
The methods "pearson" and "tippet" from scipy.stats.combine_pvalues
have been fixed to return the correct p-values, resolving
#15373. In addition, the
documentation for scipy.stats.combine_pvalues has been expanded and improved.
Unlike other reduction functions, stats.mode didn't consume the axis
being operated on and failed for negative axis inputs. Both the bugs have been
fixed. Note that stats.mode will now consume the input axis and return an
ndarray with the axis dimension removed.
Replaced implementation of scipy.stats.ncf with the implementation from
Boost for improved reliability.
Add a bits parameter to scipy.stats.qmc.Sobol. It allows to use from 0
to 64 bits to compute the sequence. Default is None which corresponds to
30 for backward compatibility. Using a higher value allow to sample more
points. Note: bits does not affect the output dtype.
Add a integers method to scipy.stats.qmc.QMCEngine. It allows sampling
integers using any QMC sampler.
Improved the fit speed and accuracy of stats.pareto.
Added qrvs method to NumericalInversePolynomial to match the
situation for NumericalInverseHermite.
Faster random variate generation for gennorm and nakagami.
lloyd_centroidal_voronoi_tessellation has been added to allow improved
sample distributions via iterative application of Voronoi diagrams and
centering operations
Add scipy.stats.qmc.PoissonDisk to sample using the Poisson disk sampling
method. It guarantees that samples are separated from each other by a
given radius.
Add scipy.stats.pmean to calculate the weighted power mean also called
generalized mean.
n of several distributions,
use of the distribution moment method with keyword argument n is
deprecated. Keyword n is replaced with keyword order.interval method with keyword arguments
alpha is deprecated. Keyword alpha is replaced with keyword
confidence.'simplex', 'revised simplex', and 'interior-point' methods
of scipy.optimize.linprog are deprecated. Methods highs, highs-ds,
or highs-ipm should be used in new code.stats.mode.
pandas.DataFrame.mode can be used instead.spatial.distance.kulsinski has been deprecated in favor
of spatial.distance.kulczynski1.maxiter keyword of the truncated Newton (TNC) algorithm has been
deprecated in favour of maxfun.vertices keyword of Delauney.qhull now raises a
DeprecationWarning, after having been deprecated in documentation only
for a long time.extradoc keyword of rv_continuous, rv_discrete and
rv_sample now raises a DeprecationWarning, after having been deprecated in
documentation only for a long time.There is an ongoing effort to follow through on long-standing deprecations. The following previously deprecated features are affected:
radius=None to scipy.spatial.SphericalVoronoi now raises an
error (not adding radius defaults to 1, as before).ndim > 1._rvs method of statistical distributions now requires a size
parameter.fillvalue that cannot be cast to the output type in
scipy.signal.convolve2d now raises an error.scipy.spatial.distance now enforces that the input vectors are
one-dimensional.stats.itemfreq.stats.median_absolute_deviation.n_jobs keyword argument and use of k=None from
kdtree.query.right keyword from interpolate.PPoly.extend.debug keyword from scipy.linalg.solve_*._ppform scipy.interpolate.matvec and matmat.mlab truncation mode from cluster.dendrogram.cluster.vq.py_vq2.ftol and xtol from
optimize.minimize(method='Nelder-Mead').signal.windows.hanning.gegv functions from linalg; this raises the minimally
required LAPACK version to 3.7.1.spatial.distance.matching.scipy.random for numpy.random.scipy.misc (docformat,
inherit_docstring_from, extend_notes_in_docstring,
replace_notes_in_docstring, indentcount_lines, filldoc,
unindent_dict, unindent_string).linalg.pinv2.scipy.stats functions now convert np.matrix to np.ndarrays
before the calculation is performed. In this case, the output will be a scalar
or np.ndarray of appropriate shape rather than a 2D np.matrix.
Similarly, while masked elements of masked arrays are still ignored, the
output will be a scalar or np.ndarray rather than a masked array with
mask=False.scipy.optimize.linprog is now 'highs', not
'interior-point' (which is now deprecated), so callback functions and
some options are no longer supported with the default method. With the
default method, the x attribute of the returned OptimizeResult is
now None (instead of a non-optimal array) when an optimal solution
cannot be found (e.g. infeasible problem).scipy.stats.combine_pvalues, the sign of the test statistic returned
for the method "pearson" has been flipped so that higher values of the
statistic now correspond to lower p-values, making the statistic more
consistent with those of the other methods and with the majority of the
literature.scipy.linalg.expm due to historical reasons was using the sparse
implementation and thus was accepting sparse arrays. Now it only works with
nDarrays. For sparse usage, scipy.sparse.linalg.expm needs to be used
explicitly.scipy.stats.circvar has reverted to the one that is
standard in the literature; note that this is not the same as the square of
scipy.stats.circstd.QMCEngine in MultinomialQMC and
MultivariateNormalQMC. It removes the methods fast_forward and reset.MultinomialQMC now require the number of trials with n_trials.
Hence, MultinomialQMC.random output has now the correct shape (n, pvals).F_onewayConstantInputWarning,
F_onewayBadInputSizesWarning, PearsonRConstantInputWarning,
PearsonRNearConstantInputWarning, SpearmanRConstantInputWarning, and
BootstrapDegenerateDistributionWarning) have been replaced with more
general warnings.A draft developer CLI is available for SciPy, leveraging the doit,
click and rich-click tools. For more details, see
gh-15959.
The SciPy contributor guide has been reorganized and updated (see #15947 for details).
QUADPACK Fortran routines in scipy.integrate, which power
scipy.integrate.quad, have been marked as recursive. This should fix rare
issues in multivariate integration (nquad and friends) and obviate the need
for compiler-specific compile flags (/recursive for ifort etc). Please file
an issue if this change turns out problematic for you. This is also true for
FITPACK routines in scipy.interpolate, which power splrep,
splev etc., and *UnivariateSpline and *BivariateSpline classes.
the USE_PROPACK environment variable has been renamed to
SCIPY_USE_PROPACK; setting to a non-zero value will enable
the usage of the PROPACK library as before
Before this release, all subpackages of SciPy (cluster, fft, ndimage,
etc.) had to be explicitly imported. Now, these subpackages are lazily loaded
as soon as they are accessed, so that the following is possible (if desired
for interactive use, it's not actually recommended for code,
see :ref:scipy-api):
import scipy as sp; sp.fft.dct([1, 2, 3]). Advantages include: making it
easier to navigate SciPy in interactive terminals, reducing subpackage import
conflicts (which before required
import networkx.linalg as nla; import scipy.linalg as sla),
and avoiding repeatedly having to update imports during teaching &
experimentation. Also see
the related community specification document.
This is the first release that ships with Meson as
the build system. When installing with pip or pypa/build, Meson will be
used (invoked via the meson-python build hook). This change brings
significant benefits - most importantly much faster build times, but also
better support for cross-compilation and cleaner build logs.
Note:
This release still ships with support for numpy.distutils-based builds
as well. Those can be invoked through the setup.py command-line
interface (e.g., python setup.py install). It is planned to remove
numpy.distutils support before the 1.10.0 release.
When building from source, a number of things have changed compared to building
with numpy.distutils:
meson, ninja, and pkg-config.
setuptools and wheel are no longer needed.pkg-config instead of hardcoded
paths or a site.cfg file.blas-lapack-selection for
details.The two CLIs that can be used to build wheels are pip and build. In
addition, the SciPy repo contains a python dev.py CLI for any kind of
development task (see its --help for details). For a comparison between old
(distutils) and new (meson) build commands, see :ref:meson-faq.
For more information on the introduction of Meson support in SciPy, see
gh-13615 <https://github.com/scipy/scipy/issues/13615>__ and
this blog post <https://labs.quansight.org/blog/2021/07/moving-scipy-to-meson/>__.
A total of 155 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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
Note: SciPy 1.9.0 is not released yet!
SciPy 1.9.0 is the culmination of 6 months of hard work. It contains
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.9.x branch, and on adding new features on the main branch.
This release requires Python 3.8+ and NumPy 1.18.5 or greater.
For running on PyPy, PyPy3 6.0+ is required.
meson, substantially reducing
our source build timesscipy.optimize.milp, new function for mixed-integer linear
programming.scipy.stats.fit for fitting discrete and continuous distributions
to data.scipy.interpolate.RegularGridInterpolator.scipy.optimize.directscipy.interpolate improvementsRBFInterpolator evaluation with high dimensional
interpolants.scipy.interpolate.RegularGridInterpolator and its tutorial.scipy.interpolate.RegularGridInterpolator and scipy.interpolate.interpn
now accept descending ordered points.RegularGridInterpolator now handles length-1 grid axes.BivariateSpline subclasses have a new method partial_derivative
which constructs a new spline object representing a derivative of an
original spline. This mirrors the corresponding functionality for univariate
splines, splder and BSpline.derivative, and can substantially speed
up repeated evaluation of derivatives.scipy.linalg improvementsscipy.linalg.expm now accepts nD arrays. Its speed is also improved.3.7.1.scipy.fft improvementsuarray multimethods for scipy.fft.fht and scipy.fft.ifht
to allow provision of third party backend implementations such as those
recently added to CuPy.scipy.optimize improvementsA new global optimizer, scipy.optimize.direct (DIviding RECTangles algorithm)
was added. For problems with inexpensive function evaluations, like the ones
in the SciPy benchmark suite, direct is competitive with the best other
solvers in SciPy (dual_annealing and differential_evolution) in terms
of execution time. See
gh-14300 <https://github.com/scipy/scipy/pull/14300>__ for more details.
Add a full_output parameter to scipy.optimize.curve_fit to output
additional solution information.
Add a integrality parameter to scipy.optimize.differential_evolution,
enabling integer constraints on parameters.
Add a vectorized parameter to call a vectorized objective function only
once per iteration. This can improve minimization speed by reducing
interpreter overhead from the multiple objective function calls.
The default method of scipy.optimize.linprog is now 'highs'.
Added scipy.optimize.milp, new function for mixed-integer linear
programming.
Added Newton-TFQMR method to newton_krylov.
Added support for the Bounds class in shgo and dual_annealing for
a more uniform API across scipy.optimize.
Added the vectorized keyword to differential_evolution.
approx_fprime now works with vector-valued functions.
scipy.signal improvementsscipy.signal.windows.kaiser_bessel_derived was
added to compute the Kaiser-Bessel derived window.hilbert operations are now faster as a result of more
consistent dtype handling.scipy.sparse improvementscopy parameter to scipy.sparce.csgraph.laplacian. Using inplace
computation with copy=False reduces the memory footprint.dtype parameter to scipy.sparce.csgraph.laplacian for type casting.symmetrized parameter to scipy.sparce.csgraph.laplacian to produce
symmetric Laplacian for directed graphs.form parameter to scipy.sparce.csgraph.laplacian taking one of the
three values: array, or function, or lo determining the format of
the output Laplacian:
array is a numpy array (backward compatible default);function is a pointer to a lambda-function evaluating the
Laplacian-vector or Laplacian-matrix product;lo results in the format of the LinearOperator.scipy.sparse.linalg improvementslobpcg performance improvements for small input cases.scipy.spatial improvementsorder parameter to scipy.spatial.transform.Rotation.from_quat
and scipy.spatial.transform.Rotation.as_quat to specify quaternion format.scipy.stats improvementsscipy.stats.monte_carlo_test performs one-sample Monte Carlo hypothesis
tests to assess whether a sample was drawn from a given distribution. Besides
reproducing the results of hypothesis tests like scipy.stats.ks_1samp,
scipy.stats.normaltest, and scipy.stats.cramervonmises without small sample
size limitations, it makes it possible to perform similar tests using arbitrary
statistics and distributions.
Several scipy.stats functions support new axis (integer or tuple of
integers) and nan_policy ('raise', 'omit', or 'propagate'), and
keepdims arguments.
These functions also support masked arrays as inputs, even if they do not have
a scipy.stats.mstats counterpart. Edge cases for multidimensional arrays,
such as when axis-slices have no unmasked elements or entire inputs are of
size zero, are handled consistently.
Add a weight parameter to scipy.stats.hmean.
Several improvements have been made to scipy.stats.levy_stable. Substantial
improvement has been made for numerical evaluation of the pdf and cdf,
resolving #12658 and
#14944. The improvement is
particularly dramatic for stability parameter alpha close to or equal to 1
and for alpha below but approaching its maximum value of 2. The alternative
fast Fourier transform based method for pdf calculation has also been updated
to use the approach of Wang and Zhang from their 2008 conference paper
Simpson’s rule based FFT method to compute densities of stable distribution,
making this method more competitive with the default method. In addition,
users now have the option to change the parametrization of the Levy Stable
distribution to Nolan's "S0" parametrization which is used internally by
SciPy's pdf and cdf implementations. The "S0" parametrization is described in
Nolan's paper Numerical calculation of stable densities and distribution
functions upon which SciPy's
implementation is based. "S0" has the advantage that delta and gamma
are proper location and scale parameters. With delta and gamma fixed,
the location and scale of the resulting distribution remain unchanged as
alpha and beta change. This is not the case for the default "S1"
parametrization. Finally, more options have been exposed to allow users to
trade off between runtime and accuracy for both the default and FFT methods of
pdf and cdf calculation. More information can be found in the documentation
here (to be linked).
Added scipy.stats.fit for fitting discrete and continuous distributions to
data.
The methods "pearson" and "tippet" from scipy.stats.combine_pvalues
have been fixed to return the correct p-values, resolving
#15373. In addition, the
documentation for scipy.stats.combine_pvalues has been expanded and improved.
Unlike other reduction functions, stats.mode didn't consume the axis
being operated on and failed for negative axis inputs. Both the bugs have been
fixed. Note that stats.mode will now consume the input axis and return an
ndarray with the axis dimension removed.
Replaced implementation of scipy.stats.ncf with the implementation from
Boost for improved reliability.
Add a bits parameter to scipy.stats.qmc.Sobol. It allows to use from 0
to 64 bits to compute the sequence. Default is None which corresponds to
30 for backward compatibility. Using a higher value allow to sample more
points. Note: bits does not affect the output dtype.
Add a integers method to scipy.stats.qmc.QMCEngine. It allows sampling
integers using any QMC sampler.
Improved the fit speed and accuracy of stats.pareto.
Added qrvs method to NumericalInversePolynomial to match the
situation for NumericalInverseHermite.
Faster random variate generation for gennorm and nakagami.
lloyd_centroidal_voronoi_tessellation has been added to allow improved
sample distributions via iterative application of Voronoi diagrams and
centering operations
Add scipy.stats.qmc.PoissonDisk to sample using the Poisson disk sampling
method. It guarantees that samples are separated from each other by a
given radius.
Add scipy.stats.pmean to calculate the weighted power mean also called
generalized mean.
n of several distributions,
use of the distribution moment method with keyword argument n is
deprecated. Keyword n is replaced with keyword order.interval method with keyword arguments
alpha is deprecated. Keyword alpha is replaced with keyword
confidence.'simplex', 'revised simplex', and 'interior-point' methods
of scipy.optimize.linprog are deprecated. Methods highs, highs-ds,
or highs-ipm should be used in new code.stats.mode.
pandas.DataFrame.mode can be used instead.spatial.distance.kulsinski has been deprecated in favor
of spatial.distance.kulczynski1.maxiter keyword of the truncated Newton (TNC) algorithm has been
deprecated in favour of maxfun.vertices keyword of Delauney.qhull now raises a
DeprecationWarning, after having been deprecated in documentation only
for a long time.extradoc keyword of rv_continuous, rv_discrete and
rv_sample now raises a DeprecationWarning, after having been deprecated in
documentation only for a long time.There is an ongoing effort to follow through on long-standing deprecations. The following previously deprecated features are affected:
radius=None to scipy.spatial.SphericalVoronoi now raises an
error (not adding radius defaults to 1, as before).ndim > 1._rvs method of statistical distributions now requires a size
parameter.fillvalue that cannot be cast to the output type in
scipy.signal.convolve2d now raises an error.scipy.spatial.distance now enforces that the input vectors are
one-dimensional.stats.itemfreq.stats.median_absolute_deviation.n_jobs keyword argument and use of k=None from
kdtree.query.right keyword from interpolate.PPoly.extend.debug keyword from scipy.linalg.solve_*._ppform scipy.interpolate.matvec and matmat.mlab truncation mode from cluster.dendrogram.cluster.vq.py_vq2.ftol and xtol from
optimize.minimize(method='Nelder-Mead').signal.windows.hanning.gegv functions from linalg; this raises the minimally
required LAPACK version to 3.7.1.spatial.distance.matching.scipy.random for numpy.random.scipy.misc (docformat,
inherit_docstring_from, extend_notes_in_docstring,
replace_notes_in_docstring, indentcount_lines, filldoc,
unindent_dict, unindent_string).linalg.pinv2.scipy.stats functions now convert np.matrix to np.ndarrays
before the calculation is performed. In this case, the output will be a scalar
or np.ndarray of appropriate shape rather than a 2D np.matrix.
Similarly, while masked elements of masked arrays are still ignored, the
output will be a scalar or np.ndarray rather than a masked array with
mask=False.scipy.optimize.linprog is now 'highs', not
'interior-point' (which is now deprecated), so callback functions and some
options are no longer supported with the default method.scipy.stats.combine_pvalues, the sign of the test statistic returned
for the method "pearson" has been flipped so that higher values of the
statistic now correspond to lower p-values, making the statistic more
consistent with those of the other methods and with the majority of the
literature.scipy.linalg.expm due to historical reasons was using the sparse
implementation and thus was accepting sparse arrays. Now it only works with
nDarrays. For sparse usage, scipy.sparse.linalg.expm needs to be used
explicitly.scipy.stats.circvar has reverted to the one that is
standard in the literature; note that this is not the same as the square of
scipy.stats.circstd.QMCEngine in MultinomialQMC and
MultivariateNormalQMC. It removes the methods fast_forward and reset.MultinomialQMC now require the number of trials with n_trials.
Hence, MultinomialQMC.random output has now the correct shape (n, pvals).F_onewayConstantInputWarning,
F_onewayBadInputSizesWarning, PearsonRConstantInputWarning,
PearsonRNearConstantInputWarning, SpearmanRConstantInputWarning, and
BootstrapDegenerateDistributionWarning) have been replaced with more
general warnings.A draft developer CLI is available for SciPy, leveraging the doit,
click and rich-click tools. For more details, see
gh-15959.
The SciPy contributor guide has been reorganized and updated (see #15947 for details).
QUADPACK Fortran routines in scipy.integrate, which power
scipy.integrate.quad, have been marked as recursive. This should fix rare
issues in multivariate integration (nquad and friends) and obviate the need
for compiler-specific compile flags (/recursive for ifort etc). Please file
an issue if this change turns out problematic for you. This is also true for
FITPACK routines in scipy.interpolate, which power splrep,
splev etc., and *UnivariateSpline and *BivariateSpline classes.
the USE_PROPACK environment variable has been renamed to
SCIPY_USE_PROPACK; setting to a non-zero value will enable
the usage of the PROPACK library as before
Before this release, all subpackages of SciPy (cluster, fft, ndimage,
etc.) had to be explicitly imported. Now, these subpackages are lazily loaded
as soon as they are accessed, so that the following is possible (if desired
for interactive use, it's not actually recommended for code,
see :ref:scipy-api):
import scipy as sp; sp.fft.dct([1, 2, 3]). Advantages include: making it
easier to navigate SciPy in interactive terminals, reducing subpackage import
conflicts (which before required
import networkx.linalg as nla; import scipy.linalg as sla),
and avoiding repeatedly having to update imports during teaching &
experimentation. Also see
the related community specification document.
This is the first release that ships with Meson as
the build system. When installing with pip or pypa/build, Meson will be
used (invoked via the meson-python build hook). This change brings
significant benefits - most importantly much faster build times, but also
better support for cross-compilation and cleaner build logs.
Note:
This release still ships with support for numpy.distutils-based builds
as well. Those can be invoked through the setup.py command-line
interface (e.g., python setup.py install). It is planned to remove
numpy.distutils support before the 1.10.0 release.
When building from source, a number of things have changed compared to building
with numpy.distutils:
meson, ninja, and pkg-config.
setuptools and wheel are no longer needed.pkg-config instead of hardcoded
paths or a site.cfg file.blas-lapack-selection for
details.The two CLIs that can be used to build wheels are pip and build. In
addition, the SciPy repo contains a python dev.py CLI for any kind of
development task (see its --help for details). For a comparison between old
(distutils) and new (meson) build commands, see :ref:meson-faq.
For more information on the introduction of Meson support in SciPy, see
gh-13615 <https://github.com/scipy/scipy/issues/13615>__ and
this blog post <https://labs.quansight.org/blog/2021/07/moving-scipy-to-meson/>__.
A total of 153 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.
SciPy 1.8.1 is a bug-fix release with no new features compared to 1.8.0. Notably, usage of Pythran has been restored for Windows builds/binaries.
SciPy 1.8.1 is a bug-fix release with no new features
compared to 1.8.0. Notably, usage of Pythran has been
restored for Windows builds/binaries.
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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
SciPy 1.8.0 is the culmination of 6 months of hard work. It contains
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.
scipy.sparse.svds with solver='PROPACK'. It is currently
default-off due to potential issues on Windows that we aim to
resolve in the next release, but can be optionally enabled at runtime for
friendly testing with an environment variable setting of USE_PROPACK=1.scipy.stats.sampling submodule that leverages the UNU.RAN C
library to sample from arbitrary univariate non-uniform continuous and
discrete distributionsscipy.fft improvementsAdded 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 improvementsscipy.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 improvementsscipy.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 improvementsscipy.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 improvementsscipy.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 improvementsAdd 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 improvementsAn 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. PROPACK
functionality is currently opt-in--you must specify USE_PROPACK=1 at
runtime to use it due to potential issues on Windows
that we aim to resolve in the next release.
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 improvementsscipy.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 improvementsThe 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 improvementsscipy.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:
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.
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.splinescipy.ndimage.filtersscipy.ndimage.fourierscipy.ndimage.measurementsscipy.ndimage.morphologyscipy.ndimage.interpolationscipy.sparse.linalg.solvescipy.sparse.linalg.eigenscipy.sparse.linalg.isolveAll 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.
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.
here <https://docs.scipy.org/doc/scipy/reference/dev/toolchain.html>_.scipy.stats.binned_statistic with the builtin
'std' metric is now nan, for consistency with np.std.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.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.
A total of 139 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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
Note: SciPy 1.8.0 is not released yet!
SciPy 1.8.0 is the culmination of 6 months of hard work. It contains
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.
scipy.sparse.svds with solver='PROPACK'. It is currently
default-off due to potential issues on Windows that we aim to
resolve in the next release, but can be optionally enabled at runtime for
friendly testing with an environment variable setting of USE_PROPACK=1.scipy.stats.sampling submodule that leverages the UNU.RAN C
library to sample from arbitrary univariate non-uniform continuous and
discrete distributionsscipy.fft improvementsAdded 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 improvementsscipy.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 improvementsscipy.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 improvementsscipy.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 improvementsscipy.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 improvementsAdd 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 improvementsAn 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. PROPACK
functionality is currently opt-in--you must specify USE_PROPACK=1 at
runtime to use it due to potential issues on Windows
that we aim to resolve in the next release.
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 improvementsscipy.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 improvementsThe 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 improvementsscipy.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:
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.
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.splinescipy.ndimage.filtersscipy.ndimage.fourierscipy.ndimage.measurementsscipy.ndimage.morphologyscipy.ndimage.interpolationscipy.sparse.linalg.solvescipy.sparse.linalg.eigenscipy.sparse.linalg.isolveAll 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.
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.
here <https://docs.scipy.org/doc/scipy/reference/dev/toolchain.html>_.scipy.stats.binned_statistic with the builtin
'std' metric is now nan, for consistency with np.std.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.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.
A total of 139 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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
Note: SciPy 1.8.0 is not released yet!
SciPy 1.8.0 is the culmination of 6 months of hard work. It contains
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.
scipy.sparse.svds with solver='PROPACK'. It is currently
default-off due to potential issues on Windows that we aim to
resolve in the next release, but can be optionally enabled at runtime for
friendly testing with an environment variable setting of USE_PROPACK=1.scipy.stats.sampling submodule that leverages the UNU.RAN C
library to sample from arbitrary univariate non-uniform continuous and
discrete distributionsscipy.fft improvementsAdded 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 improvementsscipy.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 improvementsscipy.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 improvementsscipy.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 improvementsscipy.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 improvementsAdd 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 improvementsAn 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.
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. PROPACK
functionality is currently opt-in--you must specify USE_PROPACK=1 at
runtime to use it due to potential issues on Windows
that we aim to resolve in the next release.
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 improvementsscipy.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 improvementsThe 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 improvementsscipy.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:
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.
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.splinescipy.ndimage.filtersscipy.ndimage.fourierscipy.ndimage.measurementsscipy.ndimage.morphologyscipy.ndimage.interpolationscipy.sparse.linalg.solvescipy.sparse.linalg.eigenscipy.sparse.linalg.isolveAll 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.
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.
here <https://docs.scipy.org/doc/scipy/reference/dev/toolchain.html>_.scipy.stats.binned_statistic with the builtin
'std' metric is now nan, for consistency with np.std.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.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.
A total of 139 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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
Note: SciPy 1.8.0 is not released yet!
SciPy 1.8.0 is the culmination of 6 months of hard work. It contains
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.
scipy.sparse.svds with solver='PROPACK'.scipy.stats.sampling submodule that leverages the UNU.RAN C
library to sample from arbitrary univariate non-uniform continuous and
discrete distributionsscipy.fft improvementsAdded 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 improvementsscipy.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 improvementsscipy.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 improvementsscipy.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 improvementsscipy.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 improvementsAdd 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 improvementsAn 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 improvementsscipy.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 improvementsThe 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 improvementsscipy.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:
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.
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.splinescipy.ndimage.filtersscipy.ndimage.fourierscipy.ndimage.measurementsscipy.ndimage.morphologyscipy.ndimage.interpolationscipy.sparse.linalg.solvescipy.sparse.linalg.eigenscipy.sparse.linalg.isolveAll 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.
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.
here <https://docs.scipy.org/doc/scipy/reference/dev/toolchain.html>_.scipy.stats.binned_statistic with the builtin
'std' metric is now nan, for consistency with np.std.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.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.
A total of 133 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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
Note: SciPy 1.8.0 is not released yet!
SciPy 1.8.0 is the culmination of 6 months of hard work. It contains
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.
scipy.sparse.svds with solver='PROPACK'.scipy.stats.sampling submodule that leverages the UNU.RAN C
library to sample from arbitrary univariate non-uniform continuous and
discrete distributionsscipy.fft improvementsAdded 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 improvementsscipy.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 improvementsscipy.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 improvementsscipy.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 improvementsscipy.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 improvementsAdd 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 improvementsAn 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 improvementsscipy.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 improvementsThe 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 improvementsscipy.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:
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.
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.splinescipy.ndimage.filtersscipy.ndimage.fourierscipy.ndimage.measurementsscipy.ndimage.morphologyscipy.ndimage.interpolationscipy.sparse.linalg.solvescipy.sparse.linalg.eigenscipy.sparse.linalg.isolveAll 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.
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.
here <https://docs.scipy.org/doc/scipy/reference/dev/toolchain.html>_.scipy.stats.binned_statistic with the builtin
'std' metric is now nan, for consistency with np.std.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.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.
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.
SciPy 1.7.3 is a bug-fix release that provides binary wheels for MacOS arm64 with Python 3.8, 3.9, and 3.10. The MacOS arm64 wheels are only available
SciPy 1.7.3 is a bug-fix release that provides binary wheels
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.
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.
SciPy 1.7.2 is a bug-fix release with no new features compared to 1.7.1. Notably, the release includes wheels for Python 3.10, and wheels are now buil
SciPy 1.7.2 is a bug-fix release with no new features
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.
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.
SciPy 1.7.1 is a bug-fix release with no new features compared to 1.7.0.
SciPy 1.7.1 is a bug-fix release with no new features
compared to 1.7.0.
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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
SciPy 1.7.0 is the culmination of 6 months of hard work. It contains
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.
scipy.stats.qmc, was addedscipy.statsscipy.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 frameworkRBFInterpolator, 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.
scipy.cluster improvementsAn optional argument, seed, has been added to kmeans and kmeans2 to
set the random generator and random state.
scipy.interpolate improvementsImproved 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 improvementsAn LAPACK wrapper was added for access to the tgexc subroutine.
scipy.ndimage improvementsscipy.ndimage.affine_transform is now able to infer the output_shape from
the out array.
scipy.optimize improvementsThe 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 improvementsget_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 improvementsAddition of dia_matrix sparse matrices is now faster.
scipy.spatial improvementsdistance.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 improvementsWright'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 improvementsThe 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.
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.
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.
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.
scipy.stats.qmc moduleThis 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.scipy.linalg deprecationsscipy.linalg.pinv2 is deprecated and its functionality is completely
subsumed into scipy.linalg.pinvrcond, 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 deprecationsscipy.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.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:
alternative=None was deprecated; explicit
alternative specification was required. Use of the new default value of
alternative, "two-sided", is now permitted.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 :ref:quickstart-gitpod.
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.
SciPy 1.6.3 is a bug-fix release with no new features compared to 1.6.2.
SciPy 1.6.3 is a bug-fix release with no new features
compared to 1.6.2.
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.
SciPy 1.6.2 is a bug-fix release with no new features compared to 1.6.1. This is also the first SciPy release to place upper bounds on some dependenci
SciPy 1.6.2 is a bug-fix release with no new features
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.
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.
SciPy 1.6.1 is a bug-fix release with no new features compared to 1.6.0.
SciPy 1.6.1 is a bug-fix release with no new features
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.
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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
SciPy 1.6.0 is the culmination of 6 months of hard work. It contains
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.
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 testsscipy.special improvementsscipy.special now has improved support for 64-bit LAPACK backend
scipy.odr improvementsscipy.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 improvementsSome 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.simpsonintegrate.trapz was renamed to integrate.trapezoidintegrate.cumtrapz was renamed to integrate.cumulative_trapezoidscipy.cluster improvementsscipy.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 improvementsscipy.interpolate.interp1d has a new method nearest-up, similar to the
existing method nearest but rounds half-integers up instead of down.
scipy.io improvementsSupport 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 improvementsThe 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 improvementsscipy.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 improvementsscipy.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 improvementsscipy.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 improvementsA 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 improvementsThe vendored version of SuperLU has been updated
scipy.fft improvementsThe vendored pocketfft library now supports compiling with ARM neon vector
extensions and has improved thread pool behavior.
scipy.spatial improvementsThe 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 improvementsNew distributions have been added to scipy.stats:
scipy.stats.laplace_asymmetric.scipy.stats.nhypergeom.scipy.stats.multivariate_t.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.
scipy.spatial changesCalling 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.
scipy changesUsing 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 changesThe 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 changescKDTree.query now returns 64-bit rather than 32-bit integers on Windows,
making behaviour consistent between platforms (PR gh-12673).
scipy.stats changesThe frechet_l and frechet_r distributions were removed. They were
deprecated since SciPy 1.0.
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.
scipy.optimize.dual_annealing accept_reject calculation
that caused uphill jumps to be accepted less frequently.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.A total of 122 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.
SciPy 1.5.4 is a bug-fix release with no new features compared to 1.5.3. Importantly, wheels are now available for Python 3.9 and a more complete fix
SciPy 1.5.4 is a bug-fix release with no new features
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.
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.
SciPy 1.5.3 is a bug-fix release with no new features compared to 1.5.2. In particular, Linux ARM64 wheels are now available and a compatibility issue
SciPy 1.5.3 is a bug-fix release with no new features
compared to 1.5.2. In particular, Linux ARM64 wheels are now
available and a compatibility issue with XCode 12 has
been fixed.
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.
SciPy 1.5.2 is a bug-fix release with no new features compared to 1.5.1.
SciPy 1.5.2 is a bug-fix release with no new features
compared to 1.5.1.
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.
SciPy 1.5.1 is a bug-fix release with no new features compared to 1.5.0. In particular, an issue where DLL loading can fail for SciPy wheels on Window
SciPy 1.5.1 is a bug-fix release with no new features
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.
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.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
SciPy 1.5.0 is the culmination of 6 months of hard work. It contains
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.
LAPACK routines are now available
in scipy.linalg.lapackscipy.cluster improvementsInitialization 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 improvementsA 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 improvementsscipy.interpolate improvementsscipy.io improvementsscipy.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 improvementsscipy.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
matrixGeneralized 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 improvementsscipy.optimize improvementsThe finite difference numerical differentiation used in various minimize
methods that use gradients has several new features:
minimize method uses bounds the numerical differentiation strictly
obeys those limits.minimize's method= 'powell' now supports simple bound constraintsThere have been several improvements to scipy.optimize.linprog:
linprog benchmark suite has been expanded considerably.linprog's dense pivot-based redundancy removal routine and sparse
presolve are fasterscikit-sparse is available, solving sparse problems with
method='interior-point' is fasterThe 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 improvementsA 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 improvementsOuter 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 improvementsscipy.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 improvementsThe following functions now have Cython interfaces in cython_special:
scipy.special.erfinvscipy.special.erfcinvscipy.special.spherical_jnscipy.special.spherical_ynscipy.special.spherical_inscipy.special.spherical_knscipy.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 improvementsThe 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 % forpdf()``
scipy.stats.shapiro and scipy.stats.jarque_bera now return a named tuple
for greater consistency with other stats functions
scipy deprecationsscipy.special changesThe bdtr, bdtrc, and bdtri functions are deprecating non-negative
non-integral n arguments.
scipy.stats changesThe 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.
scipy.interpolate changesscipy.linalg changesThe output signatures of ?syevr, ?heevr have been changed from
w, v, info to w, v, m, isuppz, info
The order of output arguments w, v of <sy/he>{gv, gvd, gvx} is
swapped.
scipy.signal changesThe output length of scipy.signal.upfirdn has been corrected, resulting
outputs may now be shorter for some combinations of up/down ratios and input
signal and filter lengths.
scipy.signal.resample now supports a domain keyword argument for
specification of time or frequency domain input.
scipy.stats changesImproved support for leveraging 64-bit integer size from linear algebra backends in several parts of the SciPy codebase.
Shims designed to ensure the compatibility of SciPy with Python 2.7 have now been removed.
Many warnings due to unused imports and unused assignments have been addressed.
Many usage examples were added to function docstrings, and many input validations and intuitive exception messages have been added throughout the codebase.
Early stage adoption of type annotations in a few parts of the codebase
A total of 129 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.
SciPy 1.4.1 is a bug-fix release with no new features compared to 1.4.0. Importantly, it aims to fix a problem where an older version of pybind11 may
SciPy 1.4.1 is a bug-fix release with no new features
compared to 1.4.0. Importantly, it aims to fix a problem
where an older version of pybind11 may cause a segmentation
fault when imported alongside incompatible libraries.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
SciPy 1.4.0 is the culmination of 6 months of hard work. It contains
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.4.x branch, and on adding new features on the master branch.
This release requires Python 3.5+ and NumPy >=1.13.3 (for Python 3.5, 3.6),
>=1.14.5 (for Python 3.7), >= 1.17.3 (for Python 3.8)
For running on PyPy, PyPy3 6.0+ and NumPy 1.15.0 are required.
scipy.fft, now supersedes scipy.fftpack; this
means support for long double transforms, faster multi-dimensional
transforms, improved algorithm time complexity, release of the global
intepreter lock, and control over threading behaviorpydata/sparse arrays in scipy.sparse.linalgscipy.special functions, and some new additionsscipy.statsscipy.sparse.csgraph.maximum_flowscipy.spatial.SphericalVoronoi now supports n-dimensional input,
has linear memory complexity, improved performance, and
supports single-hemisphere generatorsDocumentation can now be built with runtests.py --doc
A Dockerfile is now available in the scipy/scipy-dev repository to
facilitate getting started with SciPy development.
scipy.constants improvementsscipy.constants has been updated with the CODATA 2018 constants.
scipy.fft addedscipy.fft is a new submodule that supersedes the scipy.fftpack submodule.
For the most part, this is a drop-in replacement for numpy.fft and
scipy.fftpack alike. With some important differences, scipy.fft:
rfft). This means the
return value is a complex array, half the size of the full fft output.
This is different from the output of fftpack which returned a real array
representing complex components packed together.idct and idst) are normalized
for norm=None in thesame way as ifft. This means the identity
idct(dct(x)) == x is now True for all norm modes.fftpack.This submodule is based on the pypocketfft library, developed by the
author of pocketfft which was recently adopted by NumPy as well.
pypocketfft offers a number of advantages over fortran FFTPACK:
np.longfloat) precision transforms.O(n^2) complexity of
FFTPACKGIL) is released during transformsworkers
argumentNote that scipy.fftpack has not been deprecated and will continue to be
maintained but is now considered legacy. New code is recommended to use
scipy.fft instead, where possible.
scipy.fftpack improvementsscipy.fftpack now uses pypocketfft to perform its FFTs, offering the same
speed and accuracy benefits listed for scipy.fft above but without the
improved API.
scipy.integrate improvementsThe function scipy.integrate.solve_ivp now has an args argument.
This allows the user-defined functions passed to the function to have
additional parameters without having to create wrapper functions or
lambda expressions for them.
scipy.integrate.solve_ivp can now return a y_events attribute
representing the solution of the ODE at event times
New OdeSolver is implemented --- DOP853. This is a high-order explicit
Runge-Kutta method originally implemented in Fortran. Now we provide a pure
Python implementation usable through solve_ivp with all its features.
scipy.integrate.quad provides better user feedback when break points are
specified with a weighted integrand.
scipy.integrate.quad_vec is now available for general purpose integration
of vector-valued functions
scipy.interpolate improvementsscipy.interpolate.pade now handles complex input data gracefully
scipy.interpolate.Rbf can now interpolate multi-dimensional functions
scipy.io improvementsscipy.io.wavfile.read can now read data from a WAV file that has a
malformed header, similar to other modern WAV file parsers
scipy.io.FortranFile now has an expanded set of available Exception
classes for handling poorly-formatted files
scipy.linalg improvementsThe function scipy.linalg.subspace_angles(A, B) now gives correct
results for complex-valued matrices. Before this, the function only returned
correct values for real-valued matrices.
New boolean keyword argument check_finite for scipy.linalg.norm; whether
to check that the input matrix contains only finite numbers. Disabling may
give a performance gain, but may result in problems (crashes, non-termination)
if the inputs do contain infinities or NaNs.
scipy.linalg.solve_triangular has improved performance for a C-ordered
triangular matrix
LAPACK wrappers have been added for ?geequ, ?geequb, ?syequb,
and ?heequb
Some performance improvements may be observed due to an internal optimization
in operations involving LAPACK routines via _compute_lwork. This is
particularly true for operations on small arrays.
Block QR wrappers are now available in scipy.linalg.lapack
scipy.ndimage improvementsscipy.optimize improvementsIt is now possible to use linear and non-linear constraints with
scipy.optimize.differential_evolution.
scipy.optimize.linear_sum_assignment has been re-written in C++ to improve
performance, and now allows input costs to be infinite.
A ScalarFunction.fun_and_grad method was added for convenient simultaneous
retrieval of a function and gradient evaluation
scipy.optimize.minimize BFGS method has improved performance by avoiding
duplicate evaluations in some cases
Better user feedback is provided when an objective function returns an array instead of a scalar.
scipy.signal improvementsAdded a new function to calculate convolution using the overlap-add method,
named scipy.signal.oaconvolve. Like scipy.signal.fftconvolve, this
function supports specifying dimensions along which to do the convolution.
scipy.signal.cwt now supports complex wavelets.
The implementation of choose_conv_method has been updated to reflect the
new FFT implementation. In addition, the performance has been significantly
improved (with rather drastic improvements in edge cases).
The function upfirdn now has a mode keyword argument that can be used
to select the signal extension mode used at the signal boundaries. These modes
are also available for use in resample_poly via a newly added padtype
argument.
scipy.signal.sosfilt now benefits from Cython code for improved performance
scipy.signal.resample should be more efficient by leveraging rfft when
possible
scipy.sparse improvementsIt is now possible to use the LOBPCG method in scipy.sparse.linalg.svds.
scipy.sparse.linalg.LinearOperator now supports the operation rmatmat
for adjoint matrix-matrix multiplication, in addition to rmatvec.
Multiple stability updates enable float32 support in the LOBPCG eigenvalue
solver for symmetric and Hermitian eigenvalues problems in
scipy.sparse.linalg.lobpcg.
A solver for the maximum flow problem has been added as
scipy.sparse.csgraph.maximum_flow.
scipy.sparse.csgraph.maximum_bipartite_matching now allows non-square inputs,
no longer requires a perfect matching to exist, and has improved performance.
scipy.sparse.lil_matrix conversions now perform better in some scenarios
Basic support is available for pydata/sparse arrays in
scipy.sparse.linalg
scipy.sparse.linalg.spsolve_triangular now supports the unit_diagonal
argument to improve call signature similarity with its dense counterpart,
scipy.linalg.solve_triangular
assertAlmostEqual may now be used with sparse matrices, which have added
support for __round__
scipy.spatial improvementsThe bundled Qhull library was upgraded to version 2019.1, fixing several issues. Scipy-specific patches are no longer applied to it.
scipy.spatial.SphericalVoronoi now has linear memory complexity, improved
performance, and supports single-hemisphere generators. Support has also been
added for handling generators that lie on a great circle arc (geodesic input)
and for generators in n-dimensions.
scipy.spatial.transform.Rotation now includes functions for calculation of a
mean rotation, generation of the 3D rotation groups, and reduction of rotations
with rotational symmetries.
scipy.spatial.transform.Slerp is now callable with a scalar argument
scipy.spatial.voronoi_plot_2d now supports furthest site Voronoi diagrams
scipy.spatial.Delaunay and scipy.spatial.Voronoi now have attributes
for tracking whether they are furthest site diagrams
scipy.special improvementsThe Voigt profile has been added as scipy.special.voigt_profile.
A real dispatch has been added for the Wright Omega function
(scipy.special.wrightomega).
The analytic continuation of the Riemann zeta function has been added. (The
Riemann zeta function is the one-argument variant of scipy.special.zeta.)
The complete elliptic integral of the first kind (scipy.special.ellipk) is
now available in scipy.special.cython_special.
The accuracy of scipy.special.hyp1f1 for real arguments has been improved.
The documentation of many functions has been improved.
scipy.stats improvementsscipy.stats.multiscale_graphcorr added as an independence test that
operates on high dimensional and nonlinear data sets. It has higher statistical
power than other scipy.stats tests while being the only one that operates on
multivariate data.
The generalized inverse Gaussian distribution (scipy.stats.geninvgauss) has
been added.
It is now possible to efficiently reuse scipy.stats.binned_statistic_dd
with new values by providing the result of a previous call to the function.
scipy.stats.hmean now handles input with zeros more gracefully.
The beta-binomial distribution is now available in scipy.stats.betabinom.
scipy.stats.zscore, scipy.stats.circmean, scipy.stats.circstd, and
scipy.stats.circvar now support the nan_policy argument for enhanced
handling of NaN values
scipy.stats.entropy now accepts an axis argument
scipy.stats.gaussian_kde.resample now accepts a seed argument to empower
reproducibility
scipy.stats.kendalltau performance has improved, especially for large inputs,
due to improved cache usage
scipy.stats.truncnorm distribution has been rewritten to support much wider
tails
scipy deprecationsSupport for NumPy functions exposed via the root SciPy namespace is deprecated
and will be removed in 2.0.0. For example, if you use scipy.rand or
scipy.diag, you should change your code to directly use
numpy.random.default_rng or numpy.diag, respectively.
They remain available in the currently continuing Scipy 1.x release series.
The exception to this rule is using scipy.fft as a function --
:mod:scipy.fft is now meant to be used only as a module, so the ability to
call scipy.fft(...) will be removed in SciPy 1.5.0.
In scipy.spatial.Rotation methods from_dcm, as_dcm were renamed to
from_matrix, as_matrix respectively. The old names will be removed in
SciPy 1.6.0.
Method Rotation.match_vectors was deprecated in favor of
Rotation.align_vectors, which provides a more logical and
general API to the same functionality. The old method
will be removed in SciPy 1.6.0.
scipy.special changesThe deprecated functions hyp2f0, hyp1f2, and hyp3f0 have been
removed.
The deprecated function bessel_diff_formula has been removed.
The function i0 is no longer registered with numpy.dual, so that
numpy.dual.i0 will unconditionally refer to the NumPy version regardless
of whether scipy.special is imported.
The function expn has been changed to return nan outside of its
domain of definition (x, n < 0) instead of inf.
scipy.sparse changesSparse matrix reshape now raises an error if shape is not two-dimensional, rather than guessing what was meant. The behavior is now the same as before SciPy 1.1.0.
CSR and CSC sparse matrix classes should now return empty matrices
of the same type when indexed out of bounds. Previously, for some versions
of SciPy, this would raise an IndexError. The change is largely motivated
by greater consistency with ndarray and numpy.matrix semantics.
scipy.signal changesscipy.signal.resample behavior for length-1 signal inputs has been
fixed to output a constant (DC) value rather than an impulse, consistent with
the assumption of signal periodicity in the FFT method.
scipy.signal.cwt now performs complex conjugation and time-reversal of
wavelet data, which is a backwards-incompatible bugfix for
time-asymmetric wavelets.
scipy.stats changesscipy.stats.loguniform added with better documentation as (an alias for
scipy.stats.reciprocal). loguniform generates random variables
that are equally likely in the log space; e.g., 1, 10 and 100
are all equally likely if loguniform(10 ** 0, 10 ** 2).rvs() is used.
The LSODA method of scipy.integrate.solve_ivp now correctly detects stiff
problems.
scipy.spatial.cKDTree now accepts and correctly handles empty input data
scipy.stats.binned_statistic_dd now calculates the standard deviation
statistic in a numerically stable way.
scipy.stats.binned_statistic_dd now throws an error if the input data
contains either np.nan or np.inf. Similarly, in scipy.stats now all
continuous distributions' .fit() methods throw an error if the input data
contain any instance of either np.nan or np.inf.
A total of 142 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.
SciPy 1.3.3 is a bug-fix release with no new features compared to 1.3.2. In particular, a test suite issue involving multiprocessing was fixed for Win
SciPy 1.3.3 is a bug-fix release with no new features
compared to 1.3.2. In particular, a test suite issue
involving multiprocessing was fixed for Windows and
Python 3.8 on macOS.
Wheels were also updated to place msvcp140.dll at the
appropriate location, which was previously causing issues.
Ilhan Polat Tyler Reddy Ralf Gommers
SciPy 1.3.2 is a bug-fix and maintenance release that adds support for Python 3.8.
SciPy 1.3.2 is a bug-fix and maintenance release that adds support for Python 3.8.
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.
SciPy 1.3.1 is a bug-fix release with no new features compared to 1.3.0.
SciPy 1.3.1 is a bug-fix release with no new features compared to 1.3.0.
A total of 15 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.
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 -…
SciPy 1.3.0 is the culmination of 5 months of hard work. It contains
many new features, numerous bug-fixes, improved test coverage and better
documentation. There have been some API changes
in this release, which are documented below. All users are encouraged to
upgrade to this release, as there are a large number of bug-fixes and
optimizations. Before upgrading, we recommend that users check that
their own code does not use deprecated SciPy functionality (to do so,
run your code with python -Wd and check for DeprecationWarning s).
Our development attention will now shift to bug-fix releases on the
1.3.x branch, and on adding new features on the master branch.
This release requires Python 3.5+ and NumPy 1.13.3 or greater.
For running on PyPy, PyPy3 6.0+ and NumPy 1.15.0 are required.
stats functions, a rewrite of pearsonr, and an exact
computation of the Kolmogorov-Smirnov two-sample testscipy.optimizeCSR and CSC sparse matrix indexing performance
improvementsRotationSplinescipy.interpolate improvementsA new class CubicHermiteSpline is introduced. It is a piecewise-cubic
interpolator which matches observed values and first derivatives. Existing
cubic interpolators CubicSpline, PchipInterpolator and
Akima1DInterpolator were made subclasses of CubicHermiteSpline.
scipy.io improvementsFor the Attribute-Relation File Format (ARFF) scipy.io.arff.loadarff
now supports relational attributes.
scipy.io.mmread can now parse Matrix Market format files with empty lines.
scipy.linalg improvementsAdded wrappers for ?syconv routines, which convert a symmetric matrix
given by a triangular matrix factorization into two matrices and vice versa.
scipy.linalg.clarkson_woodruff_transform now uses an algorithm that leverages
sparsity. This may provide a 60-90 percent speedup for dense input matrices.
Truly sparse input matrices should also benefit from the improved sketch
algorithm, which now correctly runs in O(nnz(A)) time.
Added new functions to calculate symmetric Fiedler matrices and
Fiedler companion matrices, named scipy.linalg.fiedler and
scipy.linalg.fiedler_companion, respectively. These may be used
for root finding.
scipy.ndimage improvementsGaussian filter performances may improve by an order of magnitude in
some cases, thanks to removal of a dependence on np.polynomial. This
may impact scipy.ndimage.gaussian_filter for example.
scipy.optimize improvementsThe scipy.optimize.brute minimizer obtained a new keyword workers, which
can be used to parallelize computation.
A Cython API for bounded scalar-function root-finders in scipy.optimize
is available in a new module scipy.optimize.cython_optimize via cimport.
This API may be used with nogil and prange to loop
over an array of function arguments to solve for an array of roots more
quickly than with pure Python.
'interior-point' is now the default method for linprog, and
'interior-point' now uses SuiteSparse for sparse problems when the
required scikits (scikit-umfpack and scikit-sparse) are available.
On benchmark problems (gh-10026), execution time reductions by factors of 2-3
were typical. Also, a new method='revised simplex' has been added.
It is not as fast or robust as method='interior-point', but it is a faster,
more robust, and equally accurate substitute for the legacy
method='simplex'.
differential_evolution can now use a Bounds class to specify the
bounds for the optimizing argument of a function.
scipy.optimize.dual_annealing performance improvements related to
vectorisation of some internal code.
scipy.signal improvementsTwo additional methods of discretization are now supported by
scipy.signal.cont2discrete: impulse and foh.
scipy.signal.firls now uses faster solvers
scipy.signal.detrend now has a lower physical memory footprint in some
cases, which may be leveraged using the new overwrite_data keyword argument
scipy.signal.firwin pass_zero argument now accepts new string arguments
that allow specification of the desired filter type: 'bandpass',
'lowpass', 'highpass', and 'bandstop'
scipy.signal.sosfilt may have improved performance due to lower retention
of the global interpreter lock (GIL) in algorithm
scipy.sparse improvementsA new keyword was added to csgraph.dijsktra that
allows users to query the shortest path to ANY of the passed in indices,
as opposed to the shortest path to EVERY passed index.
scipy.sparse.linalg.lsmr performance has been improved by roughly 10 percent
on large problems
Improved performance and reduced physical memory footprint of the algorithm
used by scipy.sparse.linalg.lobpcg
CSR and CSC sparse matrix fancy indexing performance has been
improved substantially
scipy.spatial improvementsscipy.spatial.ConvexHull now has a good attribute that can be used
alongsize the QGn Qhull options to determine which external facets of a
convex hull are visible from an external query point.
scipy.spatial.cKDTree.query_ball_point has been modernized to use some newer
Cython features, including GIL handling and exception translation. An issue
with return_sorted=True and scalar queries was fixed, and a new mode named
return_length was added. return_length only computes the length of the
returned indices list instead of allocating the array every time.
scipy.spatial.transform.RotationSpline has been added to enable interpolation
of rotations with continuous angular rates and acceleration
scipy.stats improvementsAdded a new function to compute the Epps-Singleton test statistic,
scipy.stats.epps_singleton_2samp, which can be applied to continuous and
discrete distributions.
New functions scipy.stats.median_absolute_deviation and scipy.stats.gstd
(geometric standard deviation) were added. The scipy.stats.combine_pvalues
method now supports pearson, tippett and mudholkar_george pvalue
combination methods.
The scipy.stats.ortho_group and scipy.stats.special_ortho_group
rvs(dim) functions' algorithms were updated from a O(dim^4)
implementation to a O(dim^3) which gives large speed improvements
for dim>100.
A rewrite of scipy.stats.pearsonr to use a more robust algorithm,
provide meaningful exceptions and warnings on potentially pathological input,
and fix at least five separate reported issues in the original implementation.
Improved the precision of hypergeom.logcdf and hypergeom.logsf.
Added exact computation for Kolmogorov-Smirnov (KS) two-sample test, replacing
the previously approximate computation for the two-sided test stats.ks_2samp.
Also added a one-sided, two-sample KS test, and a keyword alternative to
stats.ks_2samp.
scipy.interpolate changesFunctions from scipy.interpolate (spleval, spline, splmake,
and spltopp) and functions from scipy.misc (bytescale,
fromimage, imfilter, imread, imresize, imrotate,
imsave, imshow, toimage) have been removed. The former set has
been deprecated since v0.19.0 and the latter has been deprecated since v1.0.0.
Similarly, aliases from scipy.misc (comb, factorial,
factorial2, factorialk, logsumexp, pade, info, source,
who) which have been deprecated since v1.0.0 are removed.
SciPy documentation for v1.1.0 <https://docs.scipy.org/doc/scipy-1.1.0/reference/misc.html>__
can be used to track the new import locations for the relocated functions.
scipy.linalg changesFor pinv, pinv2, and pinvh, the default cutoff values are changed
for consistency (see the docs for the actual values).
scipy.optimize changesThe default method for linprog is now 'interior-point'. The method's
robustness and speed come at a cost: solutions may not be accurate to
machine precision or correspond with a vertex of the polytope defined
by the constraints. To revert to the original simplex method,
include the argument method='simplex'.
scipy.stats changesPreviously, ks_2samp(data1, data2) would run a two-sided test and return
the approximated p-value. The new signature, ks_2samp(data1, data2, alternative="two-sided", method="auto"), still runs the two-sided test by
default but returns the exact p-value for small samples and the approximated
value for large samples. method="asymp" would be equivalent to the
old version but auto is the better choice.
Our tutorial has been expanded with a new section on global optimizers
There has been a rework of the stats.distributions tutorials.
scipy.optimize now correctly sets the convergence flag of the result to
CONVERR, a convergence error, for bounded scalar-function root-finders
if the maximum iterations has been exceeded, disp is false, and
full_output is true.
scipy.optimize.curve_fit no longer fails if xdata and ydata dtypes
differ; they are both now automatically cast to float64.
scipy.ndimage functions including binary_erosion, binary_closing, and
binary_dilation now require an integer value for the number of iterations,
which alleviates a number of reported issues.
Fixed normal approximation in case zero_method == "pratt" in
scipy.stats.wilcoxon.
Fixes for incorrect probabilities, broadcasting issues and thread-safety
related to stats distributions setting member variables inside _argcheck().
scipy.optimize.newton now correctly raises a RuntimeError, when default
arguments are used, in the case that a derivative of value zero is obtained,
which is a special case of failing to converge.
A draft toolchain roadmap is now available, laying out a compatibility plan including Python versions, C standards, and NumPy versions.
A total of 97 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.
SciPy 1.2.3 is a bug-fix release with no new features compared to 1.2.2. It is part of the long-term support (LTS) release series for Python 2.7.
SciPy 1.2.3 is a bug-fix release with no new features compared to 1.2.2. It is
part of the long-term support (LTS) release series for Python 2.7.
SciPy 1.2.2 is a bug-fix release with no new features compared to 1.2.1. Importantly, the SciPy 1.2.2 wheels are built with OpenBLAS 0.3.7.dev to alle
SciPy 1.2.2 is a bug-fix release with no new features compared to 1.2.1.
Importantly, the SciPy 1.2.2 wheels are built with OpenBLAS 0.3.7.dev to
alleviate issues with SkylakeX AVX512 kernels.
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.
SciPy 1.2.1 is a bug-fix release with no new features compared to 1.2.0. Most importantly, it solves the issue that 1.2.0 cannot be installed from sou
SciPy 1.2.1 is a bug-fix release with no new features compared to 1.2.0.
Most importantly, it solves the issue that 1.2.0 cannot be installed
from source on Python 2.7 because of non-ASCII character issues.
It is also notable that SciPy 1.2.1 wheels were built with OpenBLAS
0.3.5.dev, which may alleviate some linear algebra issues observed
in SciPy 1.2.0.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
SciPy 1.2.0 is the culmination of 6 months of hard work. It contains
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.2.x branch, and on adding new features on the master branch.
This release requires Python 2.7 or 3.4+ and NumPy 1.8.2 or greater.
Note: This will be the last SciPy release to support Python 2.7. Consequently, the 1.2.x series will be a long term support (LTS) release; we will backport bug fixes until 1 Jan 2020.
For running on PyPy, PyPy3 6.0+ and NumPy 1.15.0 are required.
toms748, and a new
unified interface, root_scalardual_annealing optimization method that combines stochastic and
local deterministic searchingshgo (simplicial homology
global optimization) for derivative free optimization problemsscipy.spatial.transformscipy.ndimage improvementsProper spline coefficient calculations have been added for the mirror,
wrap, and reflect modes of scipy.ndimage.rotate
scipy.fftpack improvementsDCT-IV, DST-IV, DCT-I, and DST-I orthonormalization are now supported in
scipy.fftpack.
scipy.interpolate improvementsscipy.interpolate.pade now accepts a new argument for the order of the
numerator
scipy.cluster improvementsscipy.cluster.vq.kmeans2 gained a new initialization method, kmeans++.
scipy.special improvementsThe function softmax was added to scipy.special.
scipy.optimize improvementsThe one-dimensional nonlinear solvers have been given a unified interface
scipy.optimize.root_scalar, similar to the scipy.optimize.root interface
for multi-dimensional solvers. scipy.optimize.root_scalar(f, bracket=[a ,b], method="brenth") is equivalent to scipy.optimize.brenth(f, a ,b). If no
method is specified, an appropriate one will be selected based upon the
bracket and the number of derivatives available.
The so-called Algorithm 748 of Alefeld, Potra and Shi for root-finding within
an enclosing interval has been added as scipy.optimize.toms748. This provides
guaranteed convergence to a root with convergence rate per function evaluation
of approximately 1.65 (for sufficiently well-behaved functions.)
differential_evolution now has the updating and workers keywords.
The first chooses between continuous updating of the best solution vector (the
default), or once per generation. Continuous updating can lead to faster
convergence. The workers keyword accepts an int or map-like callable,
and parallelises the solver (having the side effect of updating once per
generation). Supplying an int evaluates the trial solutions in N parallel
parts. Supplying a map-like callable allows other parallelisation approaches
(such as mpi4py, or joblib) to be used.
dual_annealing (and shgo below) is a powerful new general purpose
global optizimation (GO) algorithm. dual_annealing uses two annealing
processes to accelerate the convergence towards the global minimum of an
objective mathematical function. The first annealing process controls the
stochastic Markov chain searching and the second annealing process controls the
deterministic minimization. So, dual annealing is a hybrid method that takes
advantage of stochastic and local deterministic searching in an efficient way.
shgo (simplicial homology global optimization) is a similar algorithm
appropriate for solving black box and derivative free optimization (DFO)
problems. The algorithm generally converges to the global solution in finite
time. The convergence holds for non-linear inequality and
equality constraints. In addition to returning a global minimum, the
algorithm also returns any other global and local minima found after every
iteration. This makes it useful for exploring the solutions in a domain.
scipy.optimize.newton can now accept a scalar or an array
MINPACK usage is now thread-safe, such that MINPACK + callbacks may
be used on multiple threads.
scipy.signal improvementsDigital filter design functions now include a parameter to specify the sampling
rate. Previously, digital filters could only be specified using normalized
frequency, but different functions used different scales (e.g. 0 to 1 for
butter vs 0 to π for freqz), leading to errors and confusion. With
the fs parameter, ordinary frequencies can now be entered directly into
functions, with the normalization handled internally.
find_peaks and related functions no longer raise an exception if the
properties of a peak have unexpected values (e.g. a prominence of 0). A
PeakPropertyWarning is given instead.
The new keyword argument plateau_size was added to find_peaks.
plateau_size may be used to select peaks based on the length of the
flat top of a peak.
welch() and csd() methods in scipy.signal now support calculation
of a median average PSD, using average='mean' keyword
scipy.sparse improvementsThe scipy.sparse.bsr_matrix.tocsr method is now implemented directly instead
of converting via COO format, and the scipy.sparse.bsr_matrix.tocsc method
is now also routed via CSR conversion instead of COO. The efficiency of both
conversions is now improved.
The issue where SuperLU or UMFPACK solvers crashed on matrices with
non-canonical format in scipy.sparse.linalg was fixed. The solver wrapper
canonicalizes the matrix if necessary before calling the SuperLU or UMFPACK
solver.
The largest option of scipy.sparse.linalg.lobpcg() was fixed to have
a correct (and expected) behavior. The order of the eigenvalues was made
consistent with the ARPACK solver (eigs()), i.e. ascending for the
smallest eigenvalues, and descending for the largest eigenvalues.
The scipy.sparse.random function is now faster and also supports integer and
complex values by passing the appropriate value to the dtype argument.
scipy.spatial improvementsThe function scipy.spatial.distance.jaccard was modified to return 0 instead
of np.nan when two all-zero vectors are compared.
Support for the Jensen Shannon distance, the square-root of the divergence, has
been added under scipy.spatial.distance.jensenshannon
An optional keyword was added to the function
scipy.spatial.cKDTree.query_ball_point() to sort or not sort the returned
indices. Not sorting the indices can speed up calls.
A new category of quaternion-based transformations are available in
scipy.spatial.transform, including spherical linear interpolation of
rotations (Slerp), conversions to and from quaternions, Euler angles,
and general rotation and inversion capabilities
(spatial.transform.Rotation), and uniform random sampling of 3D
rotations (spatial.transform.Rotation.random).
scipy.stats improvementsThe Yeo-Johnson power transformation is now supported (yeojohnson,
yeojohnson_llf, yeojohnson_normmax, yeojohnson_normplot). Unlike
the Box-Cox transformation, the Yeo-Johnson transformation can accept negative
values.
Added a general method to sample random variates based on the density only, in
the new function rvs_ratio_uniforms.
The Yule-Simon distribution (yulesimon) was added -- this is a new
discrete probability distribution.
stats and mstats now have access to a new regression method,
siegelslopes, a robust linear regression algorithm
scipy.stats.gaussian_kde now has the ability to deal with weighted samples,
and should have a modest improvement in performance
Levy Stable Parameter Estimation, PDF, and CDF calculations are now supported
for scipy.stats.levy_stable.
The Brunner-Munzel test is now available as brunnermunzel in stats
and mstats
scipy.linalg improvementsscipy.linalg.lapack now exposes the LAPACK routines using the Rectangular
Full Packed storage (RFP) for upper triangular, lower triangular, symmetric,
or Hermitian matrices; the upper trapezoidal fat matrix RZ decomposition
routines are now available as well.
The functions hyp2f0, hyp1f2 and hyp3f0 in scipy.special have
been deprecated.
LAPACK version 3.4.0 or later is now required. Building with Apple Accelerate is no longer supported.
The function scipy.linalg.subspace_angles(A, B) now gives correct
results for all angles. Before this, the function only returned
correct values for those angles which were greater than pi/4.
Support for the Bento build system has been removed. Bento has not been maintained for several years, and did not have good Python 3 or wheel support, hence it was time to remove it.
The required signature of scipy.optimize.lingprog method=simplex
callback function has changed. Before iteration begins, the simplex solver
first converts the problem into a standard form that does not, in general,
have the same variables or constraints
as the problem defined by the user. Previously, the simplex solver would pass a
user-specified callback function several separate arguments, such as the
current solution vector xk, corresponding to this standard form problem.
Unfortunately, the relationship between the standard form problem and the
user-defined problem was not documented, limiting the utility of the
information passed to the callback function.
In addition to numerous bug fix changes, the simplex solver now passes a
user-specified callback function a single OptimizeResult object containing
information that corresponds directly to the user-defined problem. In future
releases, this OptimizeResult object may be expanded to include additional
information, such as variables corresponding to the standard-form problem and
information concerning the relationship between the standard-form and
user-defined problems.
The implementation of scipy.sparse.random has changed, and this affects the
numerical values returned for both sparse.random and sparse.rand for
some matrix shapes and a given seed.
scipy.optimize.newton will no longer use Halley's method in cases where it
negatively impacts convergence
A total of 137 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.
Note: These names were already in use but implemented a different mutation strategy. See Backwards incompatible changes, below. The init keyword for t…
SciPy 1.1.0 is the culmination of 7 months of hard work. It contains
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.1.x branch, and on adding new features on the master branch.
This release requires Python 2.7 or 3.4+ and NumPy 1.8.2 or greater.
This release has improved but not necessarily 100% compatibility with the PyPy Python implementation. For running on PyPy, PyPy 6.0+ and Numpy 1.15.0+ are required.
The argument tfirst has been added to the function
scipy.integrate.odeint. This allows odeint to use the same user
functions as scipy.integrate.solve_ivp and scipy.integrate.ode without
the need for wrapping them in a function that swaps the first two
arguments.
Error messages from quad() are now clearer.
The function scipy.linalg.ldl has been added for factorization of indefinite symmetric/hermitian matrices into triangular and block diagonal matrices.
Python wrappers for LAPACK sygst, hegst added in
scipy.linalg.lapack.
Added scipy.linalg.null_space, scipy.linalg.cdf2rdf, scipy.linalg.rsf2csf.
An electrocardiogram has been added as an example dataset for a one-dimensional signal. It can be accessed through scipy.misc.electrocardiogram.
The routines scipy.ndimage.binary_opening, and scipy.ndimage.binary_closing now support masks and different border values.
The method trust-constr has been added to scipy.optimize.minimize. The
method switches between two implementations depending on the problem
definition. For equality constrained problems it is an implementation of
a trust-region sequential quadratic programming solver and, when
inequality constraints are imposed, it switches to a trust-region
interior point method. Both methods are appropriate for large scale
problems. Quasi-Newton options BFGS and SR1 were implemented and can be
used to approximate second order derivatives for this new method. Also,
finite-differences can be used to approximate either first-order or
second-order derivatives.
Random-to-Best/1/bin and Random-to-Best/1/exp mutation strategies were
added to scipy.optimize.differential_evolution as randtobest1bin and
randtobest1exp, respectively. Note: These names were already in use
but implemented a different mutation strategy. See Backwards
incompatible changes, below. The
init keyword for the scipy.optimize.differential_evolution function
can now accept an array. This array allows the user to specify the
entire population.
Add an adaptive option to Nelder-Mead to use step parameters adapted
to the dimensionality of the problem.
Minor improvements in scipy.optimize.basinhopping.
Three new functions for peak finding in one-dimensional arrays were added. scipy.signal.find_peaks searches for peaks (local maxima) based on simple value comparison of neighbouring samples and returns those peaks whose properties match optionally specified conditions for their height, prominence, width, threshold and distance to each other. scipy.signal.peak_prominences and scipy.signal.peak_widths can directly calculate the prominences or widths of known peaks.
Added ZPK versions of frequency transformations: scipy.signal.bilinear_zpk, scipy.signal.lp2bp_zpk, scipy.signal.lp2bs_zpk, scipy.signal.lp2hp_zpk, scipy.signal.lp2lp_zpk.
Added scipy.signal.windows.dpss, scipy.signal.windows.general_cosine and scipy.signal.windows.general_hamming.
Previously, the reshape method only worked on
scipy.sparse.lil_matrix, and in-place reshaping did not work on any
matrices. Both operations are now implemented for all matrices. Handling
of shapes has been made consistent with numpy.matrix throughout the
scipy.sparse module (shape can be a tuple or splatted, negative number
acts as placeholder, padding and unpadding dimensions of size 1 to
ensure length-2 shape).
Added Owen's T function as scipy.special.owens_t.
Accuracy improvements in chndtr, digamma, gammaincinv, lambertw,
zetac.
The Moyal distribution has been added as scipy.stats.moyal.
Added the normal inverse Gaussian distribution as scipy.stats.norminvgauss.
The iterative linear equation solvers in scipy.sparse.linalg had a
sub-optimal way of how absolute tolerance is considered. The default
behavior will be changed in a future Scipy release to a more standard
and less surprising one. To silence deprecation warnings, set the
atol= parameter explicitly.
scipy.signal.windows.slepian is deprecated, replaced by scipy.signal.windows.dpss.
The window functions in scipy.signal are now available in scipy.signal.windows. They will remain also available in the old location in the scipy.signal namespace in future Scipy versions. However, importing them from scipy.signal.windows is preferred, and new window functions will be added only there.
Indexing sparse matrices with floating-point numbers instead of integers is deprecated.
The function scipy.stats.itemfreq is deprecated.
Previously, scipy.linalg.orth used a singular value cutoff value appropriate for double precision numbers also for single-precision input. The cutoff value is now tunable, and the default has been changed to depend on the input data precision.
In previous versions of Scipy, the randtobest1bin and randtobest1exp
mutation strategies in scipy.optimize.differential_evolution were
actually implemented using the Current-to-Best/1/bin and
Current-to-Best/1/exp strategies, respectively. These strategies were
renamed to currenttobest1bin and currenttobest1exp and the
implementations of randtobest1bin and randtobest1exp strategies were
corrected.
Functions in the ndimage module now always return their output array.
Before this most functions only returned the output array if it had been
allocated by the function, and would return None if it had been
provided by the user.
Distance metrics in scipy.spatial.distance now require non-negative weights.
scipy.special.loggamma returns now real-valued result when the input is real-valued.
When building on Linux with GNU compilers, the .so Python extension
files now hide all symbols except those required by Python, which can
avoid problems when embedding the Python interpreter.
A total of 122 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.
SciPy 1.0.1 is a bug-fix release with no new features compared to 1.0.0. Probably the most important change is a fix for an incompatibility between Sc
SciPy 1.0.1 is a bug-fix release with no new features compared to 1.0.0.
Probably the most important change is a fix for an incompatibility between
SciPy 1.0.0 and numpy.f2py in the NumPy master branch.
There have been a number of deprecations and API changes in this release, which are documented below. Before upgrading, we recommend that users check…
We are extremely pleased to announce the release of SciPy 1.0, 16 years after version 0.1 saw the light of day. It has been a long, productive journey to get here, and we anticipate many more exciting new features and releases in the future.
A version number should reflect the maturity of a project - and SciPy was a mature and stable library that is heavily used in production settings for a long time already. From that perspective, the 1.0 version number is long overdue.
Some key project goals, both technical (e.g. Windows wheels and continuous integration) and organisational (a governance structure, code of conduct and a roadmap), have been achieved recently.
Many of us are a bit perfectionist, and therefore are reluctant to call something "1.0" because it may imply that it's "finished" or "we are 100% happy with it". This is normal for many open source projects, however that doesn't make it right. We acknowledge to ourselves that it's not perfect, and there are some dusty corners left (that will probably always be the case). Despite that, SciPy is extremely useful to its users, on average has high quality code and documentation, and gives the stability and backwards compatibility guarantees that a 1.0 label imply.
Pauli Virtanen is SciPy's Benevolent Dictator For Life (BDFL). He says:
Truthfully speaking, we could have released a SciPy 1.0 a long time ago, so I'm happy we do it now at long last. The project has a long history, and during the years it has matured also as a software project. I believe it has well proved its merit to warrant a version number starting with unity.
Since its conception 15+ years ago, SciPy has largely been written by and for scientists, to provide a box of basic tools that they need. Over time, the set of people active in its development has undergone some rotation, and we have evolved towards a somewhat more systematic approach to development. Regardless, this underlying drive has stayed the same, and I think it will also continue propelling the project forward in future. This is all good, since not long after 1.0 comes 1.1.
Travis Oliphant is one of SciPy's creators. He says:
I'm honored to write a note of congratulations to the SciPy developers and the entire SciPy community for the release of SciPy 1.0. This release represents a dream of many that has been patiently pursued by a stalwart group of pioneers for nearly 2 decades. Efforts have been broad and consistent over that time from many hundreds of people. From initial discussions to efforts coding and packaging to documentation efforts to extensive conference and community building, the SciPy effort has been a global phenomenon that it has been a privilege to participate in.
The idea of SciPy was already in multiple people’s minds in 1997 when I first joined the Python community as a young graduate student who had just fallen in love with the expressibility and extensibility of Python. The internet was just starting to bringing together like-minded mathematicians and scientists in nascent electronically-connected communities. In 1998, there was a concerted discussion on the matrix-SIG, python mailing list with people like Paul Barrett, Joe Harrington, Perry Greenfield, Paul Dubois, Konrad Hinsen, David Ascher, and others. This discussion encouraged me in 1998 and 1999 to procrastinate my PhD and spend a lot of time writing extension modules to Python that mostly wrapped battle-tested Fortran and C-code making it available to the Python user. This work attracted the help of others like Robert Kern, Pearu Peterson and Eric Jones who joined their efforts with mine in 2000 so that by 2001, the first SciPy release was ready. This was long before Github simplified collaboration and input from others and the "patch" command and email was how you helped a project improve.
Since that time, hundreds of people have spent an enormous amount of time improving the SciPy library and the community surrounding this library has dramatically grown. I stopped being able to participate actively in developing the SciPy library around 2010. Fortunately, at that time, Pauli Virtanen and Ralf Gommers picked up the pace of development supported by dozens of other key contributors such as David Cournapeau, Evgeni Burovski, Josef Perktold, and Warren Weckesser. While I have only been able to admire the development of SciPy from a distance for the past 7 years, I have never lost my love of the project and the concept of community-driven development. I remain driven even now by a desire to help sustain the development of not only the SciPy library but many other affiliated and related open-source projects. I am extremely pleased that SciPy is in the hands of a world-wide community of talented developers who will ensure that SciPy remains an example of how grass-roots, community-driven development can succeed.
Fernando Perez offers a wider community perspective:
The existence of a nascent Scipy library, and the incredible --if tiny by today's standards-- community surrounding it is what drew me into the scientific Python world while still a physics graduate student in 2001. Today, I am awed when I see these tools power everything from high school education to the research that led to the 2017 Nobel Prize in physics.
Don't be fooled by the 1.0 number: this project is a mature cornerstone of the modern scientific computing ecosystem. I am grateful for the many who have made it possible, and hope to be able to contribute again to it in the future. My sincere congratulations to the whole team!
Some of the highlights of this release are:
scipy.integrate.solve_ivp).scipy.optimize offered previously.There have been a number of deprecations and API changes in this release, which
are documented below. 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).
This release requires Python 2.7 or >=3.4 and NumPy 1.8.2 or greater.
This is also the last release to support LAPACK 3.1.x - 3.3.x. Moving the lowest supported LAPACK version to >3.2.x was long blocked by Apple Accelerate providing the LAPACK 3.2.1 API. We have decided that it's time to either drop Accelerate or, if there is enough interest, provide shims for functions added in more recent LAPACK versions so it can still be used.
scipy.cluster improvementsscipy.cluster.hierarchy.optimal_leaf_ordering, a function to reorder a
linkage matrix to minimize distances between adjacent leaves, was added.
scipy.fftpack improvementsN-dimensional versions of the discrete sine and cosine transforms and their
inverses were added as dctn, idctn, dstn and idstn.
scipy.integrate improvementsA set of new ODE solvers have been added to scipy.integrate. The convenience
function scipy.integrate.solve_ivp allows uniform access to all solvers.
The individual solvers (RK23, RK45, Radau, BDF and LSODA)
can also be used directly.
scipy.linalg improvementsThe BLAS wrappers in scipy.linalg.blas have been completed. Added functions
are *gbmv, *hbmv, *hpmv, *hpr, *hpr2, *spmv, *spr,
*tbmv, *tbsv, *tpmv, *tpsv, *trsm, *trsv, *sbmv,
*spr2,
Wrappers for the LAPACK functions *gels, *stev, *sytrd, *hetrd,
*sytf2, *hetrf, *sytrf, *sycon, *hecon, *gglse,
*stebz, *stemr, *sterf, and *stein have been added.
The function scipy.linalg.subspace_angles has been added to compute the
subspace angles between two matrices.
The function scipy.linalg.clarkson_woodruff_transform has been added.
It finds low-rank matrix approximation via the Clarkson-Woodruff Transform.
The functions scipy.linalg.eigh_tridiagonal and
scipy.linalg.eigvalsh_tridiagonal, which find the eigenvalues and
eigenvectors of tridiagonal hermitian/symmetric matrices, were added.
scipy.ndimage improvementsSupport for homogeneous coordinate transforms has been added to
scipy.ndimage.affine_transform.
The ndimage C code underwent a significant refactoring, and is now
a lot easier to understand and maintain.
scipy.optimize improvementsThe methods trust-region-exact and trust-krylov have been added to the
function scipy.optimize.minimize. These new trust-region methods solve the
subproblem with higher accuracy at the cost of more Hessian factorizations
(compared to dogleg) or more matrix vector products (compared to ncg) but
usually require less nonlinear iterations and are able to deal with indefinite
Hessians. They seem very competitive against the other Newton methods
implemented in scipy.
scipy.optimize.linprog gained an interior point method. Its performance is
superior (both in accuracy and speed) to the older simplex method.
scipy.signal improvementsAn argument fs (sampling frequency) was added to the following functions:
firwin, firwin2, firls, and remez. This makes these functions
consistent with many other functions in scipy.signal in which the sampling
frequency can be specified.
scipy.signal.freqz has been sped up significantly for FIR filters.
scipy.sparse improvementsIterating over and slicing of CSC and CSR matrices is now faster by up to ~35%.
The tocsr method of COO matrices is now several times faster.
The diagonal method of sparse matrices now takes a parameter, indicating
which diagonal to return.
scipy.sparse.linalg improvementsA new iterative solver for large-scale nonsymmetric sparse linear systems,
scipy.sparse.linalg.gcrotmk, was added. It implements GCROT(m,k), a
flexible variant of GCROT.
scipy.sparse.linalg.lsmr now accepts an initial guess, yielding potentially
faster convergence.
SuperLU was updated to version 5.2.1.
scipy.spatial improvementsMany distance metrics in scipy.spatial.distance gained support for weights.
The signatures of scipy.spatial.distance.pdist and
scipy.spatial.distance.cdist were changed to *args, **kwargs in order to
support a wider range of metrics (e.g. string-based metrics that need extra
keywords). Also, an optional out parameter was added to pdist and
cdist allowing the user to specify where the resulting distance matrix is
to be stored
scipy.stats improvementsThe methods cdf and logcdf were added to
scipy.stats.multivariate_normal, providing the cumulative distribution
function of the multivariate normal distribution.
New statistical distance functions were added, namely
scipy.stats.wasserstein_distance for the first Wasserstein distance and
scipy.stats.energy_distance for the energy distance.
The following functions in scipy.misc are deprecated: bytescale,
fromimage, imfilter, imread, imresize, imrotate,
imsave, imshow and toimage. Most of those functions have unexpected
behavior (like rescaling and type casting image data without the user asking
for that). Other functions simply have better alternatives.
scipy.interpolate.interpolate_wrapper and all functions in that submodule
are deprecated. This was a never finished set of wrapper functions which is
not relevant anymore.
The fillvalue of scipy.signal.convolve2d will be cast directly to the
dtypes of the input arrays in the future and checked that it is a scalar or
an array with a single element.
scipy.spatial.distance.matching is deprecated. It is an alias of
scipy.spatial.distance.hamming, which should be used instead.
Implementation of scipy.spatial.distance.wminkowski was based on a wrong
interpretation of the metric definition. In scipy 1.0 it has been just
deprecated in the documentation to keep retro-compatibility but is recommended
to use the new version of scipy.spatial.distance.minkowski that implements
the correct behaviour.
Positional arguments of scipy.spatial.distance.pdist and
scipy.spatial.distance.cdist should be replaced with their keyword version.
The following deprecated functions have been removed from scipy.stats:
betai, chisqprob, f_value, histogram, histogram2,
pdf_fromgamma, signaltonoise, square_of_sums, ss and
threshold.
The following deprecated functions have been removed from scipy.stats.mstats:
betai, f_value_wilks_lambda, signaltonoise and threshold.
The deprecated a and reta keywords have been removed from
scipy.stats.shapiro.
The deprecated functions sparse.csgraph.cs_graph_components and
sparse.linalg.symeig have been removed from scipy.sparse.
The following deprecated keywords have been removed in scipy.sparse.linalg:
drop_tol from splu, and xtype from bicg, bicgstab, cg,
cgs, gmres, qmr and minres.
The deprecated functions expm2 and expm3 have been removed from
scipy.linalg. The deprecated keyword q was removed from
scipy.linalg.expm. And the deprecated submodule linalg.calc_lwork was
removed.
The deprecated functions C2K, K2C, F2C, C2F, F2K and
K2F have been removed from scipy.constants.
The deprecated ppform class was removed from scipy.interpolate.
The deprecated keyword iprint was removed from scipy.optimize.fmin_cobyla.
The default value for the zero_phase keyword of scipy.signal.decimate
has been changed to True.
The kmeans and kmeans2 functions in scipy.cluster.vq changed the
method used for random initialization, so using a fixed random seed will
not necessarily produce the same results as in previous versions.
scipy.special.gammaln does not accept complex arguments anymore.
The deprecated functions sph_jn, sph_yn, sph_jnyn, sph_in,
sph_kn, and sph_inkn have been removed. Users should instead use
the functions spherical_jn, spherical_yn, spherical_in, and
spherical_kn. Be aware that the new functions have different
signatures.
The cross-class properties of scipy.signal.lti systems have been removed.
The following properties/setters have been removed:
Name - (accessing/setting has been removed) - (setting has been removed)
num, den, gain) - (zeros, poles)A, B, C, D, gain) - (zeros, poles)A, B, C, D, num, den) - ()signal.freqz(b, a) with b or a >1-D raises a ValueError. This
was a corner case for which it was unclear that the behavior was well-defined.
The method var of scipy.stats.dirichlet now returns a scalar rather than
an ndarray when the length of alpha is 1.
SciPy now has a formal governance structure. It consists of a BDFL (Pauli
Virtanen) and a Steering Committee. See the governance document <https://github.com/scipy/scipy/blob/master/doc/source/dev/governance/governance.rst>_
for details.
It is now possible to build SciPy on Windows with MSVC + gfortran! Continuous integration has been set up for this build configuration on Appveyor, building against OpenBLAS.
Continuous integration for OS X has been set up on TravisCI.
The SciPy test suite has been migrated from nose to pytest.
scipy/_distributor_init.py was added to allow redistributors of SciPy to
add custom code that needs to run when importing SciPy (e.g. checks for
hardware, DLL search paths, etc.).
Support for PEP 518 (specifying build system requirements) was added - see
pyproject.toml in the root of the SciPy repository.
In order to have consistent function names, the function
scipy.linalg.solve_lyapunov is renamed to
scipy.linalg.solve_continuous_lyapunov. The old name is kept for
backwards-compatibility.
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.
SciPy 0.19.1 is a bug-fix release with no new features compared to 0.19.0. The most important change is a fix for a severe memory leak in integrate.qu
SciPy 0.19.1 is a bug-fix release with no new features compared to 0.19.0.
The most important change is a fix for a severe memory leak in integrate.quad.
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.
linalg.matrix_balance gives wrong transformation matrixscipy.interpolate._bspl.evaluate_spline gets wrong typesparse.load_npz, save_npz…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
SciPy 0.19.0 is the culmination of 7 months of hard work. It contains 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. Moreover, our development attention will now shift to bug-fix releases on the 0.19.x branch, and on adding new features on the master branch.
This release requires Python 2.7 or 3.4-3.6 and NumPy 1.8.2 or greater.
Highlights of this release include:
scipy.LowLevelCallable.scipy.special module, via cimport scipy.special.cython_special.Foreign function interface improvements
scipy.LowLevelCallable provides a new unified interface for wrapping
low-level compiled callback functions in the Python space. It supports
Cython imported "api" functions, ctypes function pointers, CFFI function
pointers, PyCapsules, Numba jitted functions and more.
See gh-6509 <https://github.com/scipy/scipy/pull/6509>_ for details.
scipy.linalg improvements
The function scipy.linalg.solve obtained two more keywords assume_a and
transposed. The underlying LAPACK routines are replaced with "expert"
versions and now can also be used to solve symmetric, hermitian and positive
definite coefficient matrices. Moreover, ill-conditioned matrices now cause
a warning to be emitted with the estimated condition number information. Old
sym_pos keyword is kept for backwards compatibility reasons however it
is identical to using assume_a='pos'. Moreover, the debug keyword,
which had no function but only printing the overwrite_<a, b> values, is
deprecated.
The function scipy.linalg.matrix_balance was added to perform the so-called
matrix balancing using the LAPACK xGEBAL routine family. This can be used to
approximately equate the row and column norms through diagonal similarity
transformations.
The functions scipy.linalg.solve_continuous_are and
scipy.linalg.solve_discrete_are have numerically more stable algorithms.
These functions can also solve generalized algebraic matrix Riccati equations.
Moreover, both gained a balanced keyword to turn balancing on and off.
scipy.spatial improvements
scipy.spatial.SphericalVoronoi.sort_vertices_of_regions has been re-written in
Cython to improve performance.
scipy.spatial.SphericalVoronoi can handle > 200 k points (at least 10 million)
and has improved performance.
The function scipy.spatial.distance.directed_hausdorff was
added to calculate the directed Hausdorff distance.
count_neighbors method of scipy.spatial.cKDTree gained an ability to
perform weighted pair counting via the new keywords weights and
cumulative. See gh-5647 <https://github.com/scipy/scipy/pull/5647>_ for
details.
scipy.spatial.distance.pdist and scipy.spatial.distance.cdist now support
non-double custom metrics.
scipy.ndimage improvements
The callback function C API supports PyCapsules in Python 2.7
Multidimensional filters now allow having different extrapolation modes for different axes.
scipy.optimize improvements
The scipy.optimize.basinhopping global minimizer obtained a new keyword,
seed, which can be used to seed the random number generator and obtain
repeatable minimizations.
The keyword sigma in scipy.optimize.curve_fit was overloaded to also accept
the covariance matrix of errors in the data.
scipy.signal improvements
The function scipy.signal.correlate and scipy.signal.convolve have a new
optional parameter method. The default value of auto estimates the fastest
of two computation methods, the direct approach and the Fourier transform
approach.
A new function has been added to choose the convolution/correlation method,
scipy.signal.choose_conv_method which may be appropriate if convolutions or
correlations are performed on many arrays of the same size.
New functions have been added to calculate complex short time fourier
transforms of an input signal, and to invert the transform to recover the
original signal: scipy.signal.stft and scipy.signal.istft. This
implementation also fixes the previously incorrect ouput of
scipy.signal.spectrogram when complex output data were requested.
The function scipy.signal.sosfreqz was added to compute the frequency
response from second-order sections.
The function scipy.signal.unit_impulse was added to conveniently
generate an impulse function.
The function scipy.signal.iirnotch was added to design second-order
IIR notch filters that can be used to remove a frequency component from
a signal. The dual function scipy.signal.iirpeak was added to
compute the coefficients of a second-order IIR peak (resonant) filter.
The function scipy.signal.minimum_phase was added to convert linear-phase
FIR filters to minimum phase.
The functions scipy.signal.upfirdn and scipy.signal.resample_poly are now
substantially faster when operating on some n-dimensional arrays when n > 1.
The largest reduction in computation time is realized in cases where the size
of the array is small (<1k samples or so) along the axis to be filtered.
scipy.fftpack improvements
Fast Fourier transform routines now accept np.float16 inputs and upcast
them to np.float32. Previously, they would raise an error.
scipy.cluster improvements
Methods "centroid" and "median" of scipy.cluster.hierarchy.linkage
have been significantly sped up. Long-standing issues with using linkage on
large input data (over 16 GB) have been resolved.
scipy.sparse improvements
The functions scipy.sparse.save_npz and scipy.sparse.load_npz were added,
providing simple serialization for some sparse formats.
The prune method of classes bsr_matrix, csc_matrix, and csr_matrix
was updated to reallocate backing arrays under certain conditions, reducing
memory usage.
The methods argmin and argmax were added to classes coo_matrix,
csc_matrix, csr_matrix, and bsr_matrix.
New function scipy.sparse.csgraph.structural_rank computes the structural
rank of a graph with a given sparsity pattern.
New function scipy.sparse.linalg.spsolve_triangular solves a sparse linear
system with a triangular left hand side matrix.
scipy.special improvements
Scalar, typed versions of universal functions from scipy.special are available
in the Cython space via cimport from the new module
scipy.special.cython_special. These scalar functions can be expected to be
significantly faster then the universal functions for scalar arguments. See
the scipy.special tutorial for details.
Better control over special-function errors is offered by the
functions scipy.special.geterr and scipy.special.seterr and the
context manager scipy.special.errstate.
The names of orthogonal polynomial root functions have been changed to
be consistent with other functions relating to orthogonal
polynomials. For example, scipy.special.j_roots has been renamed
scipy.special.roots_jacobi for consistency with the related
functions scipy.special.jacobi and scipy.special.eval_jacobi. To
preserve back-compatibility the old names have been left as aliases.
Wright Omega function is implemented as scipy.special.wrightomega.
scipy.stats improvements
The function scipy.stats.weightedtau was added. It provides a weighted
version of Kendall's tau.
New class scipy.stats.multinomial implements the multinomial distribution.
New class scipy.stats.rv_histogram constructs a continuous univariate
distribution with a piecewise linear CDF from a binned data sample.
New class scipy.stats.argus implements the Argus distribution.
scipy.interpolate improvements
New class scipy.interpolate.BSpline represents splines. BSpline objects
contain knots and coefficients and can evaluate the spline. The format is
consistent with FITPACK, so that one can do, for example::
>>> t, c, k = splrep(x, y, s=0)
>>> spl = BSpline(t, c, k)
>>> np.allclose(spl(x), y)
spl* functions, scipy.interpolate.splev, scipy.interpolate.splint,
scipy.interpolate.splder and scipy.interpolate.splantider, accept both
BSpline objects and (t, c, k) tuples for backwards compatibility.
For multidimensional splines, c.ndim > 1, BSpline objects are consistent
with piecewise polynomials, scipy.interpolate.PPoly. This means that
BSpline objects are not immediately consistent with
scipy.interpolate.splprep, and one cannot do
>>> BSpline(*splprep([x, y])[0]). Consult the scipy.interpolate test suite
for examples of the precise equivalence.
In new code, prefer using scipy.interpolate.BSpline objects instead of
manipulating (t, c, k) tuples directly.
New function scipy.interpolate.make_interp_spline constructs an interpolating
spline given data points and boundary conditions.
New function scipy.interpolate.make_lsq_spline constructs a least-squares
spline approximation given data points.
scipy.integrate improvements
Now scipy.integrate.fixed_quad supports vector-valued functions.
scipy.interpolate.splmake, scipy.interpolate.spleval and
scipy.interpolate.spline are deprecated. The format used by splmake/spleval
was inconsistent with splrep/splev which was confusing to users.
scipy.special.errprint is deprecated. Improved functionality is
available in scipy.special.seterr.
calling scipy.spatial.distance.pdist or scipy.spatial.distance.cdist with
arguments not needed by the chosen metric is deprecated. Also, metrics
"old_cosine" and "old_cos" are deprecated.
The deprecated scipy.weave submodule was removed.
scipy.spatial.distance.squareform now returns arrays of the same dtype as
the input, instead of always float64.
scipy.special.errprint now returns a boolean.
The function scipy.signal.find_peaks_cwt now returns an array instead of
a list.
scipy.stats.kendalltau now computes the correct p-value in case the
input contains ties. The p-value is also identical to that computed by
scipy.stats.mstats.kendalltau and by R. If the input does not
contain ties there is no change w.r.t. the previous implementation.
The function scipy.linalg.block_diag will not ignore zero-sized matrices anymore.
Instead it will insert rows or columns of zeros of the appropriate size.
See gh-4908 for more details.
SciPy wheels will now report their dependency on numpy on all platforms.
This change was made because Numpy wheels are available, and because the pip
upgrade behavior is finally changing for the better (use
--upgrade-strategy=only-if-needed for pip >= 8.2; that behavior will
become the default in the next major version of pip).
Numerical values returned by scipy.interpolate.interp1d with kind="cubic"
and "quadratic" may change relative to previous scipy versions. If your
code depended on specific numeric values (i.e., on implementation
details of the interpolators), you may want to double-check your results.
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.
SciPy 0.18.1 is a bug-fix release with no new features compared to 0.18.0.
SciPy 0.18.1 is a bug-fix release with no new features compared to 0.18.0.
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.
Issues closed for 0.18.1
#6357 <https://github.com/scipy/scipy/issues/6357>__: scipy 0.17.1 piecewise cubic hermite interpolation does not return...#6420 <https://github.com/scipy/scipy/issues/6420>__: circmean() changed behaviour from 0.17 to 0.18#6421 <https://github.com/scipy/scipy/issues/6421>__: scipy.linalg.solve_banded overwrites input 'b' when the inversion...#6425 <https://github.com/scipy/scipy/issues/6425>__: cKDTree INF bug#6435 <https://github.com/scipy/scipy/issues/6435>__: scipy.stats.ks_2samp returns different values on different computers#6458 <https://github.com/scipy/scipy/issues/6458>__: Error in scipy.integrate.dblquad when using variable integration...Pull requests for 0.18.1
#6405 <https://github.com/scipy/scipy/pull/6405>__: BUG: sparse: fix elementwise divide for CSR/CSC#6431 <https://github.com/scipy/scipy/pull/6431>__: BUG: result for insufficient neighbours from cKDTree is wrong.#6432 <https://github.com/scipy/scipy/pull/6432>__: BUG Issue #6421: scipy.linalg.solve_banded overwrites input 'b'...#6455 <https://github.com/scipy/scipy/pull/6455>__: DOC: add links to release notes#6462 <https://github.com/scipy/scipy/pull/6462>__: BUG: interpolate: fix .roots method of PchipInterpolator#6492 <https://github.com/scipy/scipy/pull/6492>__: BUG: Fix regression in dblquad: #6458#6543 <https://github.com/scipy/scipy/pull/6543>__: fix the regression in circmean#6545 <https://github.com/scipy/scipy/pull/6545>__: Revert gh-5938, restore ks_2samp#6557 <https://github.com/scipy/scipy/pull/6557>__: Backports for 0.18.1The rvs() method also accepted some arguments that it should not have. There is a potential for backwards incompatibility in cases where rvs() accepte…
SciPy 0.18.0 is the culmination of 6 months of hard work. It contains 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. Moreover, our development attention will now shift to bug-fix releases on the 0.19.x branch, and on adding new features on the master branch.
This release requires Python 2.7 or 3.4-3.5 and NumPy 1.7.1 or greater.
Highlights of this release include:
scipy.optimize.solve_bvp.CubicSpline, for cubic spline interpolation of data.scipy.interpolate.NdPPoly.scipy.spatial.SphericalVoronoi.scipy.signal.dlti.scipy.integrate improvements
A solver of two-point boundary value problems for ODE systems has been
implemented in scipy.integrate.solve_bvp. The solver allows for non-separated
boundary conditions, unknown parameters and certain singular terms. It finds
a C1 continious solution using a fourth-order collocation algorithm.
scipy.interpolate improvements
Cubic spline interpolation is now available via scipy.interpolate.CubicSpline.
This class represents a piecewise cubic polynomial passing through given points
and C2 continuous. It is represented in the standard polynomial basis on each
segment.
A representation of n-dimensional tensor product piecewise polynomials is
available as the scipy.interpolate.NdPPoly class.
Univariate piecewise polynomial classes, PPoly and Bpoly, can now be
evaluated on periodic domains. Use extrapolate="periodic" keyword
argument for this.
scipy.fftpack improvements
scipy.fftpack.next_fast_len function computes the next "regular" number for
FFTPACK. Padding the input to this length can give significant performance
increase for scipy.fftpack.fft.
scipy.signal improvements
Resampling using polyphase filtering has been implemented in the function
scipy.signal.resample_poly. This method upsamples a signal, applies a
zero-phase low-pass FIR filter, and downsamples using scipy.signal.upfirdn
(which is also new in 0.18.0). This method can be faster than FFT-based
filtering provided by scipy.signal.resample for some signals.
scipy.signal.firls, which constructs FIR filters using least-squares error
minimization, was added.
scipy.signal.sosfiltfilt, which does forward-backward filtering like
scipy.signal.filtfilt but for second-order sections, was added.
Discrete-time linear systems
`scipy.signal.dlti` provides an implementation of discrete-time linear systems.
Accordingly, the `StateSpace`, `TransferFunction` and `ZerosPolesGain` classes
have learned a the new keyword, `dt`, which can be used to create discrete-time
instances of the corresponding system representation.
`scipy.sparse` improvements
- ---------------------------
The functions `sum`, `max`, `mean`, `min`, `transpose`, and `reshape` in
`scipy.sparse` have had their signatures augmented with additional arguments
and functionality so as to improve compatibility with analogously defined
functions in `numpy`.
Sparse matrices now have a `count_nonzero` method, which counts the number of
nonzero elements in the matrix. Unlike `getnnz()` and ``nnz`` propety,
which return the number of stored entries (the length of the data attribute),
this method counts the actual number of non-zero entries in data.
`scipy.optimize` improvements
- -----------------------------
The implementation of Nelder-Mead minimization,
`scipy.minimize(..., method="Nelder-Mead")`, obtained a new keyword,
`initial_simplex`, which can be used to specify the initial simplex for the
optimization process.
Initial step size selection in CG and BFGS minimizers has been improved. We
expect that this change will improve numeric stability of optimization in some
cases. See pull request gh-5536 for details.
Handling of infinite bounds in SLSQP optimization has been improved. We expect
that this change will improve numeric stability of optimization in the some
cases. See pull request gh-6024 for details.
A large suite of global optimization benchmarks has been added to
``scipy/benchmarks/go_benchmark_functions``. See pull request gh-4191 for details.
Nelder-Mead and Powell minimization will now only set defaults for
maximum iterations or function evaluations if neither limit is set by
the caller. In some cases with a slow converging function and only 1
limit set, the minimization may continue for longer than with previous
versions and so is more likely to reach convergence. See issue gh-5966.
`scipy.stats` improvements
- --------------------------
Trapezoidal distribution has been implemented as `scipy.stats.trapz`.
Skew normal distribution has been implemented as `scipy.stats.skewnorm`.
Burr type XII distribution has been implemented as `scipy.stats.burr12`.
Three- and four-parameter kappa distributions have been implemented as
`scipy.stats.kappa3` and `scipy.stats.kappa4`, respectively.
New `scipy.stats.iqr` function computes the interquartile region of a
distribution.
Random matrices
scipy.stats.special_ortho_group and scipy.stats.ortho_group provide
generators of random matrices in the SO(N) and O(N) groups, respectively. They
generate matrices in the Haar distribution, the only uniform distribution on
these group manifolds.
scipy.stats.random_correlation provides a generator for random
correlation matrices, given specified eigenvalues.
scipy.linalg improvements
scipy.linalg.svd gained a new keyword argument, lapack_driver. Available
drivers are gesdd (default) and gesvd.
scipy.linalg.lapack.ilaver returns the version of the LAPACK library SciPy
links to.
scipy.spatial improvements
Boolean distances, scipy.spatial.pdist, have been sped up. Improvements vary
by the function and the input size. In many cases, one can expect a speed-up
of x2--x10.
New class scipy.spatial.SphericalVoronoi constructs Voronoi diagrams on the
surface of a sphere. See pull request gh-5232 for details.
scipy.cluster improvements
A new clustering algorithm, the nearest neighbor chain algorithm, has been
implemented for scipy.cluster.hierarchy.linkage. As a result, one can expect
a significant algorithmic improvement (:math:O(N^2) instead of :math:O(N^3))
for several linkage methods.
scipy.special improvements
The new function scipy.special.loggamma computes the principal branch of the
logarithm of the Gamma function. For real input, loggamma is compatible
with scipy.special.gammaln. For complex input, it has more consistent
behavior in the complex plane and should be preferred over gammaln.
Vectorized forms of spherical Bessel functions have been implemented as
scipy.special.spherical_jn, scipy.special.spherical_kn,
scipy.special.spherical_in and scipy.special.spherical_yn.
They are recommended for use over sph_* functions, which are now deprecated.
Several special functions have been extended to the complex domain and/or
have seen domain/stability improvements. This includes spence, digamma,
log1p and several others.
The cross-class properties of lti systems have been deprecated. The
following properties/setters will raise a DeprecationWarning:
Name - (accessing/setting raises warning) - (setting raises warning)
num, den, gain) - (zeros, poles)A, B, C, D, gain) - (zeros, poles)A, B, C, D, num, den) - ()Spherical Bessel functions, sph_in, sph_jn, sph_kn, sph_yn,
sph_jnyn and sph_inkn have been deprecated in favor of
scipy.special.spherical_jn and spherical_kn, spherical_yn,
spherical_in.
The following functions in scipy.constants are deprecated: C2K, K2C,
C2F, F2C, F2K and K2F. They are superceded by a new function
scipy.constants.convert_temperature that can perform all those conversions
plus to/from the Rankine temperature scale.
scipy.optimize
The convergence criterion for optimize.bisect,
optimize.brentq, optimize.brenth, and optimize.ridder now
works the same as numpy.allclose.
scipy.ndimage
The offset in ndimage.iterpolation.affine_transform
is now consistently added after the matrix is applied,
independent of if the matrix is specified using a one-dimensional
or a two-dimensional array.
scipy.stats
stats.ks_2samp used to return nonsensical values if the input was
not real or contained nans. It now raises an exception for such inputs.
Several deprecated methods of scipy.stats distributions have been removed:
est_loc_scale, vecfunc, veccdf and vec_generic_moment.
Deprecated functions nanmean, nanstd and nanmedian have been removed
from scipy.stats. These functions were deprecated in scipy 0.15.0 in favor
of their numpy equivalents.
A bug in the rvs() method of the distributions in scipy.stats has
been fixed. When arguments to rvs() were given that were shaped for
broadcasting, in many cases the returned random samples were not random.
A simple example of the problem is stats.norm.rvs(loc=np.zeros(10)).
Because of the bug, that call would return 10 identical values. The bug
only affected code that relied on the broadcasting of the shape, location
and scale parameters.
The rvs() method also accepted some arguments that it should not have.
There is a potential for backwards incompatibility in cases where rvs()
accepted arguments that are not, in fact, compatible with broadcasting.
An example is
stats.gamma.rvs([2, 5, 10, 15], size=(2,2))
The shape of the first argument is not compatible with the requested size,
but the function still returned an array with shape (2, 2). In scipy 0.18,
that call generates a ValueError.
scipy.io
scipy.io.netcdf masking now gives precedence to the _FillValue attribute
over the missing_value attribute, if both are given. Also, data are only
treated as missing if they match one of these attributes exactly: values that
differ by roundoff from _FillValue or missing_value are no longer
treated as missing values.
scipy.interpolate
scipy.interpolate.PiecewisePolynomial class has been removed. It has been
deprecated in scipy 0.14.0, and scipy.interpolate.BPoly.from_derivatives serves
as a drop-in replacement.
Scipy now uses setuptools for its builds instead of plain distutils. This
fixes usage of install_requires='scipy' in the setup.py files of
projects that depend on Scipy (see Numpy issue gh-6551 for details). It
potentially affects the way that build/install methods for Scipy itself behave
though. Please report any unexpected behavior on the Scipy issue tracker.
PR #6240 <https://github.com/scipy/scipy/pull/6240>__
changes the interpretation of the maxfun option in L-BFGS-B based routines
in the scipy.optimize module.
An L-BFGS-B search consists of multiple iterations,
with each iteration consisting of one or more function evaluations.
Whereas the old search strategy terminated immediately upon reaching maxfun
function evaluations, the new strategy allows the current iteration
to finish despite reaching maxfun.
The bundled copy of Qhull in the scipy.spatial subpackage has been upgraded to
version 2015.2.
The bundled copy of ARPACK in the scipy.sparse.linalg subpackage has been
upgraded to arpack-ng 3.3.0.
The bundled copy of SuperLU in the scipy.sparse subpackage has been upgraded
to version 5.1.1.
A total of 99 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.
SciPy 0.17.1 is a bug-fix release with no new features compared to 0.17.0.
SciPy 0.17.1 is a bug-fix release with no new features compared to 0.17.0.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
SciPy 0.17.0 is the culmination of 6 months of hard work. It contains 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. Moreover, our development attention will now shift to bug-fix releases on the 0.17.x branch, and on adding new features on the master branch.
This release requires Python 2.6, 2.7 or 3.2-3.5 and NumPy 1.6.2 or greater.
Release highlights:
- New functions for linear and nonlinear least squares optimization with
constraints: `scipy.optimize.lsq_linear` and
`scipy.optimize.least_squares`
- Support for fitting with bounds in `scipy.optimize.curve_fit`.
- Significant improvements to `scipy.stats`, providing many functions with
better handing of inputs which have NaNs or are empty, improved
documentation, and consistent behavior between `scipy.stats` and
`scipy.stats.mstats`.
- Significant performance improvements and new functionality in
`scipy.spatial.cKDTree`.
scipy.cluster improvements
A new function scipy.cluster.hierarchy.cut_tree, which determines a cut tree
from a linkage matrix, was added.
scipy.io improvements
scipy.io.mmwrite gained support for symmetric sparse matrices.
scipy.io.netcdf gained support for masking and scaling data based on data
attributes.
scipy.optimize improvements
Linear assignment problem solver
`scipy.optimize.linear_sum_assignment` is a new function for solving the
linear sum assignment problem. It uses the Hungarian algorithm (Kuhn-Munkres).
Least squares optimization
A new function for nonlinear least squares optimization with constraints was
added: scipy.optimize.least_squares. It provides several methods:
Levenberg-Marquardt for unconstrained problems, and two trust-region methods
for constrained ones. Furthermore it provides different loss functions.
New trust-region methods also handle sparse Jacobians.
A new function for linear least squares optimization with constraints was
added: scipy.optimize.lsq_linear. It provides a trust-region method as well
as an implementation of the Bounded-Variable Least-Squares (BVLS) algorithm.
scipy.optimize.curve_fit now supports fitting with bounds.
scipy.signal improvements
A mode keyword was added to scipy.signal.spectrogram, to let it return
other spectrograms than power spectral density.
scipy.stats improvements
Many functions in scipy.stats have gained a nan_policy keyword, which
allows specifying how to treat input with NaNs in them: propagate the NaNs,
raise an error, or omit the NaNs.
Many functions in scipy.stats have been improved to correctly handle input
arrays that are empty or contain infs/nans.
A number of functions with the same name in scipy.stats and
scipy.stats.mstats were changed to have matching signature and behavior.
See gh-5474 <https://github.com/scipy/scipy/issues/5474>__ for details.
scipy.stats.binom_test and scipy.stats.mannwhitneyu gained a keyword
alternative, which allows specifying the hypothesis to test for.
Eventually all hypothesis testing functions will get this keyword.
For methods of many continuous distributions, complex input is now accepted.
Matrix normal distribution has been implemented as scipy.stats.matrix_normal.
scipy.sparse improvements
The axis keyword was added to sparse norms, scipy.sparse.linalg.norm.
scipy.spatial improvements
scipy.spatial.cKDTree was partly rewritten for improved performance and
several new features were added to it:
query_ball_point method became significantly fasterquery and query_ball_point gained an n_jobs keyword for parallel
executionsparse_distance_matrix method can now return and sparse matrix typescipy.interpolate improvements
Out-of-bounds behavior of scipy.interpolate.interp1d has been improved.
Use a two-element tuple for the fill_value argument to specify separate
fill values for input below and above the interpolation range.
Linear and nearest interpolation kinds of scipy.interpolate.interp1d support
extrapolation via the fill_value="extrapolate" keyword.
fill_value can also be set to an array-like (or a two-element tuple of
array-likes for separate below and above values) so long as it broadcasts
properly to the non-interpolated dimensions of an array. This was implicitly
supported by previous versions of scipy, but support has now been formalized
and gets compatibility-checked before use. For example, a set of y values
to interpolate with shape (2, 3, 5) interpolated along the last axis (2)
could accept a fill_value array with shape () (singleton), (1,),
(2, 1), (1, 3), (3,), or (2, 3); or it can be a 2-element tuple
to specify separate below and above bounds, where each of the two tuple
elements obeys proper broadcasting rules.
scipy.linalg improvements
The default algorithm for scipy.linalg.leastsq has been changed to use
LAPACK's function *gelsd. Users wanting to get the previous behavior
can use a new keyword lapack_driver="gelss" (allowed values are
"gelss", "gelsd" and "gelsy").
scipy.sparse matrices and linear operators now support the matmul (@)
operator when available (Python 3.5+). See
PEP 465
A new function scipy.linalg.ordqz, for QZ decomposition with reordering, has
been added.
scipy.stats.histogram is deprecated in favor of np.histogram, which is
faster and provides the same functionality.
scipy.stats.threshold and scipy.mstats.threshold are deprecated
in favor of np.clip. See issue #617 for details.
scipy.stats.ss is deprecated. This is a support function, not meant to
be exposed to the user. Also, the name is unclear. See issue #663 for details.
scipy.stats.square_of_sums is deprecated. This too is a support function
not meant to be exposed to the user. See issues #665 and #663 for details.
scipy.stats.f_value, scipy.stats.f_value_multivariate,
scipy.stats.f_value_wilks_lambda, and scipy.mstats.f_value_wilks_lambda
are deprecated. These are related to ANOVA, for which scipy.stats provides
quite limited functionality and these functions are not very useful standalone.
See issues #660 and #650 for details.
scipy.stats.chisqprob is deprecated. This is an alias. stats.chi2.sf
should be used instead.
scipy.stats.betai is deprecated. This is an alias for special.betainc
which should be used instead.
The functions stats.trim1 and stats.trimboth now make sure the
elements trimmed are the lowest and/or highest, depending on the case.
Slicing without at least partial sorting was previously done, but didn't
make sense for unsorted input.
When variable_names is set to an empty list, scipy.io.loadmat now
correctly returns no values instead of all the contents of the MAT file.
Element-wise multiplication of sparse matrices now returns a sparse result in all cases. Previously, multiplying a sparse matrix with a dense matrix or array would return a dense matrix.
The function misc.lena has been removed due to license incompatibility.
The constructor for sparse.coo_matrix no longer accepts (None, (m,n))
to construct an all-zero matrix of shape (m,n). This functionality was
deprecated since at least 2007 and was already broken in the previous SciPy
release. Use coo_matrix((m,n)) instead.
The Cython wrappers in linalg.cython_lapack for the LAPACK routines
*gegs, *gegv, *gelsx, *geqpf, *ggsvd, *ggsvp,
*lahrd, *latzm, *tzrqf have been removed since these routines
are not present in the new LAPACK 3.6.0 release. With the exception of
the routines *ggsvd and *ggsvp, these were all deprecated in favor
of routines that are currently present in our Cython LAPACK wrappers.
Because the LAPACK *gegv routines were removed in LAPACK 3.6.0. The
corresponding Python wrappers in scipy.linalg.lapack are now
deprecated and will be removed in a future release. The source files for
these routines have been temporarily included as a part of scipy.linalg
so that SciPy can be built against LAPACK versions that do not provide
these deprecated routines.
Html and pdf documentation of development versions of Scipy is now automatically rebuilt after every merged pull request.
scipy.constants is updated to the CODATA 2014 recommended values.
Usage of scipy.fftpack functions within Scipy has been changed in such a
way that PyFFTW <http://hgomersall.github.io/pyFFTW/>__ can easily replace
scipy.fftpack functions (with improved performance). See
gh-5295 <https://github.com/scipy/scipy/pull/5295>__ for details.
The imread functions in scipy.misc and scipy.ndimage were unified, for
which a mode argument was added to scipy.misc.imread. Also, bugs for
1-bit and indexed RGB image formats were fixed.
runtests.py, the development script to build and test Scipy, now allows
building in parallel with --parallel.
A total of 101 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.
SciPy 0.16.1 is a bug-fix release with no new features compared to 0.16.0.
SciPy 0.16.1 is a bug-fix release with no new features compared to 0.16.0.
…documentation. There have been a number of deprecations and API changes in this release, which are documented below. All users are encouraged to upgra…
SciPy 0.16.0 is the culmination of 7 months of hard work. It contains 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. Moreover, our development attention will now shift to bug-fix releases on the 0.16.x branch, and on adding new features on the master branch.
This release requires Python 2.6, 2.7 or 3.2-3.4 and NumPy 1.6.2 or greater.
Highlights of this release include:
scipy.linalgscipy.signal.The benchmark suite has switched to using Airspeed Velocity <http://spacetelescope.github.io/asv/>__ for benchmarking. You can
run the suite locally via python runtests.py --bench. For more
details, see benchmarks/README.rst.
scipy.linalg improvementsA full set of Cython wrappers for BLAS and LAPACK has been added in the
modules scipy.linalg.cython_blas and scipy.linalg.cython_lapack.
In Cython, these wrappers can now be cimported from their corresponding
modules and used without linking directly against BLAS or LAPACK.
The functions scipy.linalg.qr_delete, scipy.linalg.qr_insert and
scipy.linalg.qr_update for updating QR decompositions were added.
The function scipy.linalg.solve_circulant solves a linear system with
a circulant coefficient matrix.
The function scipy.linalg.invpascal computes the inverse of a Pascal matrix.
The function scipy.linalg.solve_toeplitz, a Levinson-Durbin Toeplitz solver,
was added.
Added wrapper for potentially useful LAPACK function *lasd4. It computes
the square root of the i-th updated eigenvalue of a positive symmetric rank-one
modification to a positive diagonal matrix. See its LAPACK documentation and
unit tests for it to get more info.
Added two extra wrappers for LAPACK least-square solvers. Namely, they are
*gelsd and *gelsy.
Wrappers for the LAPACK *lange functions, which calculate various matrix
norms, were added.
Wrappers for *gtsv and *ptsv, which solve A*X = B for tri-diagonal
matrix A, were added.
scipy.signal improvementsSupport for second order sections (SOS) as a format for IIR filters was added. The new functions are:
scipy.signal.sosfiltscipy.signal.sosfilt_zi,scipy.signal.sos2tfscipy.signal.sos2zpkscipy.signal.tf2sosscipy.signal.zpk2sos.Additionally, the filter design functions iirdesign, iirfilter, butter,
cheby1, cheby2, ellip, and bessel can return the filter in the SOS
format.
The function scipy.signal.place_poles, which provides two methods to place
poles for linear systems, was added.
The option to use Gustafsson's method for choosing the initial conditions
of the forward and backward passes was added to scipy.signal.filtfilt.
New classes TransferFunction, StateSpace and ZerosPolesGain were
added. These classes are now returned when instantiating scipy.signal.lti.
Conversion between those classes can be done explicitly now.
An exponential (Poisson) window was added as scipy.signal.exponential, and a
Tukey window was added as scipy.signal.tukey.
The function for computing digital filter group delay was added as
scipy.signal.group_delay.
The functionality for spectral analysis and spectral density estimation has
been significantly improved: scipy.signal.welch became ~8x faster and the
functions scipy.signal.spectrogram, scipy.signal.coherence and
scipy.signal.csd (cross-spectral density) were added.
scipy.signal.lsim was rewritten - all known issues are fixed, so this
function can now be used instead of lsim2; lsim is orders of magnitude
faster than lsim2 in most cases.
scipy.sparse improvementsThe function scipy.sparse.norm, which computes sparse matrix norms, was
added.
The function scipy.sparse.random, which allows to draw random variates from
an arbitrary distribution, was added.
scipy.spatial improvementsscipy.spatial.cKDTree has seen a major rewrite, which improved the
performance of the query method significantly, added support for parallel
queries, pickling, and options that affect the tree layout. See pull request
4374 for more details.
The function scipy.spatial.procrustes for Procrustes analysis (statistical
shape analysis) was added.
scipy.stats improvementsThe Wishart distribution and its inverse have been added, as
scipy.stats.wishart and scipy.stats.invwishart.
The Exponentially Modified Normal distribution has been
added as scipy.stats.exponnorm.
The Generalized Normal distribution has been added as scipy.stats.gennorm.
All distributions now contain a random_state property and allow specifying a
specific numpy.random.RandomState random number generator when generating
random variates.
Many statistical tests and other scipy.stats functions that have multiple
return values now return namedtuples. See pull request 4709 for details.
scipy.optimize improvementsA new derivative-free method DF-SANE has been added to the nonlinear equation
system solving function scipy.optimize.root.
scipy.stats.pdf_fromgamma is deprecated. This function was undocumented,
untested and rarely used. Statsmodels provides equivalent functionality
with statsmodels.distributions.ExpandedNormal.
scipy.stats.fastsort is deprecated. This function is unnecessary,
numpy.argsort can be used instead.
scipy.stats.signaltonoise and scipy.stats.mstats.signaltonoise are
deprecated. These functions did not belong in scipy.stats and are rarely
used. See issue #609 for details.
scipy.stats.histogram2 is deprecated. This function is unnecessary,
numpy.histogram2d can be used instead.
The deprecated global optimizer scipy.optimize.anneal was removed.
The following deprecated modules have been removed: scipy.lib.blas,
scipy.lib.lapack, scipy.linalg.cblas, scipy.linalg.fblas,
scipy.linalg.clapack, scipy.linalg.flapack. They had been deprecated
since Scipy 0.12.0, the functionality should be accessed as scipy.linalg.blas
and scipy.linalg.lapack.
The deprecated function scipy.special.all_mat has been removed.
The deprecated functions fprob, ksprob, zprob, randwcdf
and randwppf have been removed from scipy.stats.
The version numbering for development builds has been updated to comply with PEP 440.
Building with python setup.py develop is now supported.
A total of 93 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.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →