In [1]:
import numpy as np
In [2]:
np.zeros(10)
Out[2]:
In [3]:
np.ones(10)
Out[3]:
In [4]:
np.ones(10) * 5
Out[4]:
In [5]:
np.arange(10,51)
Out[5]:
In [6]:
np.arange(10,51,2)
Out[6]:
In [7]:
np.arange(9).reshape(3,3)
Out[7]:
In [8]:
np.eye(3)
Out[8]:
In [15]:
np.random.rand(1)
Out[15]:
In [33]:
np.random.randn(25)
Out[33]:
In [35]:
np.arange(1,101).reshape(10,10) / 100
Out[35]:
In [36]:
np.linspace(0,1,20)
Out[36]:
In [38]:
mat = np.arange(1,26).reshape(5,5)
mat
Out[38]:
In [39]:
# WRITE CODE HERE THAT REPRODUCES THE OUTPUT OF THE CELL BELOW
# BE CAREFUL NOT TO RUN THE CELL BELOW, OTHERWISE YOU WON'T
# BE ABLE TO SEE THE OUTPUT ANY MORE
In [40]:
mat[2:,1:]
Out[40]:
In [29]:
# WRITE CODE HERE THAT REPRODUCES THE OUTPUT OF THE CELL BELOW
# BE CAREFUL NOT TO RUN THE CELL BELOW, OTHERWISE YOU WON'T
# BE ABLE TO SEE THE OUTPUT ANY MORE
In [41]:
mat[3,4]
Out[41]:
In [30]:
# WRITE CODE HERE THAT REPRODUCES THE OUTPUT OF THE CELL BELOW
# BE CAREFUL NOT TO RUN THE CELL BELOW, OTHERWISE YOU WON'T
# BE ABLE TO SEE THE OUTPUT ANY MORE
In [42]:
mat[:3,1:2]
Out[42]:
In [31]:
# WRITE CODE HERE THAT REPRODUCES THE OUTPUT OF THE CELL BELOW
# BE CAREFUL NOT TO RUN THE CELL BELOW, OTHERWISE YOU WON'T
# BE ABLE TO SEE THE OUTPUT ANY MORE
In [46]:
mat[4,:]
Out[46]:
In [32]:
# WRITE CODE HERE THAT REPRODUCES THE OUTPUT OF THE CELL BELOW
# BE CAREFUL NOT TO RUN THE CELL BELOW, OTHERWISE YOU WON'T
# BE ABLE TO SEE THE OUTPUT ANY MORE
In [49]:
mat[3:5,:]
Out[49]:
In [50]:
mat.sum()
Out[50]:
In [51]:
mat.std()
Out[51]:
In [53]:
mat.sum(axis=0)
Out[53]: