8000 BUG: fixes #4701 related to numpy.asscalar by SpoorthyBhat · Pull Request #10680 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: fixes #4701 related to numpy.asscalar #10680

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
BUG: fixes #4701 related to numpy.asscalar
Allows numpy.asscalar to pass scalars
  • Loading branch information
SpoorthyBhat authored Mar 1, 2018
commit a944360e96cbdee873befa3d461c9eddc5702f3a
5 changes: 4 additions & 1 deletion numpy/lib/type_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,10 @@ def asscalar(a):
24

"""
return a.item()
try:
return a.item()
except AttributeError:
return np.asarray(a).item()

#-----------------------------------------------------------------------------

Expand Down
0