x1 = x.copy()
x1[x1 > 2] = 555
x1
array([[ 1, 2, 555],
[ -3, 1, 555],
[ 1, -2, 555]])
x
array([[ 1, 2, 3],
[-3, 1, 4],
[ 1, -2, 9]])
x2 = x
x2
array([[ 0, 0, 0],
[-3, 0, 0],
[ 0, -2, 0]])
x
array([[ 0, 0, 0],
[-3, 0, 0],
[ 0, -2, 0]])
x = np.array([[1,2,3],[-3,2,4],[5,-2,9]])
x3 = x[2]
x3
array([ 5, -2, 9])
x3[1] = 666
x
array([[ 1, 2, 3],
[ -3, 2, 4],
[ 5, 666, 9]])
import numpy as np
x = np.array([[1,2,3],[4,5,6],[1,1,1]])
np.zeros_like(x)
array([[0, 0, 0],
[0, 0, 0],
[0, 0, 0]])
import numpy as np
n = np.random.rand(3,3)
n
array([[0.41149638, 0.61946996, 0.76353632],
[0.15538046, 0.9615752 , 0.11827965],
[0.62096548, 0.112