I would like to subclass numpy ndarray. However, I cannot change the array. Why self = ... does not change the array? Thanks.
import numpy as np
I tried to do the same, but it is really very complex to subclass ndarray.
If you only have to add some functionality, I would suggest to create a class which stores the array as attribute.
class Data(object):
def __init__(self, array):
self.array = array
def remove_some(self, t):
//operate on self.array
pass
d = Data(z)
print(d.array)