Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Daniele Nicolodi
On 17/01/2013 23:27, Mark Wiebe wrote: Would it be too weird or clumsy to extend the empty and empty_like functions to do the filling? np.empty((10, 10), fill=np.nan) np.empty_like(my_arr, fill=np.nan) Wouldn't it be more natural to extend the ndarray constructor? np.ndarray((10, 10),

Re: [Numpy-discussion] Casting Bug or a Feature?

2013-01-18 Thread Olivier Delalleau
Le vendredi 18 janvier 2013, Chris Barker - NOAA Federal a écrit : On Thu, Jan 17, 2013 at 5:19 PM, Olivier Delalleau sh...@keba.bejavascript:; wrote: 2013/1/16 josef.p...@gmail.com javascript:;: On Wed, Jan 16, 2013 at 10:43 PM, Patrick Marsh patrickmars...@gmail.com javascript:;

Re: [Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

2013-01-18 Thread Olivier Delalleau
Le vendredi 18 janvier 2013, Chris Barker - NOAA Federal a écrit : On Thu, Jan 17, 2013 at 5:34 PM, Olivier Delalleau sh...@keba.bejavascript:; wrote: Yes, I do understand that. The difference - as I understand it - is that back in the day, numeric did not have the the float32 etc

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Pierre Haessig
Hi, Le 17/01/2013 23:31, Matthew Brett a écrit : Would it be too weird or clumsy to extend the empty and empty_like functions to do the filling? np.empty((10, 10), fill=np.nan) np.empty_like(my_arr, fill=np.nan) That sounds like a good idea to me. Someone wanting a fast way to fill an

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Benjamin Root
On Fri, Jan 18, 2013 at 3:44 AM, Daniele Nicolodi dani...@grinta.netwrote: On 17/01/2013 23:27, Mark Wiebe wrote: Would it be too weird or clumsy to extend the empty and empty_like functions to do the filling? np.empty((10, 10), fill=np.nan) np.empty_like(my_arr, fill=np.nan)

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Daniele Nicolodi
On 18/01/2013 15:19, Benjamin Root wrote: On Fri, Jan 18, 2013 at 3:44 AM, Daniele Nicolodi dani...@grinta.net mailto:dani...@grinta.net wrote: On 17/01/2013 23:27, Mark Wiebe wrote: Would it be too weird or clumsy to extend the empty and empty_like functions to do the

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Benjamin Root
On Fri, Jan 18, 2013 at 11:36 AM, Daniele Nicolodi dani...@grinta.netwrote: On 18/01/2013 15:19, Benjamin Root wrote: On Fri, Jan 18, 2013 at 3:44 AM, Daniele Nicolodi dani...@grinta.net mailto:dani...@grinta.net wrote: On 17/01/2013 23:27, Mark Wiebe wrote: Would it be

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Daniele Nicolodi
On 18/01/2013 17:46, Benjamin Root wrote: On Fri, Jan 18, 2013 at 11:36 AM, Daniele Nicolodi dani...@grinta.net mailto:dani...@grinta.net wrote: On 18/01/2013 15:19, Benjamin Root wrote: On Fri, Jan 18, 2013 at 3:44 AM, Daniele Nicolodi dani...@grinta.net

Re: [Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

2013-01-18 Thread Chris Barker - NOAA Federal
On Fri, Jan 18, 2013 at 4:39 AM, Olivier Delalleau sh...@keba.be wrote: Le vendredi 18 janvier 2013, Chris Barker - NOAA Federal a écrit : If you check again the examples in this thread exhibiting surprising / unexpected behavior, you'll notice most of them are with integers. The tricky thing

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Matthew Brett
Hi, On Fri, Jan 18, 2013 at 1:48 PM, Pierre Haessig pierre.haes...@crans.org wrote: Hi, Le 17/01/2013 23:31, Matthew Brett a écrit : Would it be too weird or clumsy to extend the empty and empty_like functions to do the filling? np.empty((10, 10), fill=np.nan) np.empty_like(my_arr,

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Chris Barker - NOAA Federal
On Fri, Jan 18, 2013 at 2:22 PM, Matthew Brett matthew.br...@gmail.com wrote: I personally find 'fill' OK. I'd read: a = np.empty((10, 10), fill=np.nan) as make an empty array shape (10, 10) and fill with nans +1 simple, does the job, and doesn't bloat the API. -Chris --

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Ralf Gommers
On Fri, Jan 18, 2013 at 11:31 PM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: On Fri, Jan 18, 2013 at 2:22 PM, Matthew Brett matthew.br...@gmail.com wrote: I personally find 'fill' OK. I'd read: a = np.empty((10, 10), fill=np.nan) as make an empty array shape (10,

Re: [Numpy-discussion] Do we want scalar casting to behave as it does at the moment?

2013-01-18 Thread Matthew Brett
Hi, On Fri, Jan 18, 2013 at 7:58 PM, Chris Barker - NOAA Federal chris.bar...@noaa.gov wrote: On Fri, Jan 18, 2013 at 4:39 AM, Olivier Delalleau sh...@keba.be wrote: Le vendredi 18 janvier 2013, Chris Barker - NOAA Federal a écrit : If you check again the examples in this thread exhibiting

Re: [Numpy-discussion] Shouldn't all in-place operations simply return self?

2013-01-18 Thread Ralf Gommers
On Thu, Jan 17, 2013 at 11:13 PM, Thouis (Ray) Jones tho...@gmail.comwrote: On Thu, Jan 17, 2013 at 10:27 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Wed, Jan 16, 2013 at 5:11 PM, eat e.antero.ta...@gmail.com wrote: Hi, In a recent thread

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Fernando Perez
On Fri, Jan 18, 2013 at 2:22 PM, Matthew Brett matthew.br...@gmail.com wrote: I personally find 'fill' OK. I'd read: a = np.empty((10, 10), fill=np.nan) as make an empty array shape (10, 10) and fill with nans Which would indeed be what the code was doing :) So I doubt that the