The reason is that numpy arrays are immutable, which means that their elements cannot be modified once they are created. When you try to change an element of a numpy array using a class decorator, you are essentially trying to modify the array itself, which is not allowed. Instead, you need to create a new array with the desired modification.
Asked: 2023-06-14 11:46:40 +0000
Seen: 13 times
Last updated: Jun 14 '23