Re: [Numpy-discussion] Inconsistency with __index__() for rank-1 arrays?

2010-10-28 Thread Travis Oliphant
The __index__ method returns an integer from an array. The current behavior follows the idea of "return an integer if there is 1-element in the array" Your suggestion is to only return an integer if it is a rank-0 array, otherwise raise an error. This could potentially be changed in Nu

Re: [Numpy-discussion] ndarray __getattr__ to perform __getitem__

2010-10-28 Thread Robert Kern
On Thu, Oct 28, 2010 at 16:37, Ian Stokes-Rees wrote: > > > On 10/28/10 5:29 PM, Robert Kern wrote: >> On Thu, Oct 28, 2010 at 15:17, Ian Stokes-Rees >> wrote: >>> I have an ndarray with named dimensions.  I find myself writing some >>> fairly laborious code with lots of square brackets and quote

Re: [Numpy-discussion] ndarray __getattr__ to perform __getitem__

2010-10-28 Thread Ian Stokes-Rees
On 10/28/10 5:29 PM, Robert Kern wrote: > On Thu, Oct 28, 2010 at 15:17, Ian Stokes-Rees > wrote: >> I have an ndarray with named dimensions. I find myself writing some >> fairly laborious code with lots of square brackets and quotes. It seems >> like it wouldn't be such a big deal to overload

Re: [Numpy-discussion] ndarray __getattr__ to perform __getitem__

2010-10-28 Thread Robert Kern
On Thu, Oct 28, 2010 at 15:17, Ian Stokes-Rees wrote: > I have an ndarray with named dimensions.  I find myself writing some > fairly laborious code with lots of square brackets and quotes.  It seems > like it wouldn't be such a big deal to overload __getattribute__ so > instead of doing: > > r =

Re: [Numpy-discussion] whitespace in git repo

