| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
* "bandwidth" -> "bin width"
* Minor grammatical fixes
|
|\
| |
| | |
BUG: Fix IndexError for illegal axis in np.mean
|
| |
| |
| |
| |
| | |
Catch IndexError in _count_reduce_items used in np.mean and np.var for
illegal axis and reraise as AxisError, see gh-15817.
|
| |
| |
| |
| |
| | |
types (#15816)
Cleanup from the dropping of python 2
|
|\ \
| | |
| | | |
BUG: don't add 'public' or 'private' if the other one exists
|
| | |
| | |
| | |
| | |
| | |
| | | |
Currently, setting 'public' or 'private' attribute is adding
one even if the other one already exists because of the else:
part that is always appending.
|
| |/
|/|
| |
| |
| | |
* ENH: improved error message when the dimension of index is larger than the dimension of array, fixed issue #15321
Author: Yilin Li <yilin.lasia@gmail.com>
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, when writing something like
```
pd.DataFrame({'arr': np.array(1., 2., 3.)})
```
```
ValueError Traceback (most recent call last)
<ipython-input-1-ffdb00ae9b74> in <module>()
1 import numpy as np
2 import pandas as pd
----> 3 pd.DataFrame({'arr': np.array(1., 2., 3.)})
ValueError: only 2 non-keyword arguments accepted
```
This stack trace that doesn't include a frame for the np constructor, because the constructor is generated python code. This may lead users to look elsewhere for the issuer of the ValueError, which may create red-herrings in that folks may look elsewhere.
This changes makes it more obvious where the error is coming from.
* reflects eric-wieser's suggestion about common error messages
* Documents required non-keyword args for np.array
* Update numpy/core/src/multiarray/multiarraymodule.c
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
* Update numpy/core/src/multiarray/multiarraymodule.c
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
* Update numpy/core/src/multiarray/multiarraymodule.c
Co-Authored-By: Eric Wieser <wieser.eric@gmail.com>
* Update multiarraymodule.c
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This expires a deprecation from 1.8.
The corresponding deprecation in `np.insert` has less clear semantics, so has been left to a future patch.
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Co-authored-by: Warren Weckesser <warren.weckesser@gmail.com>
|
|\ \
| | |
| | | |
TST: Add unit test for out=None of np.einsum
|
| | |
| | |
| | |
| | |
| | | |
Ensure that explicitly stating out=None does not raise an error in
np.einsum, see #15776 and #15256.
|
| | |
| | |
| | |
| | | |
Errors raised when casting some strided arrays are not caught.
See gh-15790.
|
|\ \ \
| | | |
| | | | |
MAINT: pathlib and hashlib are in stdlib in Python 3.5+
|
| | | | |
|
| | | | |
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fix and test conversion of masked element to string in fstring / string interpolation. See PEP 498 for string interpolation (aka fstrings) in Python 3.6 and above.
Fixes #15409.
Original PR gh-15410 by: Stefan Codrescu <ssmmcc1@gmail.com>
Co-authored-by: Stefan Codrescu <ssmmcc1@gmail.com>
Co-authored-by: Stefan <5tefan@users.noreply.github.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
|
|\ \ \
| | | |
| | | | |
BUG: Add error-checking versions of strided casts.
|
| | | |
| | | |
| | | |
| | | | |
Closed gh-15790.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Errors raised when casting some strided arrays are not caught.
See gh-15790.
|
| | |/
| |/| |
|
|\ \ \
| | | |
| | | | |
DEP: Make `np.insert` and `np.delete` on 0d arrays with an axis an error
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Before this change, the following code worked:
```
>>> some_0d = np.array(1)
>>> np.insert(some_0d, "some nonsense", 10, axis=0)
array(10)
>>> np.insert(some_0d, "some nonsense", 42, axis="some nonsense")
array(42)
```
Now these raise AxisError and TypeError, respectively.
`delete` is exactly the same.
|
|\ \ \ \
| | | | |
| | | | | |
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
|