import numpy as np
array_nums = np.array([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]])
print("Original array:")
print(array_nums)
print("\nNumber of items of the said array:")
print(array_nums.size)
print("\nArray dimensions:")
print(array_nums.shape)
print("\nNumber of array dimensions:")
print(array_nums.ndim)
print("\nMemory size of each element of the said array")
print(array_nums.itemsize)
Sample Output:
Original array:
[[ 1 2 3 4]
[ 5 6 7 8]
[ 9 10 11 12]]
Number of items of the said array:
12
Array dimensions:
(3, 4)
Number of array dimensions:
2
Memory size of each element of the said array
8
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer