[Numpy-discussion] When are 0-d arrays writeable?

2012-11-22 Thread Charles R Harris
Examples, In [13]: ones(()).flags.writeable Out[13]: True In [14]: (-ones(())).flags.writeable Out[14]: False In [15]: (-1*ones(())).flags.writeable Out[15]: False In [16]: (1 + ones(())).flags.writeable Out[16]: False In [17]: array(1) Out[17]: array(1) In [18]: array(1).shape Out[18]: () I

Re: [Numpy-discussion] Is apply_over_axes working for np.ma function?

2012-11-22 Thread Chao YUE
I am using version 1.6.2 In [77]: np.__version__ Out[77]: '1.6.2' On Thu, Nov 22, 2012 at 10:08 PM, Chao YUE wrote: > Dear all, > > I tried the np.apply_over_axes and np.ma.apply_over_axes, it seems that > they are not working for the masked array? > I searched the wiki and there are two ticke

[Numpy-discussion] Is apply_over_axes working for np.ma function?

2012-11-22 Thread Chao YUE
Dear all, I tried the np.apply_over_axes and np.ma.apply_over_axes, it seems that they are not working for the masked array? I searched the wiki and there are two tickets (1480,8417) related with this, it seems that it's a solved issue? the example is below: In [67]: a = np.arange(60.).reshape(3

Re: [Numpy-discussion] the difference between "+" and np.add?

2012-11-22 Thread Chao YUE
Thanks for the explanations. Yes, what I am thinking is basically the same but I didn't test the time. I never try numexpr, but it would be nice to try it. Chao On Thu, Nov 22, 2012 at 3:20 PM, Francesc Alted wrote: > On 11/22/12 1:41 PM, Chao YUE wrote: > > Dear all, > > > > if I have two ndar

Re: [Numpy-discussion] the mean, var, std of empty arrays

2012-11-22 Thread josef . pktd
On Thu, Nov 22, 2012 at 10:15 AM, Sebastian Berg wrote: > On Thu, 2012-11-22 at 16:05 +0100, Daπid wrote: >> On Thu, Nov 22, 2012 at 3:54 PM, wrote: >> > Why don't operations on empty arrays not return empty arrays? >> >> Because functions like mean or std are expected to return a scalar. >> Fun

Re: [Numpy-discussion] the mean, var, std of empty arrays

2012-11-22 Thread Sebastian Berg
On Thu, 2012-11-22 at 16:05 +0100, Daπid wrote: > On Thu, Nov 22, 2012 at 3:54 PM, wrote: > > Why don't operations on empty arrays not return empty arrays? > > Because functions like mean or std are expected to return a scalar. > Functions that are piecewiese can (and should) return an empty arr

Re: [Numpy-discussion] the mean, var, std of empty arrays

2012-11-22 Thread Daπid
On Thu, Nov 22, 2012 at 3:54 PM, wrote: > Why don't operations on empty arrays not return empty arrays? Because functions like mean or std are expected to return a scalar. Functions that are piecewiese can (and should) return an empty array, but not the mean.

Re: [Numpy-discussion] the mean, var, std of empty arrays

2012-11-22 Thread josef . pktd
On Thu, Nov 22, 2012 at 7:14 AM, Sebastian Berg wrote: > On Wed, 2012-11-21 at 22:58 -0500, josef.p...@gmail.com wrote: >> On Wed, Nov 21, 2012 at 10:35 PM, Charles R Harris >> wrote: >> > >> > >> > On Wed, Nov 21, 2012 at 7:45 PM, wrote: >> >> >> >> On Wed, Nov 21, 2012 at 9:22 PM, Olivier Dela

Re: [Numpy-discussion] the difference between "+" and np.add?

2012-11-22 Thread Francesc Alted
On 11/22/12 1:41 PM, Chao YUE wrote: > Dear all, > > if I have two ndarray arr1 and arr2 (with the same shape), is there > some difference when I do: > > arr = arr1 + arr2 > > and > > arr = np.add(arr1, arr2), > > and then if I have more than 2 arrays: arr1, arr2, arr3, arr4, arr5, > then I canno

Re: [Numpy-discussion] the difference between "+" and np.add?

2012-11-22 Thread Nathaniel Smith
On Thu, Nov 22, 2012 at 12:41 PM, Chao YUE wrote: > Dear all, > > if I have two ndarray arr1 and arr2 (with the same shape), is there some > difference when I do: > > arr = arr1 + arr2 > > and > > arr = np.add(arr1, arr2), > > and then if I have more than 2 arrays: arr1, arr2, arr3, arr4, arr5, th

[Numpy-discussion] the difference between "+" and np.add?

2012-11-22 Thread Chao YUE
Dear all, if I have two ndarray arr1 and arr2 (with the same shape), is there some difference when I do: arr = arr1 + arr2 and arr = np.add(arr1, arr2), and then if I have more than 2 arrays: arr1, arr2, arr3, arr4, arr5, then I cannot use np.add anymore as it only recieves 2 arguments. then w

Re: [Numpy-discussion] the mean, var, std of empty arrays

2012-11-22 Thread Sebastian Berg
On Wed, 2012-11-21 at 22:58 -0500, josef.p...@gmail.com wrote: > On Wed, Nov 21, 2012 at 10:35 PM, Charles R Harris > wrote: > > > > > > On Wed, Nov 21, 2012 at 7:45 PM, wrote: > >> > >> On Wed, Nov 21, 2012 at 9:22 PM, Olivier Delalleau wrote: > >> > Current behavior looks sensible to me. I per

Re: [Numpy-discussion] In case anybody wants them: py4science.* domains...

2012-11-22 Thread Peter Cock
On Thu, Nov 22, 2012 at 4:17 AM, Fernando Perez wrote: > Hi folks, > > years ago, John Hunter and I bought the py4science.{com, org, info} > domains thinking they might be useful. We never did anything with > them, and with his passing I realized I'm not really in the mood to > keep renewing them