El dl 25 de 09 del 2006 a les 11:08 -0600, en/na Travis Oliphant va
escriure:
> Francesc Altet wrote:
> 
> >Hi,
> >
> >Anybody know if there is a map between NumPy types and Numeric
> >typecodes? Something like 'typecodes' for numarray:
> >  
> >
> How about
> 
> dtype(obj).char?

This doesn't work for many types:

>>> Numeric.array([1], typecode=numpy.dtype('int32').char)
array([1])

this is fine, but:

>>> Numeric.array([1], typecode=numpy.dtype('int16').char)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: typecode argument must be a valid type.
>>> Numeric.array([1], typecode=numpy.dtype('int64').char)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: typecode argument must be a valid type.


Anyway, this is not very important as I can do my own map internally.

Thanks,

-- 
>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to