| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Docs incorrectly stated that the default output dtype was float32 when
input array is of an integer dtype. However:
```python
np.var(np.random.randint(0, 100, 1000)).dtype == np.dtype("f8")
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Increment stacklevel for warnings to account for NEP-18 overrides
For NumPy functions that make use of `__array_function__`, the appropriate the
stack level for warnings should generally be increased by 1 to account for
the override function defined in numpy.core.overrides.
Fixes GH-13329
* Update numpy/lib/type_check.py
Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net>
|
|
|
|
|
|
|
|
|
| |
* add _nan_mask function and
associated unit tests; this function
is to be used to simplify reduction
operations involving np.nan elements
by using a mask with a ``where``
argument
|
| |
|
|
|
|
|
|
|
|
| |
* ported the refguide_check module from SciPy for usage
in NumPy docstring execution/ verification; added the
refguide_check run to Azure Mac OS CI
* adjusted NumPy docstrings such that refguide_check passes
|
| |
|
|
|
|
| |
np.lib.arraypad through np.lib.nanfunctions
|
| |
|
|\
| |
| | |
ENH: Quantile
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
| |
Previously, this would check the percentiles were 0 <= q <= 100 on every single slice of non-reduction axes.
This also pulls the division by 100 to the top level, which makes things clearer, and also reduces the size of the stack trace
|
|
|
|
|
|
|
| |
nansum started returning 0 from all-nan slices in 1.9.0, according to my
tests, not 1.8.1 or 1.8.2, which still return NaN.
[skip ci]
|
|
|
|
| |
Updates the two docstrings to match.
|
| |
|
| |
|
|
|
|
|
| |
Also add a hint to the documentation advising the use of moveaxis over rollaxis.
Tests for rollaxis are left alone.
|
|\
| |
| | |
MAINT: Factor out code duplicated by nanmedian and nanpercentile
|
| | |
|
|/ |
|
|
|
|
| |
nonzero is a clearer spelling
|
| |
|
|
|
|
| |
Fixes gh-8974 and gh-9008
|
| |
|
| |
|
|
|
|
|
| |
Old value was erroneously obtained on a sorted array which is a best
case for the median of 3 pivoted introsort.
|
|\
| |
| | |
BUG: handle unmasked NaN in ma.median like normal median
|
| |
| |
| |
| |
| |
| |
| |
| | |
The apply_along_axis path is significantly more expensive than currently
accounted for in the check. Increase the minimum axis size from 400 to
1000 elements.
Either apply_along_axis got more expensive over time or the original
benchmarking was flawed.
|
|/
|
|
| |
Closes gh-8220
|
| |
|
|
|
|
| |
The strings in error messages were left untouched
|
| |
|
|
|
|
|
|
| |
Comment mentions a speedup, but it seems unsure why it should
be there. Instead use an error state in divide_by_count.
Some extra complex warnings had to be ignored (but those seemed correct)
|
|
|
|
|
|
|
|
| |
This PR adds an implementation of `nancumsum` and `nancumprod`.
The actual function is a two-liner adapted from `nansum`.
Its structure is adapted from PR: https://github.com/numpy/numpy/pull/5418/
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
change test from `type(a) is not mu.ndarray` to
`not isinstance(a, mu.ndarray)`
Because every sub-class of ndarray is not guaranteed to implement
`keepdims` as a kwarg, when wrapping these methods care must be taken.
The previous behavior was to silently eat the kwarg when dealing with
a sub-class of ndarray.
Now, if `keepdims=np._NoValue` (the new default) it is not passed
through to the underlying function call (so the default value of
`keepdims` is now controlled by the sub-class). If `keepdims` is not
`np._NoValue` then it is passed through and will raise an exception if
the sub-class does not support the kwarg.
A special case in nanvar was required to deal with `matrix` that previously
relied on `fromnumeric` silently dropping `keepdims`.
|
|\
| |
| | |
DOC: Updated minor typos in function_base.py and test_function_base.py
|
| | |
|
|/
|
|
|
|
|
|
|
| |
nanpercentile was conforming to dimension convention of percentile incorrectly.
percentile outputs results for the different percentiles along the first
dimension of the output. nanpercentile was moving the reduction axis to the
front using swapaxes, which would move the first axis out of place if there
were more than two in the array. Added a test with more than two axes to
demonstrate and used rollaxis instead of swapaxes to do the interhange.
|
|
|
|
|
|
|
|
| |
Fix bug where nanpercentile would crash with an all-nan slices when
given multiple percentiles. Also corrects behavior where array sizes
different from numpy.percentile would be returned with keepdims enabled.
Fix #5760
|
|
|
|
|
|
|
|
|
|
|
| |
This PR adds an implementation of `nanprod`.
The actual function is a two-liner adapted from `nansum`. Most of this PR
consists of documentation and tests (for which I took the opportunity to do
some consolidation).
A method with the same functionality exists in pandas, and I was surprised to
discover that it's not in numpy.
|
|\
| |
| | |
Charris pep8 numpy lib
|