Is there a way to execute a roll over an array, but instead of having a copy of data that has only visualization?
An example can be made clear: given b deployed version of a ...
>>> a = np.random.randint(0, 10, (3, 3)) >>> a array([[6, 7, 4], [5, 4, 8], [1, 3, 4]]) >>> b = np.roll(a, 1, axis=0) >>> b array([[1, 3, 4], [6, 7, 4], [5, 4, 8]])
... if I perform an assignment in an array b ...
>>> b[2,2] = 99 >>> b array([[ 1, 3, 4], [ 6, 7, 4], [ 5, 4, 99]])
... the contents of a will not change ...
>>> a array([[6, 7, 4], [5, 4, 8], [1, 3, 4]])
... on the contrary, I would like to have:
>>> a array([[6, 7, 4], [5, 4, 99], # observe as `8` has been changed here too! [1, 3, 4]])
Thank you in advance for your time and knowledge!