| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| | |
TST: Remove code that is not supposed to warn out of warning assertion
|
| | |
|
|\ \
| |/
| | |
DEP: Make np.delete on out-of-bounds indices an error
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Note that this only affects lists of indices.
```python
>>> a = np.arange(3)
````
Before:
```python
>>> np.delete(a, 100)
IndexError
>>> np.delete(a, [100])
DeprecationWarning
array([0, 1, 2])
>>> np.delete(a, -1)
array([0, 1])
>>> np.delete(a, [-1])
FutureWarning
array([0, 1, 2])
```
After:
```python
>>> np.delete(a, 100)
IndexError
>>> np.delete(a, [100])
IndexError
>>> np.delete(a, -1)
array([0, 1])
>>> np.delete(a, [-1])
array([0, 1])
```
|
|\ \
| | |
| | | |
DEP: Forbid passing non-integral index arrays to `insert` and `delete`
|
| |/
| |
| |
| | |
This expires a deprecation warning from back in 1.9.
|
|\ \
| |/
| | |
MAINT: Cleanups to np.insert and np.delete
|
| |
| |
| |
| | |
No behavior change here unless someone implements a subclass where `arr.ravel().ndim == 0`, which no sane person would do anyway.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This finishes the deprecation started in gh-9505 removing
behaviour that allowed strings/types representing specific dtypes
to behave like their more generic supertypes (e.g. the python
float would map to floating instead of float64 which it typically
maps to).
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
|
| |
| |
| | |
* BUG, TST: fix f2py for PyPy, skip one test for PyPy, xfail tests for s390x
|
|/
|
|
|
|
|
|
|
|
|
| |
(#15736)
Currently, in function array_shape_set, ndarray's pointers to dimensions and strides are freed before new array is allocated (Line 71). In case memory error occur, the array is left with dangling pointers. Therefore, we can not recover from such error.
* To guarantee array in valid state when memory error occur
* Fix: Free cache when nd == 0 to avoid memory leak
* Update numpy/core/src/multiarray/getset.c
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
|
|
|
|
|
|
|
| |
`global` is only needed if a variable appears on the left of an assignment.
These variables do not.
Most suffer from the misconception that `var[x] = y` requires `var` to be global, but it does not.
|
|\
| |
| | |
BUG,MAINT: Remove incorrect special case in string to number casts
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The string to number casts fall back to using the scalars and
the type setitem function to do the cast.
However, before calling setitem, they sometimes already called
the Python function for string coercion. This is unnecessary.
Closes gh-15608
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
(gh-15463)
xref gh-14778
As pointed out in the comment by @jamesthomasgriffin, we did not include a pxd file to expose the distribution functions documented in the random c-api. This PR adds a c_distributions.pxd file that exposes them.
Squashed commits:
* BUG: add missing c_distributions.pxd to enable cython use of random C-API
* ENH, TST: add npyrandom library like npymath, test cython use of it
* BUG: actually prefix f-string with f
* MAINT: fixes from review, add _bit_generato_bit_generator.pxd
* STY: fixes from review
* BLD: don't use nprandom library for mtrand legacy build
* TST: WindowsPath cannot be used in subprocess's list2cmdline
* MAINT, API: move _bit_generator to bit_generator
* DOC: add release note about moving bit_generator
* DOC, MAINT: fixes from review
* MAINT: redo dtype determination from review
|
| |
| |
| |
| |
| |
| |
| | |
* TST: Test during import to detect bugs with Accelerate(MacOS) LAPACK
fixes #15647
* Pipeline update for Accelerate(MacOS) testing
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Tweak a few lines so that arrays with an axis with length 0
don't break the np.unique code.
Closes gh-15559.
|
| |
| |
| |
| |
| | |
This code is from github user huonw, from this PR:
https://github.com/numpy/numpy/pull/15565
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
in documentation (#15740)
* Clarify `fro` and `nuc` usage in linalg.norm documentation
(see #15533).
* Add improved error handling when getting Frobenius norm from
a vector (see #15533).
* Fix comment in linalg norm test.
Closes gh-15533.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There are multiple conditions that `_attempt_nocopy_reshape` checks for
when ndarray.shape is mutated directly. Discussion of #10146 indicated
that an error message referencing any type of contiguity would not be
correct for all cases, so the error message has been changed to be more
general.
* ENH: shorten message and use "in-place"
* MAINT: typo from review
Co-authored-by: hanjohn <hanjohn@users.noreply.github.com>
Co-authored-by: mattip <matti.picus@gmail.com>
|
| |
| |
| | |
* DOC: Refactor polynomial docs using automodule.
|
| |
| |
| |
| |
| | |
This is largely a re-submission of the original change proposed in #6509. Discussion was hosted in multiple forums including #3474, the numpy mailing list circa 10-2015, and the 02-26-2020 NumPy Triage meeting.
This PR closes #3474 and #15570
|
| |
| |
| |
| |
| |
| |
| |
| | |
Removes unnecessary code introduced in #15696.
Non-native byte orders were explicitly added to the fast-path
check in _var for complex numbers. However, the non-native
path is unreachable due to coercion in upstream ufuncs.
|
|\ \
| | |
| | | |
MAINT: Add a fast path to var for complex input
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
var currently has a conditional that results in conjugate being
called for the variance calculation of complex inputs.
This leg of the computation is slow. This PR avoids this
computational leg for complex inputs via a type check.
Closes #15684
|
|\ \ \
| | | |
| | | | |
MAINT: Fixing typos in f2py comments and code.
|
| |/ / |
|
| | | |
|
| |/
|/|
| |
| |
| |
| | |
* MAINT: use list-based APIs to call subprocesses
* TST, MAINT: add a test for mingw32ccompiler.build_import, clean up lib2def
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
|\ \
| | |
| | | |
DEP: Do not allow "abstract" dtype conversion/creation
|
| | |
| | |
| | | |
Co-Authored-By: Matti Picus <matti.picus@gmail.com>
|
| | |
| | |
| | |
| | |
| | | |
Add a comment that we can think about only allowing it for `dtype=...`
though...
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
These dtypes do not really make sense as instances. We can (somewhat)
reasonably define np.dtype(np.int64) as the default (machine endianess)
int64. (Arguably, it is unclear that `np.array(arr_of_>f8, dtype="f")`
should return arr_of_<f8, but that would be very noisy!)
However, `np.integer` as equivalent to long, is not well defined.
Similarly, `dtype=Decimal` may be neat to spell `dtype=object` when you
intend to put Decimal objects into the array. But it is misleading,
since there is no special meaning to it at this time.
The biggest issue with it, is that `arr.astype(np.floating)` looks
like it will let float32 or float128 pass, but it will force a
float64 output! Arguably downcasting is a bug in this case.
A related issue is `np.dtype("S")` and especially "S0". The dtype "S"
does make sense for most or all places where `dtype=...` can be
passed. However, it is conceptionally different from other dtypes, since
it will not end up being attached to the array (unlike "S2" which
would be). The dtype "S" really means the type number/DType class
of String, and not a specific dtype instance.
|
|\ \ \
| | | |
| | | | |
BUG: Fixing result of np quantile edge case
|
| | | | |
|
| |_|/
|/| |
| | |
| | | |
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* DOC: Improve docs for np.finfo.
Replace inaccurate statements about eps and epsneg attrs with
correct statements and examples.
Added np.spacing and np.nextafter to See Also.
Closes #6940.
* Removed LaTeX math from finfo docstring.
* MAINT: Add periods at end of some sentences.
Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
|
| | |
| | |
| | |
| | | |
Reference multiple relevant discussions on GH
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Clarifies a FIXME comment in numpy/__init__.py by referencing
relevant discussion in issue tracker.
Closes #15668.
|
|/ /
| |
| |
| |
| |
| | |
Updated the description to consider all array elements
Updated the examples to use multiple elements array, to show that one element not close enough prevent for the whole array to be considered as real
Closes #15626
|
| | |
|
|\ \
| | |
| | | |
TST: check exception details in refguide_check.py
|
| | |
| | |
| | |
| | | |
xref GH-12548
|
|\ \ \
| | | |
| | | | |
DOC: Remove duplicated code in true_divide docstring
|