[SciPy-user] io.read_array only works for positive numbers?
Travis E. Oliphant
oliphant.travis at ieee.org
Wed Jun 4 15:03:46 EDT 2003
Here's what I get:
>>> scipy.__version__
'0.2.0_alpha_197.4144'
>>> io.read_array("legpols2.dat")
array([[ 1. , 1. , 1. , 1. , 1. ],
[-1. , -0.5 , 0. , 0.5 , 1. ],
[ 1. , -0.125 , -0.5 , -0.125 , 1. ],
[-1. , 0.4375, 0. , -0.4375, 1. ],
[ 1. , -0.2891, 0.375 , -0.2891, 1. ]])
Fernando Perez wrote:
> Hi all,
>
> I'm wondering if the following behavior is supposed to be normal:
>
> In [99]: cat legpols2.dat
> 1 1. 1. 1. 1.
> -1 -0.49999999999999994 0. 0.49999999999999994 1.
> 1 -0.125 -0.5 -0.125 1.
> -1 0.43749999999999994 0. -0.43749999999999994 1.
> 1 -0.2890625 0.375 -0.2890625 1.
>
> In [100]: scipy.io.read_array("legpols2.dat")
> Out[100]:
> array([[ 1. , 1. , 1. , 1. , 1. ],
> [ 1. , 0.5 , 0. , 0.5 , 1. ],
> [ 1. , 0.125 , 0.5 , 0.125 , 1. ],
> [ 1. , 0.4375 , 0. , 0.4375 , 1. ],
> [ 1. , 0.2890625, 0.375 , 0.2890625, 1. ]])
>
> read_array seems to fit the bill for my simple needs quite nicely, but
> I'd like to be able to use negative numbers as well as positive ones.
> Any hints?
>
> TIA,
>
> f.
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
More information about the SciPy-User
mailing list