| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|\
| |
| | |
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
|
| | |
|
| | |
|
|/ |
|
|\
| |
| | |
MAINT: extend delete single value optimization
|
| | |
|
| |\ |
|
| | |
| | |
| | | |
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
| | |
| | |
| | |
| | |
| | | |
Allow arrays of shape (1,) for delete's obj parameter to utilize the
optimization for a single value. See #16685.
|
| | | |
|
| | | |
|
| |/
|/|
| |
| |
| | |
coordinate was misspelled in a comment in the example code
[ci skip]
|
| | |
|
| |
| |
| |
| | |
Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
|
| |
| |
| |
| |
| |
| |
| | |
Mainly fixes the method list slightly, tones down the warning a
bit and fixes the link to the paper (I did not realize that the
link failed to work due only because the reference was missing
from nanquantile/nanpercentile).
|
| |
| |
| |
| | |
Co-authored-by: abel <aoun@cerfacs.fr>
|
| |
| |
| |
| |
| | |
Apparently, sphinx does not resolve references to footnotes from
parameter descriptions.
|
| | |
|
| |
| |
| |
| |
| | |
Also, the closest-observation did not correctly support multiple
quantiles calculated at the same time (broadcasting error).
|
| | |
|
| |
| |
| |
| |
| |
| | |
For method 7 of H&F, using `(n - 1) * quantiles`
instead of the usual method gives a more accurate
result.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Avoiding the unnecessary calls to moveaxis() speed up
`np.quantile(x, .5)` (`x = np.random.rand(1000)`) by ~10% (although
there's a lot of variability) for me.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Also added unit test for it.
|
| |
| |
| |
| | |
Also removed unused imports
|
| |
| |
| |
| |
| | |
- some changes were unrelated to the PR and have been reverted, including, renaming and moving the logic around.
- Also renamed _quantile_ureduce_func to its original name
|
| |
| |
| |
| |
| | |
Hopefully fix the docstrings of percentile, nanpercentile,
quantile, and nanquantile so that CircleCI passes.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Added the missing linear interpolation methods.
- Updated the existing unit tests.
- Added pytest.mark.xfail for boolean arrays
See
- https://github.com/numpy/numpy/pull/19857#issuecomment-919258693
- https://github.com/numpy/numpy/issues/19154
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When `insert` is given a single out-of-bounds index in a
list, e.g.
np.insert([0, 1, 2], [99], [3, 4]) # 99 is out of bounds
a TypeError was being raised because of a bug in the formatting
of the message.
Before this change, the error is
TypeError: %i format: a number is required, not list
After, we get the expected
IndexError: index [99] is out of bounds for axis 0 with size 3
|
| | |
| | |
| | |
| | | |
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
| |\ \
| | | |
| | | | |
MAINT: LGTM.com recommendations
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Import of 'histogram' is not used.
Import of 'histogramdd' is not used.
Import of 'textwrap' is not used.
|
| | | | |
|
| |/ / |
|
| | | |
|