"MemoryError" using matplotlib

Hello all,

I am new to using Matplotlib and have
run into the following error:

Traceback (most recent call last):

File “<pyshell#0>”,
line 1, in -toplevel-

plotfile = load('F:/water_budget_analysis/pilotwi_out.txt',

delimiter=’,’)

File “F:\Python24\Lib\site-packages\matplotlib\pylab.py”,
line 999, in load

row = [float(val) for

val in line.split(delimiter)]

MemoryError

Let me explain what I have been attempting
to do. I am trying to generate a histogram of a large amount of data
that has been mined from ArcMap. Here’s the scary part. The
size of the data file is approximately 190 MB with about 24 million data
values. Have I reached a limit here? Any suggestions?

thanks

Kenneth

Kenneth R. Odom, PhD, PE

Surface Water Specialist

USGS Kentucky Water Science Center

9818 Bluegrass Parkway

Louisville, KY 40299-1906

Ph 502.493.1933

Fax 502.493.1909

email: krodom@…924…

That definitely getting into limited memory land. What might
help are the new python2.4 generators for list comprehensions. They
were added for things like this. Simply replace [float(val) for val
in line.split(delimiter)] with (float(val) for val in
line.split(delimiter)). This won't cause a memory error since it is
not evaluated until you iterate it. You might have another mem error
later depending on your usage.

- Charlie

···

On 12/12/05, Kenneth R Odom <krodom@...924...> wrote:

Hello all,

I am new to using Matplotlib and have run into the following error:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in -toplevel-
    plotfile =
load('F:/water_budget_analysis/pilotwi_out.txt',
delimiter=',')
  File "F:\Python24\Lib\site-packages\matplotlib\pylab.py",
line 999, in load
    row = [float(val) for val in line.split(delimiter)]
MemoryError

Let me explain what I have been attempting to do. I am trying to generate a
histogram of a large amount of data that has been mined from ArcMap. Here's
the scary part. The size of the data file is approximately 190 MB with
about 24 million data values. Have I reached a limit here? Any
suggestions?

thanks
Kenneth

Kenneth R. Odom, PhD, PE
Surface Water Specialist
USGS Kentucky Water Science Center
9818 Bluegrass Parkway
Louisville, KY 40299-1906

Ph 502.493.1933
Fax 502.493.1909
email: krodom@...924...