2010-10-28 Thread Christopher Barker
On 10/28/10 1:25 PM, Darren Dale wrote: >>> No, I did not. You are right, this shows \r\n. Why is it necessary to >>> open them as binary? IIUC (OIDUC), one should use 'rU' to unify line >>> endings. > Although, on a mac: > > In [1]: > open('tools/win32build/nsis_scripts/numpy-superinstaller.nsi

[Numpy-discussion] ndarray __getattr__ to perform __getitem__

2010-10-28 Thread Ian Stokes-Rees
I have an ndarray with named dimensions. I find myself writing some fairly laborious code with lots of square brackets and quotes. It seems like it wouldn't be such a big deal to overload __getattribute__ so instead of doing: r = genfromtxt('results.dat',dtype=[('a','int'), ('b', 'f8'), ('c','in

Re: [Numpy-discussion] whitespace in git repo

2010-10-28 Thread Darren Dale
On Thu, Oct 28, 2010 at 3:23 PM, wrote: > On Thu, Oct 28, 2010 at 2:40 PM, Darren Dale wrote: >> On Thu, Oct 28, 2010 at 12:23 PM,   wrote: >>> On Thu, Oct 28, 2010 at 12:11 PM, Charles R Harris On Thu, Oct 28, 2010 at 9:23 AM, Darren Dale wrote: > And now the bad news: I have not been

Re: [Numpy-discussion] problems with numdifftools

2010-10-28 Thread Sebastian Walter
hmm, I have just realized that I forgot to upload the new version to pypi: it is now available on http://pypi.python.org/pypi/algopy On Thu, Oct 28, 2010 at 10:47 AM, Sebastian Walter wrote: > On Wed, Oct 27, 2010 at 10:50 PM, Nicolai Heitz wrote: >> m 27.10.2010 02:02, schrieb Sebastian Walter

Re: [Numpy-discussion] whitespace in git repo

2010-10-28 Thread josef . pktd
On Thu, Oct 28, 2010 at 2:40 PM, Darren Dale wrote: > On Thu, Oct 28, 2010 at 12:23 PM,   wrote: >> On Thu, Oct 28, 2010 at 12:11 PM, Charles R Harris >>> On Thu, Oct 28, 2010 at 9:23 AM, Darren Dale wrote: And now the bad news: I have not been able to verify that Git respects the autoc

Re: [Numpy-discussion] whitespace in git repo

2010-10-28 Thread Darren Dale
On Thu, Oct 28, 2010 at 12:23 PM, wrote: > On Thu, Oct 28, 2010 at 12:11 PM, Charles R Harris >> On Thu, Oct 28, 2010 at 9:23 AM, Darren Dale wrote: >>> And now the bad news: I have not been able to verify that Git respects >>> the autocrlf setting or the eol setting in .gitattributes on my >>>

Re: [Numpy-discussion] quadratic function

2010-10-28 Thread Robert Kern
On Thu, Oct 28, 2010 at 12:47, Brennan Williams wrote: >  On 29/10/2010 6:35 a.m., Robert Kern wrote: >> On Thu, Oct 28, 2010 at 12:33, Brennan Williams >>  wrote: >>>   On 29/10/2010 2:34 a.m., Robert Kern wrote: On Thu, Oct 28, 2010 at 06:38, Brennan Williams    wrote: >    I hav

Re: [Numpy-discussion] quadratic function

2010-10-28 Thread Brennan Williams
On 29/10/2010 6:35 a.m., Robert Kern wrote: > On Thu, Oct 28, 2010 at 12:33, Brennan Williams > wrote: >> On 29/10/2010 2:34 a.m., Robert Kern wrote: >>> On Thu, Oct 28, 2010 at 06:38, Brennan Williams >>> wrote: I have used both linear least squares and radial basis functions as

Re: [Numpy-discussion] quadratic function

2010-10-28 Thread Robert Kern
On Thu, Oct 28, 2010 at 12:33, Brennan Williams wrote: >  On 29/10/2010 2:34 a.m., Robert Kern wrote: >> On Thu, Oct 28, 2010 at 06:38, Brennan Williams >>  wrote: >>>   I have used both linear least squares and radial basis functions as a >>> proxy equation, calculated from the results of comput

Re: [Numpy-discussion] quadratic function

2010-10-28 Thread Brennan Williams
On 29/10/2010 2:34 a.m., Robert Kern wrote: > On Thu, Oct 28, 2010 at 06:38, Brennan Williams > wrote: >> I have used both linear least squares and radial basis functions as a >> proxy equation, calculated from the results of computer simulations >> which are calculating some objective functi

Re: [Numpy-discussion] whitespace in git repo

2010-10-28 Thread josef . pktd
On Thu, Oct 28, 2010 at 12:11 PM, Charles R Harris wrote: > > > On Thu, Oct 28, 2010 at 9:23 AM, Darren Dale wrote: >> >> Hi Chuck, >> >> On Wed, Oct 27, 2010 at 1:30 PM, Charles R Harris >> wrote: >> > >> > I'd like to do something here, but I'm waiting for a consensus and for >> > someone to t

Re: [Numpy-discussion] whitespace in git repo

2010-10-28 Thread Charles R Harris
On Thu, Oct 28, 2010 at 9:23 AM, Darren Dale wrote: > Hi Chuck, > > On Wed, Oct 27, 2010 at 1:30 PM, Charles R Harris > wrote: > > > > I'd like to do something here, but I'm waiting for a consensus and for > > someone to test things out, maybe with a test repo, to make sure things > > operate co

Re: [Numpy-discussion] whitespace in git repo

2010-10-28 Thread Darren Dale
Hi Chuck, On Wed, Oct 27, 2010 at 1:30 PM, Charles R Harris wrote: > > I'd like to do something here, but I'm waiting for a consensus and for > someone to test things out, maybe with a test repo, to make sure things > operate correctly. The documentation isn't that clear... I am getting ready to

Re: [Numpy-discussion] quadratic function

2010-10-28 Thread Robert Kern
On Thu, Oct 28, 2010 at 06:38, Brennan Williams wrote: >  I have used both linear least squares and radial basis functions as a > proxy equation, calculated from the results of computer simulations > which are calculating some objective function value based on a number of > varied input parameters

Re: [Numpy-discussion] Stacking a 2d array onto a 3d array

2010-10-28 Thread Anne Archibald
On 26 October 2010 21:02, Dewald Pieterse wrote: > I see my slicing was the problem, np.vstack((test[:1], test)) works > perfectly. Yes and no. np.newaxis (or "None" for short) is a very useful tool; you just stick it in an index expression and it adds an axis of length one there. If what you rea

[Numpy-discussion] quadratic function

2010-10-28 Thread Brennan Williams
I have used both linear least squares and radial basis functions as a proxy equation, calculated from the results of computer simulations which are calculating some objective function value based on a number of varied input parameters. As an alternative option I want to add a quadratic functi

Re: [Numpy-discussion] problems with numdifftools

2010-10-28 Thread Sebastian Walter
On Wed, Oct 27, 2010 at 10:50 PM, Nicolai Heitz wrote: > m 27.10.2010 02:02, schrieb Sebastian Walter: > >>  On Wed, Oct 27, 2010 at 12:59 AM, Pauli Virtanen   wrote: >>>  Tue, 26 Oct 2010 14:24:39 -0700, Nicolai Heitz wrote: >    http://mail.scipy.org/mailman/listinfo/scipy-user  I conta