Simon Forman sajmikins at gmail.com
Thu Oct 1 20:34:22 CEST 2009

On Thu, Oct 1, 2009 at 7:55 AM, padmapriya sekaran <ppriyajs at gmail.com> wrote:
> I have a problem in using interp from numpy for which i need 3 array.
> my first array is
> x = scipy.linspace(0.009,0.53,100)
> and the other two array should be read from my file with 100x2 dimension
> (file1_lines) but it is read as string instead of two columns
> for line in file1_lines:
>         line = line.split()
>         xp = line[0]
>         yp = line[1]
>         y = scipy.interp(x,xp,yp)
> if i code like this it takes only one value for xp and yp but 100 values for
> x. i dont know what to do please help.

It is difficult to say without a sample of the file data.  If you
would please provide some?

Also, once you are sure the lines are being split correctly, you can just say:
xp, yp = line.split()

More information about the Python-list mailing list