Skip to content
Merged
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
4 changes: 4 additions & 0 deletions pint/facets/numpy/numpy_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def _is_sequence_with_quantity_elements(obj):
-------
True if obj is a sequence and at least one element is a Quantity; False otherwise
"""
if np is not None and isinstance(obj, np.ndarray) and not obj.dtype.hasobject:
# If obj is a numpy array, avoid looping on all elements
# if dtype does not have objects
return False
return (
iterable(obj)
and sized(obj)
Expand Down