[Numpy-discussion] Character typecode

Jochen Küpper jochen at unc.edu
Sun Jan 27 07:36:03 CST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to the manual there is a typecode 'Character'. But the
following program gives an error:
,----
| import Numeric as num
| data = num.array([1,2,3], num.Character)
`----
,----
| Traceback (most recent call last):
|   File "<stdin>", line 2, in ?
| AttributeError: 'module' object has no attribute 'Character'
`----

This is python-2.2, latest NumPy cvs. The following line fixes
that. Any reason that isn't in there?

Index: Lib/Precision.py
===================================================================
RCS file: /cvsroot/numpy/Numerical/Lib/Precision.py,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Precision.py
- --- Lib/Precision.py    2000/01/13 21:23:06     1.1.1.1
+++ Lib/Precision.py    2002/01/27 15:30:50
@@ -33,6 +33,7 @@
             return typecode
     raise PrecisionError, key+" of "+str(required_bits)+" bits not available on this system"
 
+Character = 'c'
 UnsignedInt8 = 'b'
 
 try: Int0 = _lookup(_code_table, 'Integer', 0)


Greetings,
Jochen

PS: The manual page http://pfdubois.com/numpy/html2/numpy-6.html is
    really messed up right at the spot where typecodes are
    explained. That is with Netscape-4.7 and Mozilla-0.9.7 on Linux
    and Win2000.

PPS: What format is the manual master deocument in? Would it be
     feasible to generate info pages from that?
- -- 
University of North Carolina                       phone: +1-919-962-4403
Department of Chemistry                            phone: +1-919-962-1579
Venable Hall CB#3290 (Kenan C148)                    fax: +1-919-843-6041
Chapel Hill, NC 27599, USA                            GnuPG key: 44BCCD8E
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6-cygwin-fcn-1 (Cygwin)
Comment: Processed by Mailcrypt and GnuPG <http://www.gnupg.org/>

iD8DBQE8VB5XiJ/aUUS8zY4RAhIxAJ43vXeTvN0hlbVmCsSCGCGYrt2m/wCeOvH8
lodh8d0YmJy0eCqMyglNdj0=
=z/Wo
-----END PGP SIGNATURE-----





More information about the Numpy-discussion mailing list