8000 BUG: np.asscalar should pass through scalars by seawolf631 · Pull Request #10256 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
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
5 changes: 4 additions & 1 deletion numpy/lib/type_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,10 @@ def asscalar(a):
24

"""
return a.item()
if np.isscalar(a):
return a
else:
return a.item()

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

Expand Down
0