Skip to content

Commit be47b86

Browse files
author
Julian Harbeck
committed
Stop item_from_zerodim from converting subclasses of np.ndarray to float
1 parent 9f66b81 commit be47b86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/_libs/lib.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def item_from_zerodim(val: object) -> object:
322322
>>> item_from_zerodim(np.array([1]))
323323
array([1])
324324
"""
325-
if cnp.PyArray_IsZeroDim(val):
325+
if cnp.PyArray_IsZeroDim(val) and cnp.PyArray_CheckExact(val):
326326
return cnp.PyArray_ToScalar(cnp.PyArray_DATA(val), val)
327327
return val
328328

0 commit comments

Comments
 (0)