import numpy as np
np.array([5,7,8])
seqArr01 = np.arange(start=5, stop=10)
print(seqArr01)
seqArr02 = np.arange(start=5, stop=20, step=2)
print(seqArr02)
zeroArr = np.zeros(5) # creates an array with 5 "zeros"
print(zeroArr)
onesArr = np.ones(3) # aray with 3 "ones"
print(onesArr)
eightArr = np.ones(10) * 8 # first creates a 10 ones array; and them multiplies all values by 8
eightArr
np.array([[1,2,3],[4,5,6],[7,8,9]])
array1D = np.arange(9)
array1D
matrix2D = array1D.reshape(3,3)
matrix2D
np.random.rand(3) # 3 random numbers between 0 and 1
np.random.randint(low=10,high=20,size=(10,10)) # 100 integers between 10 and 20 (excluding 20) stored in a matrix 10 by 10
np.random.randn(4) # 4 values from a standard normal distribution
np.linspace(start=10,stop=20,num=100) # array with length = 100 with equally spaced values between 10 and 20
arr1 = np.arange(10)
arr2 = np.ones(10)*2
arr3 = arr1 + arr2
arr4 = arr1 / arr2
print(arr1)
print(arr2)
print(arr3)
print(arr4)
# Mean
arr4.mean()
# Sum
arr4.sum()
# standard deviation
arr4.std()
# min
arr4.min()
# max
arr4.max()