MySQLdb installation error

2006-08-16 Thread Yi Xing
background * Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] Yi Xing wrote: > Hi, > > I met the following error when I tried to install MySQLdb. I had no > problem installing numarray, Numeric, Rpy, etc. Does anyone know > what's the problem? Thanks!

MySQLdb installation error

2006-08-15 Thread Yi Xing
Hi, I met the following error when I tried to install MySQLdb. I had no problem installing numarray, Numeric, Rpy, etc. Does anyone know what's the problem? Thanks! running install running build running build_py creating build creating build/lib.darwin-7.9.0-Power_Macintosh-2.4 copying _mysql_

Re: Memory problem

2006-08-15 Thread Yi Xing
I used the array module and loaded all the data into an array. Everything works fine now. On Aug 14, 2006, at 4:01 PM, John Machin wrote: > Yi Xing wrote: >> Thanks! I just found that that I have no problem with >> x=[[10.0]*2560*2560]*500, but x=range(1*2560*2560*30) doesn'

Re: Memory problem

2006-08-14 Thread Yi Xing
Is there a way that I can define a two-dimensional array in array.array()? Thanks. On Aug 14, 2006, at 2:28 PM, John Machin wrote: > Yi Xing wrote: >> I tried the following code: >> >>>>> i=0 >>>>> n=2600*2600*30 >>>>> a=array.array

Re: Memory problem

2006-08-14 Thread Yi Xing
Thanks! I just found that that I have no problem with x=[[10.0]*2560*2560]*500, but x=range(1*2560*2560*30) doesn't work. -Yi On Aug 14, 2006, at 3:08 PM, Larry Bates wrote: > Yi Xing wrote: >> On a related question: how do I initialize a list or an array with a >> pre

Re: Memory problem

2006-08-14 Thread Yi Xing
On a related question: how do I initialize a list or an array with a pre-specified number of elements, something like int p[100] in C? I can do append() for 100 times but this looks silly... Thanks. Yi Xing -- http://mail.python.org/mailman/listinfo/python-list

Memory problem

2006-08-14 Thread Yi Xing
I tried the following code: >>> i=0 >>> n=2600*2600*30 >>> a=array.array("f") >>> while (i<=n): .. i=i+1 .. a.append(float(i)) .. Traceback (most recent call last): File "", line 3, in ? MemoryError to see the size of the array at the time of memory error: >>>len(a) 8539248. I use Wind

Memory problem

2006-08-14 Thread Yi Xing
Hi, I need to read a large amount of data into a list. So I am trying to see if I'll have any memory problem. When I do x=range(2700*2700*3) I got the following message: Traceback (most recent call last): File "", line 1, in ? MemoryError Any way to get around this problem? I have a mac

building an index for large text files for fast access

2006-07-24 Thread Yi Xing
Hi, I need to read specific lines of huge text files. Each time, I know exactly which line(s) I want to read. readlines() or readline() in a loop is just too slow. Since different lines have different size, I cannot use seek(). So I am thinking of building an index for the file for fast access

reading specific lines of a file

2006-07-15 Thread Yi Xing
Hi All, I want to read specific lines of a huge txt file (I know the line #). Each line might have different sizes. Is there a convenient and fast way of doing this in Python? Thanks. Yi Xing -- http://mail.python.org/mailman/listinfo/python-list