large arrays in python (scientific)

Travis Oliphant oliphant at ee.byu.edu
Wed Jan 9 15:30:07 EST 2002


> I'm new to python programming.  I was hoping I could get some feedback
> about some difficulty I'm having
> creating a large array in python.
>
> I have a data set that contains values for positions in 3D space.
> There are about 2 million data points
> (128x128x128).
>
> I'm trying to fit a function to the data. I want to use the
> LeastSquaresFit procedure in ScientificPython,
> which takes an array of elements of the format:
>
> [[(xposition1, yposition1, zposition1), value1],
> [[(xposition2, yposition2, zposition2), value2],
> ...,
> ...,
> ]

Why aren't you using Numeric to store this data?  What function are you
fitting.  I bet you could use the LinearAlebra.linear_least_squares
function to do the job and Numeric arrays.

-Travis






More information about the Python-list mailing list