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

2012-11-28 Thread Francesc Alted
On 11/23/12 8:00 PM, Chris Barker - NOAA Federal wrote: On Thu, Nov 22, 2012 at 6:20 AM, Francesc Alted franc...@continuum.io wrote: As Nathaniel said, there is not a difference in terms of *what* is computed. However, the methods that you suggested actually differ on *how* they are computed,

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

2012-11-23 Thread Chris Barker - NOAA Federal
On Thu, Nov 22, 2012 at 6:20 AM, Francesc Alted franc...@continuum.io wrote: As Nathaniel said, there is not a difference in terms of *what* is computed. However, the methods that you suggested actually differ on *how* they are computed, and that has dramatic effects on the time used. For

[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 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