import numpy as np
NumPy array
#creating Numpy array
myList = [1,2,3]
np.array(myList)
x=np.array(myList)
type(x)
myMatrix=[[1,2,3],[4,5,6],[7,8,9]]
np.arange(0,5)
# range with step size
np.arange(0,11,2)
#float number
np.zeros(3)
np.zeros((3,3))
np.ones(3)
np.linespace
np.linspace(0,10,3)
np.eye(4)
np.random
np.random.rand(5,4)
np.random.randn(5,4)
np.random.randint(1,100)
np.random.randint(1,100,10)
arr = np.arange(25)
ranarr = np.random.randint(0,50,10)
np.random.randn(5,4)
np.random.randint(1,100)
np.random.randint(1,100,10)
arr = np.arange(25)
ranarr = np.random.randint(0,50,10)
arr.reshape(5,5)
arr.shape
arr.dtype
ranarr.max()
ranarr.argmax()
ranarr.min()
ranarr.argmin()
No comments:
Post a Comment