class TestScalarDiscovery:
Undocumented
Method | test_char_special_case |
Undocumented |
Method | test_char_special_case_deep |
Undocumented |
Method | test_default_dtype_instance |
Undocumented |
Method | test_pyscalar_subclasses |
No summary |
Method | test_scalar |
Undocumented |
Method | test_scalar_coercion |
Undocumented |
Method | test_scalar_coercion_same_as_cast_and_assignment |
No summary |
Method | test_scalar_promotion |
Undocumented |
Method | test_scalar_to_int_coerce_does_not_cast |
Signed integers are currently different in that they do not cast other NumPy scalar, but instead use scalar.__int__(). The hardcoded exception to this rule is np.array(scalar, dtype=integer) . |
Method | test_unknown_object |
Undocumented |
Method | test_void_special_case |
Undocumented |
Undocumented
np.array(scalar, dtype=dtype)
np.empty((), dtype=dtype)[()] = scalar
np.array(scalar).astype(dtype)
should behave the same. The only exceptions are paramteric dtypes (mainly datetime/timedelta without unit) and void without fields.
Undocumented
np.array(scalar, dtype=integer)
.