import numpy as np
z = np.random.randint(2,9,(2,3))
z
m = np.random.randint(9,size =(2,3))
m
array([[8, 7, 4],
[5, 7, 3]])
import numpy as np
A = np.arange(95,99).reshape(2,2)
A
array([[95, 96],
[97, 98]])
import numpy as np
A = np.arange(95,99).reshape(2,2)
np.pad(A,((3,2),(2,3)),‘constant’,constant_values =(0,0))
File "<ipython-input-7-08a029ef5428>", line 4
np.pad(A,((3,2),(2,3)),‘constant’,constant_values = (0,0))
^
SyntaxError: invalid character in identifier
import numpy as np
x = np.empty([3,2], dtype =int)print(x)
[[0 0]
[0 0]
[0 0]]
import numpy as np
c = np.array([[1,2],[3,4]])
c
c.astype(np.float32)
array([[1.,2.],[3.,4.]], dtype=float32)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-9-8034286ed058> in <module>()
3 c
4 c.astype(np.float32)
----> 5 array([[1., 2.],
6 [3., 4.]], dtype=float32)
NameError: name 'array' is not defined