[Numpy-discussion] Non-numeric arrays?

Magnus Lie Hetland magnus at hetland.org
Thu Apr 25 07:43:10 CDT 2002


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
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...)

--
Magnus Lie Hetland                                  The Anygui Project
http://hetland.org                                  http://anygui.org




More information about the Numpy-discussion mailing list