Re: [Numpy-discussion] Array and string interoperability

2017-06-04 Thread Thomas Jollans
On 04/06/17 20:04, Mikhail V wrote: > Initialize array from a string currently looks like: > > s= "012 abc" > A= fromstring(s,"u1") > print A -> > [48 49 50 32 97 98 99] > > Perfect. > Now when writing values it will not work > as IMO it should, namley consider this example: > > B= zeros(7,"u1") >

[Numpy-discussion] Array and string interoperability

2017-06-04 Thread Mikhail V
Array and string interoperability Just sharing my thoughts and few ideas about simplification of casting strings to arrays. In examples assume Numpy is in the namespace (from numpy import *) Initialize array from a string currently looks like: s= "012 abc" A= fromstring(s,"u1") print A -> [48 49