Hi,
You can see the print statement, which is,
print(scalar_array, np.ndim(scalar_array), scalar_array.dtype)
The output is given as:
scalar_array → one_element
np.ndim(scalar_array) → 0
scalar_array.dtype → <U11
TO elaborate:
np.ndim(scalar_array) → 0
Because there are no axes (it’s not a vector or matrix, just a scalar).
Example:
np.array([1,2,3]) → ndim = 1
np.array([[1,2],[3,4]]) → ndim = 2
np.array(“one_element”) → ndim = 0
Further, scalar_array.dtype → <U11
< means little-endian byte order (not important for text usually, doesn’t really affect Unicode strings in practice — it’s more relevant for numbers).
U means Unicode string.
11 means each string element has max length 11 characters.
“one_element” has 11 characters, so dtype = <U11.
Hope this helps.