Thanks, your solution is very good.
But I have still one problem: the last line makes this:
>>> x = np.fromstring(b,sep='')
>>> x
array([ 8.56506822e-072, 2.92021791e-033, 2.25187638e+006, ...,
6.99021630e-077, 1.39804329e-076, 2.66133772e-260])
As you can see, it doesn't load the exponent right!
On other hand, I don't understand why I get an exception with:
>>>a
' 0.000000000E+00 1.806088833E-02-4.959341557E+07 0.000000000E+00
0.000000000E+00\n'
>>> a2 = a.replace('E-','EE').replace('-',' -').replace('EE','E-')
>>> y = np.fromstring(a2,sep='')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: string size must be a multiple of element size
Thank you
2009/4/22 Gary Ruben <gary.ru...@gmail.com>
> (offlist)
> In case you haven't seen it before, there's an implied line at the start:
> import numpy as np
>
> making the code
>
> import numpy as np
> f = open(file)
> s = f.read()
> f.close()
> a = s.replace('E-','EE').replace('-',' -').replace('EE','E-')
> x = np.fromstring(a, sep=' ')
>
> Gary Ruben wrote:
>
>> How about
>>
>> f = open(file)
>> s = f.read()
>> f.close()
>> a = s.replace('E-','EE').replace('-',' -').replace('EE','E-')
>> x = np.fromstring(a, sep=' ')
>>
>> Gary R.
>>
>
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users