import numpy
import numpy as np
from numpy import *
a=[1,2,3,4,5]
[x+1 for x in a]
b=[2,3,4,5,6,7]
[c+d for (c,d) in zip(a,b)]
a=np.array([1,2,3,4])
a+1
l=[1,2,3,4]
a=np.array(l)
np.zeros(10)
np.ones(10,dtype='int')
a.fill(2.5)
a=a.astype('float')
a=np.arange(1,11,2)
a=np.linspace(1,10,10)
a=np.random.rand(5)
a=np.random.randn(5)
a=np.random.randint(1,10,6)
type(a)
a.dtype
a.shape
a.ndim
a=np.array([0,1,2,3,4,5])
a[0]
a[1:3]
a=np.array([[0,1,2,3],[1,2,3,4]])
a.shape
a.ndim
a[1,2]
a[1,]
a[:,1]
a=np.array([1,2,3,4])
b=copy(a[1:3])
b[1]=9999
a
b=a[1:3]
b[1]=9999
a
a=[1,2,3,4]
b=a[1:3]
b[1]=9999
a
a=np.arange(0,50,10)
index=[1,2,-1]
y=a[index]
y
mask=np.array([0,0,2,0,1],dtype=bool)
z=a[mask]
z
np.where(a>10)
np.where(True)
a=np.array([1,5,2,3],dtype=float)
np.asarray(a,dtype=int)
b=a.astype(int)
np.sort(a)
np.argsort(a)
a[np.argsort(a)]
np.max(a)
np.sum(a)
np.std(a)
np.cov(a,b)
a=np.array([1,5,2,3,5,6],dtype=float)
a.shape=2,3
a=np.array([1,5,2,3,5,6],dtype=float)
a.reshape(2,3)
a.T
a.transpose()
x=np.array([1,2,-3,4,5])
y=np.array([11,22,33,44,55])
z=np.array((x,y))
z
np.vstack((x,y))
np.hstack((x,y))
np.dstack((x,y))
np.abs(x)
np.exp(x)
np.median(x)
np.cumsum(x)