Re: [Numpy-discussion] Buildbot for numpy

2007-07-08 Thread Albert Strasheim
Hello On Mon, 02 Jul 2007, Barry Wark wrote: > I have the potential to add OS X Server Intel (64-bit) and OS X Intel > (32-bit) to the list, if I can convince my boss that the security risk Sounds good. We could definitely use these platforms. > (including DOS from compile times) is minimal. I'

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Timothy Hochberg
On 7/8/07, Vincent Nijs <[EMAIL PROTECTED]> wrote: Thanks for looking into this Torgil! I agree that this is a much more complicated setup. I'll check if there is anything I can do on the data end. Otherwise I'll go with Timothy's suggestion and read in numbers as floats and convert to int later

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Torgil Svensson
FWIW >>> n,dt=descr[0] >>> new_dt=dt.replace('f','i') >>> descr[0]=(n,new_dt) >>> data=ra.col1.astype(new_dt) >>> ra.dtype=N.dtype(descr) >>> ra.col1=data //Torgil On 7/9/07, Vincent Nijs <[EMAIL PROTECTED]> wrote: > > Tim, > > I do want to auto-detect. Reading numbers in as floats is probably

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Vincent Nijs
Thanks for looking into this Torgil! I agree that this is a much more complicated setup. I'll check if there is anything I can do on the data end. Otherwise I'll go with Timothy's suggestion and read in numbers as floats and convert to int later as needed. Vincent On 7/8/07 5:40 PM, "Torgil Sven

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Vincent Nijs
Tim, I do want to auto-detect. Reading numbers in as floats is probably not a huge penalty. Is there an easy way to change the type of one column in a recarray that you know? I tried this: ra.col1 = ra.col1.astype(Œi¹) but that didn¹t seem to work. I assume that means you would have to create

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Torgil Svensson
Question: If you do ignore the int's initially, once the rec array is in memory, would there be a quick way to check if the floats could pass as int's? This may seem like a backwards approach but it might be 'safer' if you really want to preserve the int's. In your case the floats don't pass as

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Timothy Hochberg
On 7/8/07, Vincent Nijs <[EMAIL PROTECTED]> wrote: Torgil, The function seems to work well and is slightly faster than your previous version (about 1/6th faster). Yes, I do have columns that start with, what looks like, int's and then turn out to be floats. Something like below (col6). da

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Vincent Nijs
Torgil, The function seems to work well and is slightly faster than your previous version (about 1/6th faster). Yes, I do have columns that start with, what looks like, int's and then turn out to be floats. Something like below (col6). data = [['col1', 'col2', 'col3', 'col4', 'col5', 'col6']

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Torgil Svensson
Hi I stumble on these types of problems from time to time so I'm interested in efficient solutions myself. Do you have a column which starts with something suitable for int on the first row (without decimal separator) but has decimals further down? This will be little tricky to support. One solu

Re: [Numpy-discussion] Buildbot for numpy

2007-07-08 Thread Barry Wark
Stefan, No worries. I thought it was something like that. Any thoughts on my other questions? I'd love to have some ammunition to take to my boss. Thanks, Barry On 7/7/07, stefan <[EMAIL PROTECTED]> wrote: > > On Mon, 2 Jul 2007 17:26:15 -0700, "Barry Wark" <[EMAIL PROTECTED]> > wrote: > > On a

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Torgil Svensson
On 7/8/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: On 7/8/07, Torgil Svensson <[EMAIL PROTECTED]> wrote: > Given that both your script and the mlab version preloads the whole > file before calling numpy constructor I'm curious how that compares in > speed to using numpy's fromiter function

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Vincent Nijs
I am not (yet) very familiar with much of the functionality introduced in your script Torgil (izip, imap, etc.), but I really appreciate you taking the time to look at this! The program stopped with the following error: File "load_iter.py", line 48, in convert_row=lambda r: tuple(fn(x) for

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Timothy Hochberg
On 7/8/07, Torgil Svensson <[EMAIL PROTECTED]> wrote: Given that both your script and the mlab version preloads the whole file before calling numpy constructor I'm curious how that compares in speed to using numpy's fromiter function on your data. Using fromiter should improve on memory usage (~

Re: [Numpy-discussion] convert csv file into recarray without pre-specifying dtypes and variable names

2007-07-08 Thread Torgil Svensson
Given that both your script and the mlab version preloads the whole file before calling numpy constructor I'm curious how that compares in speed to using numpy's fromiter function on your data. Using fromiter should improve on memory usage (~50% ?). The drawback is for string columns where we don