In [2]:
import numpy as np
import matplotlib.pyplot as pp
In [2]:
a = np.array([1,2,3,4,5])
a
Out[2]:
In [3]:
a.dtype
Out[3]:
In [4]:
a = np.array([1,2,3,4,5],dtype=np.float64)
a
Out[4]:
In [5]:
a.ndim, a.shape, a.size
Out[5]:
In [6]:
b = np.array([[1,2,3,4,5],[6,7,8,9,10]],dtype=np.float64)
In [7]:
b
Out[7]:
In [8]:
b.dtype
Out[8]:
In [9]:
b.ndim, b.shape, b.size
Out[9]:
In [10]:
np.zeros((3,3),'d')
Out[10]:
In [11]:
np.empty((4,4),'d')
Out[11]:
In [4]:
np.linspace(0,10,2)
Out[4]:
In [13]:
np.arange(0,10,2)
Out[13]:
In [14]:
np.random.standard_normal((2,4))
Out[14]:
In [15]:
a = np.random.standard_normal((2,3))
b = np.random.standard_normal((2,3))
np.vstack([a,b])
Out[15]:
In [16]:
np.hstack([a,b])
Out[16]:
In [17]:
a.transpose()
Out[17]:
In [18]:
np.save('example.npy',a)
In [19]:
a1 = np.load('example.npy')
In [20]:
a1
Out[20]:
In [ ]: