Skip to main content

Posts

Showing posts from January 14, 2019

Numpy Basic

Numpy Basic Create a Numpy Array import numpy as np # create numpy array a = np.array([2,3,4]) print ("***** a *****") print ("value", a) # print array print ("data type", a.dtype) # data type of array print ("shape", a.shape) # size of array in each dimension(m, n) print ("size", a.size) # total number of elements of the array print ("itemsize", a.itemsize) # the size in bytes of each element of the array print ("ndim", a.ndim) print ("data", a.data) # buffer containing the actual elements of the array print ("***** b *****") # number of axes (dimensions) of the array. b = np.array([[1.2, 3.5, 5.1], [1.2, 3.5, 5.1]]) print ("value", b) print ("data type", b.dtype) print ("shape", b.shape) print ("size", b.size) print ("itemsize", b.itemsize) print ("ndim", b.ndim) print ...