subarr = np.array(arr, dtype=dtype, copy=copy).view(cls)
// We only want numerical datatypes
if not np.issubdtype(subarr.dtype, np.number):
raise TypeError("Quantities can only be created from numerical data.")
// Use the given dimension or the dimension of the given array (if any)
After Change
subarr = np.array(arr, dtype=dtype, copy=copy).view(cls)
// We only want numerical datatypes
if not (np.issubdtype(subarr.dtype, np.number) or
np.issubdtype(subarr.dtype, np.bool_)):
raise TypeError("Quantities can only be created from numerical data.")
// Use the given dimension or the dimension of the given array (if any)