Sebastian Haase wrote: > Hi, > there is a way of doing this. As far as I know, you have to create > your own "version of numpy arrays". E. g. try this: > class myNumpy(numpy.ndarray): > pass > > Then creating an instance as in > a = myNumpy(otherNumpyArray) > > would make `a` behave just like any other array, except that you CAN > attach attributes to it. > > Be carefull that some (many / most ?) operations on that array will > return you a normal numpy array again. > > I don't understand the reasons behind all of this. >
The __array_priority__ attribute determines who "wins" when two different sub-classes are involved in an operation. The ndarray has a priority of 0.0. -Travis _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
