I might have used the wrong terminology for this question, consequently there might have been a replicate of this question, but I was not able to find it.
In the following example, if it is possible, what would be the instruction in In [16]
such that if b is modified, the slice of a a[3:6]
is affected too ?
In [12]: import numpy as np
In [13]: a = np.zeros((7))
In [14]: b = np.random.rand(3,)
In [15]: b
Out[15]: array([ 0.76954692, 0.74704679, 0.05969099])
In [16]: a[3:6] = b
In [17]: b[0] = 2.2
In [18]: a # a has not changed
Out[18]:
array([ 0. , 0. , 0. , 0.76954692, 0.74704679,
0.05969099, 0. ])