Re: [Numpy-discussion] numpy 1:1.0.4: numpy.average() returns the wrong result with weights

2008-02-24 Thread Ondrej Certik
On Sun, Feb 24, 2008 at 5:41 AM, Albert Strasheim [EMAIL PROTECTED] wrote:
 Hello,

  - Original Message -
  From: Robert Kern [EMAIL PROTECTED]
  To: Discussion of Numerical Python numpy-discussion@scipy.org
  Sent: Saturday, February 23, 2008 3:30 AM
  Subject: Re: [Numpy-discussion] numpy 1:1.0.4: numpy.average() returns the
  wrong result with weights



   Ondrej Certik wrote:
   I'll add it. I registered on the trac, as required, but I am still
   denied, when filling my username and password when logging in.
   How can I create an account?
  
   That should have done it. When you say you are denied, exactly what
   happens?
   I've run into times when I've logged in and I get the unaltered front page
   again. Logging in again usually works.

  There is something strange going on. Logging in on
  projects.scipy.org/scipy/numpy usually redirects you to
  scipy.org/scipy/numpy, at which point you need to log in again.


I tried it several times now - register - login - it doesn't accept
the password. Then
it redirects to scipy.org/scipy/numpy as you said. Then I went back to
the original page
and then the login worked. (But I did the same trick before and it didn't work).

Anyway, it seems to be working now, thanks for the help.

Ondrej
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy 1:1.0.4: numpy.average() returns the wrong result with weights

2008-02-23 Thread Albert Strasheim
Hello,

- Original Message - 
From: Robert Kern [EMAIL PROTECTED]
To: Discussion of Numerical Python numpy-discussion@scipy.org
Sent: Saturday, February 23, 2008 3:30 AM
Subject: Re: [Numpy-discussion] numpy 1:1.0.4: numpy.average() returns the 
wrong result with weights


 Ondrej Certik wrote:
 I'll add it. I registered on the trac, as required, but I am still
 denied, when filling my username and password when logging in.
 How can I create an account?

 That should have done it. When you say you are denied, exactly what 
 happens?
 I've run into times when I've logged in and I get the unaltered front page
 again. Logging in again usually works.

There is something strange going on. Logging in on 
projects.scipy.org/scipy/numpy usually redirects you to 
scipy.org/scipy/numpy, at which point you need to log in again.

Cheers,

Albert 

___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] numpy 1:1.0.4: numpy.average() returns the wrong result with weights

2008-02-22 Thread Ondrej Certik
Hi,

more details in this bug report.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467095

The bug report offers a fix for this problem. It seems to me this is
not fixed even in the latest svn.

Thanks,
Ondrej
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy 1:1.0.4: numpy.average() returns the wrong result with weights

2008-02-22 Thread Travis E. Oliphant
Ondrej Certik wrote:
 Hi,

 more details in this bug report.

 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467095

 The bug report offers a fix for this problem. It seems to me this is
 not fixed even in the latest svn.

   
Is there a ticket on the NumPy trac for this?  We won't see it if there 
isn't.  Thanks for pointing us to the bug.

-Travis


___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy 1:1.0.4: numpy.average() returns the wrong result with weights

2008-02-22 Thread Ondrej Certik
On Sat, Feb 23, 2008 at 2:10 AM, Travis E. Oliphant
[EMAIL PROTECTED] wrote:

 Ondrej Certik wrote:
   Hi,
  
   more details in this bug report.
  
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467095
  
   The bug report offers a fix for this problem. It seems to me this is
   not fixed even in the latest svn.
  
  
  Is there a ticket on the NumPy trac for this?  We won't see it if there
  isn't.  Thanks for pointing us to the bug.

I'll add it. I registered on the trac, as required, but I am still
denied, when filling my username and password when logging in.
How can I create an account?

Ondrej
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy 1:1.0.4: numpy.average() returns the wrong result with weights

2008-02-22 Thread Robert Kern
Ondrej Certik wrote:
 On Sat, Feb 23, 2008 at 2:10 AM, Travis E. Oliphant
 [EMAIL PROTECTED] wrote:
 Ondrej Certik wrote:
   Hi,
  
   more details in this bug report.
  
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=467095
  
   The bug report offers a fix for this problem. It seems to me this is
   not fixed even in the latest svn.
  
  
  Is there a ticket on the NumPy trac for this?  We won't see it if there
  isn't.  Thanks for pointing us to the bug.
 
 I'll add it. I registered on the trac, as required, but I am still
 denied, when filling my username and password when logging in.
 How can I create an account?

That should have done it. When you say you are denied, exactly what happens? 
I've run into times when I've logged in and I get the unaltered front page 
again. Logging in again usually works.

-- 
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth.
   -- Umberto Eco
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy 1:1.0.4: numpy.average() returns the wrong result with weights

2008-02-22 Thread Anne Archibald
On 22/02/2008, Travis E. Oliphant [EMAIL PROTECTED] wrote:

 Is there a ticket on the NumPy trac for this?  We won't see it if there
  isn't.  Thanks for pointing us to the bug.

It appears to be fixed in SVN (that was quick!). But the Debian bug
report also points out a peculiar unnecessary use of eval; the code is
also slower and uses more memory than it has to. Attached is a patch
to cure that.

Anne
Index: numpy/lib/function_base.py
===
--- numpy/lib/function_base.py	(revision 4819)
+++ numpy/lib/function_base.py	(working copy)
@@ -378,9 +378,9 @@
 ni = len(ash)
 r = [newaxis]*ni
 r[axis] = slice(None, None, 1)
-w1 = eval(w[+repr(tuple(r))+]*ones(ash, float))
-n = add.reduce(a*w1, axis)
-d = add.reduce(w1, axis)
+r = tuple(r)
+n = add.reduce(a*w[r], axis)
+d = add.reduce(w, axis)
 else:
 raise ValueError, 'averaging weights have wrong shape'
 
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion