Coding skills here for learning
5 subscribers
266 photos
3 files
10 links
Download Telegram
a = np.array([[1,2,3,4,5,6,7],[8,9,10,11,12,13,14]])


a[1, 5]


for finding with index
you can use it with negative indexing
a[0, :] gets all from first row
a[:, 2] means to get from all the rows 3rd number
a[0, 1:6:2] means first row start from 1 end in 6 index stepping with 2
if a[1, 5] = 13

a[1,5] = 20

means changing by index
a[:, 2] = [1, 2]

which means from all row first and second argument should be 1 , 2
b[0, 1, 1] means 1st row 2 second level 2 second number
np.zeros((2,3)) means 2 rows and 3 columns with zeros
np.full((2,2), number you want)
np.full_like(a, 4) means any number and also 4
np.random.rand(4,2)
np.random.random_sample()
np.random.randint(7, size=())
np.identity()
r1 = np.repeat(array, times)
with two dimensional array do axis= 0
output = np.ones((5,5))

z = np.zeros((3.3))
z[1,1] = 9

output[1:4, 1:4] = z
when copying be careful even though you assign in new variable it changes
a = np.array()
b = a.copy()