[Numpy-discussion] numpy on windows 64 bit

2010-07-05 Thread Robin
Hi,

I am having some problems with win64 with all my tests failing.

I installed amd64 Python from Python.org and numpy and scipy from
http://www.lfd.uci.edu/~gohlke/pythonlibs/

I noticed that on windows sys.maxint is the 32bit value (2147483647
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy on windows 64 bit

2010-07-05 Thread David Cournapeau
Hi Robin,

On Mon, Jul 5, 2010 at 5:24 PM, Robin robi...@gmail.com wrote:
 Hi,

 I am having some problems with win64 with all my tests failing.

Short of saying what those failures are, we can't help you,


 I installed amd64 Python from Python.org and numpy and scipy from
 http://www.lfd.uci.edu/~gohlke/pythonlibs/

 I noticed that on windows sys.maxint is the 32bit value (2147483647

This is not surprising: sys.maxint gives you the max value of a long,
which is 32 bits even on 64 bits on windows.

David
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy on windows 64 bit

2010-07-05 Thread Robin
On Mon, Jul 5, 2010 at 12:09 PM, David Cournapeau courn...@gmail.com wrote:

 Short of saying what those failures are, we can't help you,

Thanks for reply... Somehow my message got truncated - I had written
more detail about the errors!

 I noticed that on windows sys.maxint is the 32bit value (2147483647

 This is not surprising: sys.maxint gives you the max value of a long,
 which is 32 bits even on 64 bits on windows.

I just got to figuring this out... But it makes some problems. The
main one I'm having is that I assume because of this problem array
shapes are longs instead of ints (ie x.shape[0] is a long).

This breaks np.random.permutation(x.shape[1]) which I use all over the
place (I opened a ticket for this, #1535). Something I asked in the
previous mail that got lost is what is the best cross platform way of
doing this?
np.random.permutation(int(x.shape[1]))?

Actually that and the problems with scipy.sparse (spsolve doesn't
work) cover all of the errors I'm seeing... (I detailed those in a
seperate mail to the scipy list).

Cheers

Robin
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] debian benchmarks

2010-07-05 Thread Isaac Gouy
Sturla Molden sturla at molden.no writes:

   
 It is also the kind of tasks where NumPy would help. It would be nice to 
 get NumPy into the shootout. At least for the sake of advertising 



http://shootout.alioth.debian.org/u32/program.php?test=spectralnormlang=pythonid=2

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] subtle behavior when subtracting sub-arrays

2010-07-05 Thread Steve Schmerler
Hi

I stumbled upon some numpy behavior which I was not aware of.

Say I have an array of shape (2,2,3) and want to subtract the sub-array
a[...,0] of shape (2,2) from each a[...,i], i=0,1,2 .

## ok ##

In [1]: a=arange(2*2*3).reshape(2,2,3)

# Copy the array to be subtracted.
In [2]: a0=a[...,0].copy()

# Trivial approach. That works.
In [3]: for k in range(a.shape[-1]):
   ...: a[...,k] -= a0
   ...: 
   ...: 

# OK
In [4]: a
Out[4]: 
array([[[0, 1, 2],
[0, 1, 2]],

   [[0, 1, 2],
[0, 1, 2]]])

In [5]: a=arange(2*2*3).reshape(2,2,3)

# The same, with broadcasting.
In [6]: a=a-a[...,0][...,None]

# OK
In [7]: a
Out[7]: 
array([[[0, 1, 2],
[0, 1, 2]],

   [[0, 1, 2],
[0, 1, 2]]])

## not ok ##

In [8]: a=arange(2*2*3).reshape(2,2,3)

In [9]: a-=a[...,0][...,None]

# NOT OK
In [10]: a
Out[10]: 
array([[[ 0,  1,  2],
[ 0,  4,  5]],

   [[ 0,  7,  8],
[ 0, 10, 11]]])

In [11]: a=arange(2*2*3).reshape(2,2,3)

# NOT OK, same as above
In [12]: for k in range(a.shape[-1]):
...: a[...,k] -= a[...,0]
...: 
...: 

In [14]: a
Out[14]: 
array([[[ 0,  1,  2],
[ 0,  4,  5]],

   [[ 0,  7,  8],
[ 0, 10, 11]]])

To sum up, I find it a bit subtle that
a = a - a[...,0][...,None]
works as expected, while
a -= a[...,0][...,None]
does not.
I guess the reason is that in the latter case (and the corresponding
loop), a[...,0] itself is changed during the loop, while in the former
case, numpy makes a copy of a[...,0] ?

Is this intended? This is with numpy 1.3.0.

best,
Steve
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] subtle behavior when subtracting sub-arrays

2010-07-05 Thread Pauli Virtanen
Mon, 05 Jul 2010 16:03:56 +0200, Steve Schmerler wrote:
[clip]
 To sum up, I find it a bit subtle that
 a = a - a[...,0][...,None]
 works as expected, while
 a -= a[...,0][...,None]
 does not.
 I guess the reason is that in the latter case (and the corresponding
 loop), a[...,0] itself is changed during the loop, while in the former
 case, numpy makes a copy of a[...,0] ?

Correct.

 Is this intended?

Not really. It's a feature we're planning to get rid of eventually, 
once a way to do it without sacrificing performance in safe cases is 
implemented.

-- 
Pauli Virtanen

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] ANN: scipy 0.8.0 release candidate 1

2010-07-05 Thread Alan G Isaac
On 7/5/2010 11:13 AM, Ralf Gommers wrote:
 The failure is yet another case of test precision set slightly too high.
 Thought we had got them all... Not sure about the matlab thing. Which
 version of Windows are you running?

Vista 64bit (with 32 bit Python 2.6).

Alan

___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] BOF notes: Fernando's proposal: NumPy ndarray with named axes

2010-07-05 Thread Jonathan March
Fernando Perez proposed a NumPy enhancement, an ndarray with named axes,
prototyped as DataArray by him, Mike Trumpis, Jonathan Taylor, Matthew
Brett, Kilian Koepsell and Stefan van der Walt.

At SciPy 2010 on July 1, Fernando convened a BOF (Birds of a Feather)
discussion of this proposal.

The notes from this BOF can be found at:
http://projects.scipy.org/numpy/wiki/NdarrayWithNamedAxes
(linked from the Plans section of http://projects.scipy.org/numpy )

HELP NEEDED: Fernando does not have the resources to drive the project
beyond this prototype, which already does what he needs. If this is to go
anywhere, it needs people to do the work. Please step forward.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion