| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This roughly changes things so that we ensure a float64 working
values up-front. There is a tiny chance of precision changes if the
input was not float64 or error changes on bad input.
I don't think this should matter in practice, precision changes
(as far as I can tell) should happen rather the other way around.
Since float64 has 53bits mantissa, I think the arange should give
the correct result reliably for any sensible inputs.
There is an argument to be made that the windowing functions could
return float32 for float32 input, but I somewhat think this is OK
and users can be expected to just cast manually after the fact.
The result type is tested, but this ensures the tests pass also
when enabling weak promotion.
|
|\
| |
| | |
DOC: quantile parameter q is a probability
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
[skip circle] [skip azp] [skip cirrus]
|
| | |
|
| | |
|
|\ \
| | |
| | | |
ENH: Enabled the use of numpy.vectorize as a decorator
|
| | |
| | |
| | |
| | | |
This reverses commit 7a2ded1522305
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Previous definition implies that vectorize returns generalized functions,
which is not true.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Most of this code comes from PR-9593, but with the default value for pyfunc
being numpy._NoValue instead of None, no override of __new__, and no effort
to make subclassing possible.
Co-Authored-By: Michael Lamparski <diagonaldevice@gmail.com>
|
| | | |
|
| |/
|/|
| |
| |
| |
| |
| |
| | |
As discussed in
https://mail.python.org/archives/list/numpy-discussion@python.org/thread/UKZJACAP5FUG7KP2AQDPE4P5ADNWLOHZ/
This flag was always meant to be temporary, and cleaning it up is
long overdue.
|
| |
| |
| |
| |
| | |
Meshgrid returns a list of ndarrays.
Co-authored-by: 渡邉 美希 <miki.watanabe@watanabenoMacBook-Pro.local>
|
| | |
|
| |
| |
| |
| |
| | |
This change is staged for NumPy 2.0, I assume we could get away with
it otherwise, but it is a nice example and probably not pressing.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Convert several methods to the vectorcall convention. The conversions give a performance improvement, see #20790 (comment)
Some notes:
* For vdot the METH_KEYWORDS was removed, as the C vdot method was positional only.
* The add_docstring is converted with an additional check. It was parsed as if (!PyArg_ParseTuple(args, "OO!:add_docstring", &obj, &PyUnicode_Type, &str)), but there is no support for the ! in the npy_parse_arguments
* CI was complaining about coverage of _get_ndarray_c_version. A test was added, but only to provide coverage
* In function_base.py a redundant check in def place was removed
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This wraps `trapz` into a proper python function and then copies all
attributes expected on a Python function over from the "fake" version
to the real one.
This allows SciPy to pretend `trapz` is a Python function to create
their own version.
|
|/ |
|
|
|
|
|
|
|
| |
* DOC: Add a note to the documentation of the rot90
The note added indicates that rotation is counter clockwise with the default argumemnts.
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
|
|
|
|
|
|
| |
A plot is meant to demonstrate the different methods of estimating the
percentile that `numpy.percentile()` supports, but previously the legend
covered a large fraction of it. Now the legend is drawn next to the
plot.
|
|
|
|
|
|
|
|
| |
Examples in documentation for trapz goes straight from integrating random arrays to parametric curves. I think it's worth pointing out one can integrate something they'd see in Calculus 1 and get the answer they'd expect.
Also add some more guidance text to the existing examples (and style fixes)
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Melissa Weber Mendonça <melissawm@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since percentile is more or less identical to quantile, I also made it
throw an error if it receives a complex input. I also made nanquantile
and nanpercentile throw errors as well.
* Made the changes recommended by seberg
* Fixed a test for PR 22703
* Fixed tests for quantile
* Shortened some more lines
* Fixup more lines
Co-authored-by: Sebastian Berg <sebastianb@nvidia.com>
|
|
|
|
|
|
| |
`numpy.percentile()`, and `numpy.quantile()`.
Closes #22714, #22544.
|
| |
|
|\
| |
| | |
DOC: How to partition domains
|
| |
| |
| |
| | |
Also add links to this document from the functions' docstrings.
|
| | |
|
| |
| |
| |
| |
| | |
Add date to deprecation in comment
Co-authored-by: Matti Picus <matti.picus@gmail.com>
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|\
| |
| | |
BUG: fix np.average for Fraction elements
|
| | |
|
|/
|
|
| |
Co-authored-by: deego <deego3@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and percentile().
Fix the interpolation formulae in the docs which led to absurd results. For quantile() and percentile().
Example, for median of a = [1,2,10,11], you expect to obtain i+g=2.5 for method = linear (or weibull, or hazen, or median_unbiased or normal_unbiased).
Instead, you obtain a /negative/ index.
The correted formula is:
i + g = q * (n - alpha - beta + 1 ) + alpha
Notice among other things that n belongs in the numerator, not the denominator!
As a check, the corrected formula does lead to the correct index 2.5 for each of the cases above.
MYSTERY: Surely the original formula was the result of a small typo/thinko? Then, why does the correction look so completely different?
RESOLUTION OF MYSTERY:
Take our formula, massage it, and swap q with (i+g), and you end up with the original formula.
In other words, the original author of the doc. simply confused their percentile with their index halfway through the creation of the doc. Then, they massaged it to isolate (i+g) on the left.
|
|
|
|
|
|
|
|
| |
Non integer array-likes were not correctly rejected when a new
fast-path was added to `np.delete` in gh-16895.
This includes the _explicitly_ added `dtype=object` which should
not be allowed since it is not allowed in normal indexing either.
Closes gh-21840
|
|
|
|
|
|
|
|
|
| |
(#21851)
The keepdims flag needs to be applied during the calculation of the sum of
the weights in np.average and np.ma.average. Not passing it causes weights
to broadcast incorrectly.
Fixes #21850
|
|
|
| |
Co-authored-by: Robert Kern <robert.kern@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The first lines of the sinc docstring did not mention the behavior
when the argument is zero, and gave the impression that the function is
defined as the quotient between a sine and its argument everywhere. That
information was instead relegated to the "Notes" section. I found this
issue while navigating the documentation for jax.numpy.sinc, which
inherits those few lines. I think it is important to document not only
the value of the function at zero, but also that it make sinc a smooth
function. This connects better with some of the other routes used to
introduce sinc (e.g. as a Taylor series). I have tried to implement
the conclusions of the discussion around Issue #21538, keeping the
description close to the actual implementation and avoiding my original
suggestion of introducing the function as a limit.
|
| |
|
|\
| |
| | |
DOC: Add space after argument name
|
| | |
|
| | |
|
|/ |
|