8000 ENH: Add the `axis` and `ndim` attributes to `np.AxisError` by BvB93 · Pull Request #19459 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Add the axis and ndim attributes to np.AxisError #19459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DOC: Reguide fix
  • Loading branch information
Bas van Beek committed Jul 13, 2021
commit cd7fcb34e5cb142e59f4a733db9b642c76be7720
6 changes: 3 additions & 3 deletions numpy/core/_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,13 @@ class AxisError(ValueError, IndexError):
The class constructor generally takes the axis and arrays'
dimensionality as arguments:

>>> np.AxisError(2, 1, prefix='error')
numpy.AxisError('error: axis 2 is out of bounds for array of dimension 1')
>>> np.AxisError(2, 1, msg_prefix='error')
AxisError('error: axis 2 is out of bounds for array of dimension 1')

Alternatively, a custom exception message can be passed:

>>> np.AxisError('Custom error message')
numpy.AxisError('Custom error message')
AxisError('Custom error message')

"""

Expand Down
0