| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
DOC: Rewrite docstrings of `ogrid` and `mgrid`
|
| |
| |
| |
| | |
Removed references to `nd_grid` instead of adding a document (gh-23612).
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* BUG: properly handle tuple keys in NpZFile.__getitem__
* TST: test tuple rendering specifically.
---------
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This PR adds additional tests for quantiles:
1. Identification equation $E[V(q, Y)] = 0$
2. Adding a constant $c > 0$: $q(c + Y) = c + q(Y)$
3. Multiplying by a constant $c > 0$: $q(c \cdot Y) = c \cdot q(y)$
4. Multiplying by $-1$: $q_{\alpha}(-Y) = -q_{1-\alpha}(Y)$
(Note by seberg as reviewer: These tests are fairly complex, but may be useful for future development. But if they seem too complicated, they are probably not really vital and could be shortened or removed.)
|
| |\
| | |
| | | |
DOC: quantile parameter q is a probability
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
NpzFile inherits from collections.abc.Mapping,
which provides __contains__().
However, it calls __getitem__(),
which can be slow because it performs file decompression on success.
|
| |\ \
| | | |
| | | |
| | | |
| | | | |
DEP: deprecate np.math and np.lib.math
[skip ci]
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Improves the repr to include information about the arrays contained, e.g.:
>>> npzfile = np.load('arr.npz')
>>> npzfile
NpzFile 'arr.npz' with keys arr_0, arr_1, arr_2, arr_3, arr_4...
closes #23319
Co-authored-by: Ross Barnowski <rossbar@berkeley.edu>
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
[skip circle] [skip azp] [skip cirrus]
|
| |/ / |
|
| | | |
|
| |\ \
| | | |
| | | | |
ENH: Enabled the use of numpy.vectorize as a decorator
|
| | | |
| | | |
| | | |
| | | | |
This reverses commit 7a2ded1522305
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
This test makes sure a function's docstring is properly preserved
after calling the vectorize decorator.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | |/
| |/| |
|
| | |
| | |
| | |
| | | |
[skip actions] [skip travis] [skip cirrus]
|
| | |
| | |
| | |
| | | |
[skip actions] [skip travis] [skip azp] [skip cirrus]
|
| | |
| | |
| | |
| | | |
[skip actions] [skip travis] [skip azp] [skip cirrus]
|
| | | |
|
| | |
| | |
| | |
| | | |
[skip cirrus]
|
| | |
| | |
| | |
| | |
| | | |
Meshgrid returns a list of ndarrays.
Co-authored-by: 渡邉 美希 <miki.watanabe@watanabenoMacBook-Pro.local>
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As noted by Kyle Sunden, this was deprecated and has been removed,
using the method is the correct way of doing it in newer matplotlib.
Closes gh-23209
Co-authored-by: Kyle Sunden <ksunden@users.noreply.github.com>
|
| |\ \
| | | |
| | | | |
API: Add environment variable for behavior planned in a 2.0
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
|
| |/ / |
|
| |\ \
| | | |
| | | | |
ENH: Add slots to NDArrayOperatorsMixin allowing them in subclasses
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I use the mixings in a few different file backed arrays.
However, the lack of slots make it difficult for me to use slots.
I mostly use slots to ensure that performance optimized code doesn't
create unecessary references to large chunks of memory.
If all parent classes do not have `__slots__` defined, I think that Python
(3.9) just ignores `__slots__` alltogether.
Thank you for considering.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Currently, the following code:
```
import numpy as np
with open('foo.npy', 'wb') as f:
for i in range(np.random.randint(10)):
np.save(f, 1)
with open('foo.npy', 'rb') as f:
while True:
np.load(f)
```
Will raise:
```
ValueError: Cannot load file containing pickled data when allow_pickle=False
```
While there is no pickled data in the file.
|
| |\ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* fix docstring of real_if_close
* factor out dtype
|