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 fperez@gmail.com 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

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 charlesr.har...@gmail.com wrote: On Wed, Nov 21, 2012 at 7:45 PM, josef.p...@gmail.com wrote: On Wed, Nov 21, 2012 at 9:22 PM, Olivier Delalleau sh...@keba.be wrote:

[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

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 chaoyue...@gmail.com 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,

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 cannot use np.add

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 sebast...@sipsolutions.net 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 charlesr.har...@gmail.com wrote: On Wed, Nov 21, 2012 at 7:45 PM, josef.p...@gmail.com wrote:

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, josef.p...@gmail.com 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 Sebastian Berg
On Thu, 2012-11-22 at 16:05 +0100, Daπid wrote: On Thu, Nov 22, 2012 at 3:54 PM, josef.p...@gmail.com 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)

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 sebast...@sipsolutions.net wrote: On Thu, 2012-11-22 at 16:05 +0100, Daπid wrote: On Thu, Nov 22, 2012 at 3:54 PM, josef.p...@gmail.com wrote: Why don't operations on empty arrays not return empty arrays? Because functions like mean or std

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 franc...@continuum.iowrote: On 11/22/12 1:41 PM, Chao YUE wrote: Dear all, if

[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]: ()