Re: [Numpy-discussion] return type from ufuncs

2014-11-27 Thread Marek Wojciechowski
Dnia czwartek, 20 listopada 2014 18:47:41 Marek Wojciechowski pisze: Hi! I wrote a simple subclass of np.ndarray and now i do call np.sum() on it. I expected that the result will be a python float (or int) just like when summing up regular arrays. Instead i obtain the (scalar) view of my

Re: [Numpy-discussion] return type from ufuncs

2014-11-21 Thread Marek Wojciechowski
Dnia piÄ…tek, 21 listopada 2014 00:09:51 Nathaniel Smith pisze: On Thu, Nov 20, 2014 at 5:47 PM, Marek Wojciechowski mw...@p.lodz.pl wrote: Hi! I wrote a simple subclass of np.ndarray and now i do call np.sum() on it. I expected that the result will be a python float (or int) just like

[Numpy-discussion] return type from ufuncs

2014-11-20 Thread Marek Wojciechowski
Hi! I wrote a simple subclass of np.ndarray and now i do call np.sum() on it. I expected that the result will be a python float (or int) just like when summing up regular arrays. Instead i obtain the (scalar) view of my subclass. How can i change this behavior? I tried writing __array_wrap__

Re: [Numpy-discussion] return type from ufuncs

2014-11-20 Thread Nathaniel Smith
On Thu, Nov 20, 2014 at 5:47 PM, Marek Wojciechowski mw...@p.lodz.pl wrote: Hi! I wrote a simple subclass of np.ndarray and now i do call np.sum() on it. I expected that the result will be a python float (or int) just like when summing up regular arrays. Instead i obtain the (scalar) view