[Numpy-discussion] Non-numeric arrays?

Todd Miller jmiller at stsci.edu
Thu Apr 25 07:53:04 EDT 2002


Magnus Lie Hetland wrote:

>I can't find this in the docs (although I've heard it's mentioned
>there)... Is support for non-numeric arrays (such as character arrays
>or object pointer arrays) as in Numeric planned for numarray? (Perhaps
>
Check out chararray for character arrays.  
Check out recarray for arrays of fixed length structs.  
To make your own non-numeric arrays, subclass NDArray.

>
>even supported? My version might not be themost recent...)
>
>And what about subclasses of numeric types?
>
>E.g:
>
># numarray
>
>>>>class foo(int): pass
>>>>a = array(map(foo, xrange(10)))
>>>>
>[...]
>TypeError: Expecting a python numeric type, got a foo
>
># Numeric
>
>>>>class foo(int): pass
>>>>a = array(map(foo, xrange(10)))
>>>>tupe(a[0])
>>>>
><type 'int'>
>
>Neither behaviour seems very helpful -- I guess numarray's is
>cleaner... (Although in this case I think an object array could have
>been nice...)
>
Object arrays fall into the *eventually* category:  planned but not 
imminent.

>
>
>--
>Magnus Lie Hetland                                  The Anygui Project
>http://hetland.org                                  http://anygui.org
>
>_______________________________________________
>Numpy-discussion mailing list
>Numpy-discussion at lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>
Todd

-- 
Todd Miller 			jmiller at stsci.edu
STSCI / SSG			(410) 338 4576







More information about the NumPy-Discussion mailing list