Matthew Brett wrote:
> Hi,
>
> Sorry if this is silly question, but should this work to convert from
> int8 to character type?
>
> a = array([104, 105], dtype=N.int8)
> a.astype('|S1')
>   
I'm not sure what you are trying to do here, but the standard coercion 
to strings will generate
['104', '105'].  However you are only allowing 1 character strings so 
you get the first character.

If you are wanting to get characters with ASCII codes 104 and 105 you 
can do that without coercion by simply viewing the memory as a different 
data-type:

a.view('S1')

array([h, i],
      dtype='|S1')


-Travis



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to