In [7]:
import numpy as np

mat = np.random.randint(5,size = (5,3))
mat.size

np.zeros(*mat)


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-30f60d992152> in <module>()
      4 mat.size
      5 
----> 6 np.zeros(*mat)

TypeError: function takes at most 3 arguments (5 given)

In [8]:
import numpy as np
a = np.zeros((5,4))
np.random.rand(a.shape)<0.5


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-8-383b4abc66c8> in <module>()
      1 import numpy as np
      2 a = np.zeros((5,4))
----> 3 np.random.rand(a.shape)<0.5

mtrand.pyx in mtrand.RandomState.rand (numpy/random/mtrand/mtrand.c:13297)()

mtrand.pyx in mtrand.RandomState.random_sample (numpy/random/mtrand/mtrand.c:10063)()

mtrand.pyx in mtrand.cont0_array (numpy/random/mtrand/mtrand.c:1812)()

TypeError: an integer is required

In [ ]:
a = np.random.randint(5, size(5,1))
a

In [ ]: