NumPy > View array info

Name
Code
Output
array = numpy.array([(1,2,3), (4,5,6)])
print ("shape",array.shape)
print ("shape axis0: ",array.shape[0])
print ("shape axis1: ",array.shape[1])
shape (2, 3)
shape axis0:  2
shape axis1:  3
array = numpy.random.random((2,3))
print ("data type: ",array.dtype.name)
data type:  float64
array = numpy.random.random((3,5))
print ("array length:",len(array))
array length: 3
array = numpy.random.random((2,3))
print ("number of dimensions:",array.ndim)
number of dimensions: 2
array = numpy.random.random((2,3))
print ("size: ",array.size)
size:  6