Re: [Numpy-discussion] Should bool_ subclass int?

2007-07-09 Thread Matthieu Brucher
Hi, On Mon, 9 Jul 2007, Timothy Hochberg apparently wrote: > > Why not simply use & and | instead of + and *? > > A couple reasons, none determinative. > 1. numpy is right a Python is wrong it this case I don't think I agree with this. Once you've decided to make Boolean a subclass of Int, th

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

2007-07-09 Thread Timothy Hochberg
On 7/9/07, Timothy Hochberg <[EMAIL PROTECTED]> wrote: On 7/9/07, Torgil Svensson <[EMAIL PROTECTED]> wrote: > > Elegant solution. Very readable and takes care of row0 nicely. > > I want to point out that this is much more efficient than my version > for random/late string representation chang

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

2007-07-09 Thread Timothy Hochberg
On 7/9/07, Torgil Svensson <[EMAIL PROTECTED]> wrote: Elegant solution. Very readable and takes care of row0 nicely. I want to point out that this is much more efficient than my version for random/late string representation changes throughout the conversion but it suffers from 2*n memory footpr

Re: [Numpy-discussion] Should bool_ subclass int?

2007-07-09 Thread Timothy Hochberg
On 7/9/07, Alan G Isaac <[EMAIL PROTECTED]> wrote: On Mon, 9 Jul 2007, Timothy Hochberg apparently wrote: > Why not simply use & and | instead of + and *? A couple reasons, none determinative. 1. numpy is right a Python is wrong it this case I don't think I agree with this. Once you've decid

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

2007-07-09 Thread Torgil Svensson
Elegant solution. Very readable and takes care of row0 nicely. I want to point out that this is much more efficient than my version for random/late string representation changes throughout the conversion but it suffers from 2*n memory footprint and large block copying if the string rep changes arr

Re: [Numpy-discussion] Should bool_ subclass int?

2007-07-09 Thread Alan G Isaac
On Mon, 9 Jul 2007, Timothy Hochberg apparently wrote: > Why not simply use & and | instead of + and *? A couple reasons, none determinative. 1. numpy is right a Python is wrong it this case (but granted, I would usually go with Python is such cases) 2. consistency with Boolean matrices

[Numpy-discussion] Conversion float64->int bugged?

2007-07-09 Thread Xavier Saint-Mleux
Hi all, The conversion from a numpy scalar to a python int is not consistent with python's native conversion (or numarray's): if the scalar is out of bounds for an int, python and numarray automatically create a long while numpy still creates an int... with the wrong value. N.B. I am new to n

Re: [Numpy-discussion] scipy.test() warnings, errors and failures

2007-07-09 Thread Jarrod Millman
You can safely ignore the "ScipyTest is now called NumpyTest" warnings. To get rid of the errors you could try installing scipy from svn or user an older version of numpy. Good luck, -- Jarrod Millman Computational Infrastructure for Research Labs 10 Giannini Hall, UC Berkeley phone: 510.643.40

Re: [Numpy-discussion] Array protocol and wxPython

2007-07-09 Thread Christopher Barker
Timothy Hochberg wrote: > This is mainly addressed to Chris Barker since he seems to follow > wxPython pretty closely. I do try to. > Does anyone know if anyone ever tried to get wxPython to use the array > protocol to speed up the internal conversion of arrays? Not that I've heard of. A note

Re: [Numpy-discussion] Buildbot for numpy

2007-07-09 Thread Barry Wark
Albert, Thanks for the info! I will run it by folks here and see what we can fiure out. We're using numpy and scipy very heavily in our internal software, so we have an interest in making sure it works on our platform. Hopefully we (here) can agree on a strategy that will satisfy me and the IT peo

Re: [Numpy-discussion] Should bool_ subclass int?

2007-07-09 Thread Timothy Hochberg
On 7/7/07, Alan G Isaac <[EMAIL PROTECTED]> wrote: On Sat, 7 Jul 2007, Charles R Harris apparently wrote: > In [60]: a > Out[60]: array([ True, True, True, True], dtype=bool) > In [61]: a + a > Out[61]: array([ True, True, True, True], dtype=bool) Yea! Behaves like a boolean array. And fo

Re: [Numpy-discussion] Should bool_ subclass int?

2007-07-09 Thread Timothy Hochberg
On 7/7/07, Travis Oliphant <[EMAIL PROTECTED]> wrote: > > > On 7/6/07, *Travis Oliphant* <[EMAIL PROTECTED] > > wrote: > > Timothy Hochberg wrote: > > > > I'm working on getting some old code working with numpy and I > noticed > > that bool_ is not

[Numpy-discussion] Array protocol and wxPython

2007-07-09 Thread Timothy Hochberg
This is mainly addressed to Chris Barker since he seems to follow wxPython pretty closely. Does anyone know if anyone ever tried to get wxPython to use the array protocol to speed up the internal conversion of arrays? I was toying with the idea of giving it a try if no one's got around to it. --

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

2007-07-09 Thread Vincent Nijs
Cool! Thanks Tim. Vincent On 7/8/07 10:25 PM, "Timothy Hochberg" <[EMAIL PROTECTED]> wrote: > > > 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 d