In [6]:
%matplotlib inline
from matplotlib import pyplot as plt
import seaborn as sns
In [ ]:
In [7]:
import numpy as np
In [8]:
data = [0,2,4,6]
a = np.array(data)
In [9]:
type(a)
Out[9]:
In [10]:
a
Out[10]:
In [11]:
a.shape
Out[11]:
In [12]:
a.ndim
Out[12]:
In [13]:
a.size
Out[13]:
In [14]:
a.nbytes
Out[14]:
In [15]:
a.dtype
Out[15]:
In [17]:
data = [[0.0,2.0,4.0,6.0],[1.0,3.0,5.0,7.0]]
b = np.array(data)
In [18]:
b
Out[18]:
In [19]:
b.shape, b.ndim, b.size, b.nbytes
Out[19]:
In [21]:
c = np.arange(0.0,10.0,1.0)
c
Out[21]:
In [22]:
e = np.linspace(0.0,5.0,11)
e
Out[22]:
In [23]:
np.empty((4,4))
Out[23]:
In [24]:
np.zeros((3,3))
Out[24]:
In [25]:
np.ones((3,3))
Out[25]:
In [26]:
a = np.array([0,1,2,3])
In [28]:
a, a.dtype
Out[28]:
In [29]:
b = np.zeros((2,2), dtype = np.complex64)
b
Out[29]:
In [31]:
c = np.arange(0,10,2,dtype = np.float)
c
Out[31]:
In [32]:
d = c.astype(dtype = np.int)
d
Out[32]:
In [ ]: