
Hi all, is it possible to subclass numpy.array to set extras functionalities and change the behavior of others? I can't find any docs on that. Thanks -- Lionel Roubeyrie - lroubeyrie@limair.asso.fr LIMAIR http://www.limair.asso.fr

On Friday 01 December 2006 06:19, Lionel Roubeyrie wrote:
Hi all, is it possible to subclass numpy.array to set extras functionalities and change the behavior of others? I can't find any docs on that.
Did you really look ;) ? http://www.scipy.org/Subclasses Check also the new implementation of MaskedArray, where masked arrays are implemented as subclass of ndarrays http://projects.scipy.org/scipy/numpy/wiki/MaskedArray. If you have some particular features in mind, let us know. P.

Arg! I really didn't see that! thanks Le Vendredi 01 Décembre 2006 12:58, Pierre GM a écrit :
On Friday 01 December 2006 06:19, Lionel Roubeyrie wrote:
Hi all, is it possible to subclass numpy.array to set extras functionalities and change the behavior of others? I can't find any docs on that.
Did you really look ;) ? http://www.scipy.org/Subclasses
Check also the new implementation of MaskedArray, where masked arrays are implemented as subclass of ndarrays http://projects.scipy.org/scipy/numpy/wiki/MaskedArray.
If you have some particular features in mind, let us know. P. _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
-- Lionel Roubeyrie - lroubeyrie@limair.asso.fr LIMAIR http://www.limair.asso.fr

A Divendres 01 Desembre 2006 12:19, Lionel Roubeyrie escrigué:
Hi all, is it possible to subclass numpy.array to set extras functionalities and change the behavior of others? I can't find any docs on that. Thanks
If what you want is extending the functionality of ndarray at C level, there is a complete section dedicated to this ('Subtyping the ndarray in C', chapter 15) in Travis' Guide to NumPy [1]. [1] http://www.tramy.us/ Cheers, --
0,0< Francesc Altet http://www.carabos.com/ V V Cárabos Coop. V. Enjoy Data "-"

I search to handle time series by associating dates to a masked array, but no set (directly) computation (sum, max, ...) on dates and have the possibility to search/select datas entries by date. Le Vendredi 01 Décembre 2006 13:54, Francesc Altet a écrit :
If what you want is extending the functionality of ndarray at C level, there is a complete section dedicated to this ('Subtyping the ndarray in C', chapter 15) in Travis' Guide to NumPy [1].
Cheers,
-- Lionel Roubeyrie - lroubeyrie@limair.asso.fr LIMAIR http://www.limair.asso.fr
participants (3)
-
Francesc Altet
-
Lionel Roubeyrie
-
Pierre GM