Le 18/01/2013 23:22, Matthew Brett a écrit :
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
(and now we have *two* verbs ! )
--
Pierre
signature.asc
Description: OpenPGP digital signature
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),
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
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)
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
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
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
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,
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
--
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,
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
Hi,
Le 14/01/2013 20:17, Alan G Isaac a écrit :
a = np.tile(5,(1,2,3))
a
array([[[5, 5, 5],
[5, 5, 5]]])
np.tile(1,a.shape)
array([[[1, 1, 1],
[1, 1, 1]]])
I had not realized a scalar first argument was possible.
I didn't know either ! I discovered this use in the
Hi,
Le 14/01/2013 20:05, Benjamin Root a écrit :
I do like the way you are thinking in terms of the broadcasting
semantics, but I wonder if that is a bit awkward. What I mean is, if
one were to use broadcasting semantics for creating an array, wouldn't
one have just simply used broadcasting
On 2013/01/17 4:13 AM, Pierre Haessig wrote:
Hi,
Le 14/01/2013 20:05, Benjamin Root a écrit :
I do like the way you are thinking in terms of the broadcasting
semantics, but I wonder if that is a bit awkward. What I mean is, if
one were to use broadcasting semantics for creating an array,
On Thu, Jan 17, 2013 at 5:04 PM, Eric Firing efir...@hawaii.edu wrote:
On 2013/01/17 4:13 AM, Pierre Haessig wrote:
Hi,
Le 14/01/2013 20:05, Benjamin Root a écrit :
I do like the way you are thinking in terms of the broadcasting
semantics, but I wonder if that is a bit awkward. What I
Hi,
On Thu, Jan 17, 2013 at 10:10 PM, Benjamin Root ben.r...@ou.edu wrote:
On Thu, Jan 17, 2013 at 5:04 PM, Eric Firing efir...@hawaii.edu wrote:
On 2013/01/17 4:13 AM, Pierre Haessig wrote:
Hi,
Le 14/01/2013 20:05, Benjamin Root a écrit :
I do like the way you are thinking in terms
On Thu, Jan 17, 2013 at 2:10 PM, Benjamin Root ben.r...@ou.edu wrote:
On Thu, Jan 17, 2013 at 5:04 PM, Eric Firing efir...@hawaii.edu wrote:
On 2013/01/17 4:13 AM, Pierre Haessig wrote:
Hi,
Le 14/01/2013 20:05, Benjamin Root a écrit :
I do like the way you are thinking in terms of
Hi,
On Thu, Jan 17, 2013 at 10:27 PM, Mark Wiebe mwwi...@gmail.com wrote:
On Thu, Jan 17, 2013 at 2:10 PM, Benjamin Root ben.r...@ou.edu wrote:
On Thu, Jan 17, 2013 at 5:04 PM, Eric Firing efir...@hawaii.edu wrote:
On 2013/01/17 4:13 AM, Pierre Haessig wrote:
Hi,
Le 14/01/2013
2013/1/17 Matthew Brett matthew.br...@gmail.com:
Hi,
On Thu, Jan 17, 2013 at 10:27 PM, Mark Wiebe mwwi...@gmail.com wrote:
On Thu, Jan 17, 2013 at 2:10 PM, Benjamin Root ben.r...@ou.edu wrote:
On Thu, Jan 17, 2013 at 5:04 PM, Eric Firing efir...@hawaii.edu wrote:
On 2013/01/17 4:13 AM,
On Jan 17, 2013 8:01 PM, Olivier Delalleau sh...@keba.be wrote:
2013/1/17 Matthew Brett matthew.br...@gmail.com:
Hi,
On Thu, Jan 17, 2013 at 10:27 PM, Mark Wiebe mwwi...@gmail.com wrote:
On Thu, Jan 17, 2013 at 2:10 PM, Benjamin Root ben.r...@ou.edu wrote:
On Thu, Jan 17, 2013
Robert Kern robert.kern at gmail.com writes:
One alternative that does not expand the API with two-liners is to let
the ndarray.fill() method return self:
a = np.empty(...).fill(20.0)
This violates the convention that in-place operations never return
self, to avoid
Hi,
Le 14/01/2013 00:39, Nathaniel Smith a écrit :
(The nice thing about np.filled() is that it makes np.zeros() and
np.ones() feel like clutter, rather than the reverse... not that I'm
suggesting ever getting rid of them, but it makes the API conceptually
feel smaller, not larger.)
Coming
On Mon, Jan 14, 2013 at 7:38 AM, Pierre Haessig pierre.haes...@crans.orgwrote:
Hi,
Le 14/01/2013 00:39, Nathaniel Smith a écrit :
(The nice thing about np.filled() is that it makes np.zeros() and
np.ones() feel like clutter, rather than the reverse... not that I'm
suggesting ever getting
Why not optimize NumPy to detect a mul of an ndarray by a scalar to
call fill? That way, np.empty * 2 will be as fast as x=np.empty;
x.fill(2)?
Fred
On Mon, Jan 14, 2013 at 9:57 AM, Benjamin Root ben.r...@ou.edu wrote:
On Mon, Jan 14, 2013 at 7:38 AM, Pierre Haessig pierre.haes...@crans.org
On Mon, Jan 14, 2013 at 2:57 PM, Benjamin Root ben.r...@ou.edu wrote:
I am also +1 on the idea of having a filled() and filled_like() function (I
learned a long time ago to just do a = np.empty() and a.fill() rather than
the multiplication trick I learned from Matlab). However, the collision
On Mon, Jan 14, 2013 at 4:12 PM, Frédéric Bastien no...@nouiz.org wrote:
Why not optimize NumPy to detect a mul of an ndarray by a scalar to
call fill? That way, np.empty * 2 will be as fast as x=np.empty;
x.fill(2)?
In general, each element of an array will be different, so the result
of the
Hi,
On Mon, Jan 14, 2013 at 9:02 AM, Dave Hirschfeld
dave.hirschf...@gmail.com wrote:
Robert Kern robert.kern at gmail.com writes:
One alternative that does not expand the API with two-liners is to let
the ndarray.fill() method return self:
a = np.empty(...).fill(20.0)
2013/1/14 Matthew Brett matthew.br...@gmail.com:
Hi,
On Mon, Jan 14, 2013 at 9:02 AM, Dave Hirschfeld
dave.hirschf...@gmail.com wrote:
Robert Kern robert.kern at gmail.com writes:
One alternative that does not expand the API with two-liners is to let
the ndarray.fill() method
On Mon, Jan 14, 2013 at 11:15 AM, Olivier Delalleau sh...@keba.be wrote:
2013/1/14 Matthew Brett matthew.br...@gmail.com:
Hi,
On Mon, Jan 14, 2013 at 9:02 AM, Dave Hirschfeld
dave.hirschf...@gmail.com wrote:
Robert Kern robert.kern at gmail.com writes:
One alternative that does not
On Mon, Jan 14, 2013 at 11:22 AM, josef.p...@gmail.com wrote:
On Mon, Jan 14, 2013 at 11:15 AM, Olivier Delalleau sh...@keba.be wrote:
2013/1/14 Matthew Brett matthew.br...@gmail.com:
Hi,
On Mon, Jan 14, 2013 at 9:02 AM, Dave Hirschfeld
dave.hirschf...@gmail.com wrote:
Robert Kern
On 2013/01/14 6:15 AM, Olivier Delalleau wrote:
- I agree the name collision with np.ma.filled is a problem. I have no
better suggestion though at this point.
How about initialized()?
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
On Mon, Jan 14, 2013 at 12:27 PM, Eric Firing efir...@hawaii.edu wrote:
On 2013/01/14 6:15 AM, Olivier Delalleau wrote:
- I agree the name collision with np.ma.filled is a problem. I have no
better suggestion though at this point.
How about initialized()?
A verb! +1 from me!
For those
On Sun, Jan 13, 2013 at 4:24 PM, Robert Kern robert.k...@gmail.com wrote:
On Sun, Jan 13, 2013 at 6:27 PM, Nathaniel Smith n...@pobox.com wrote:
Hi all,
PR 2875 adds two new functions, that generalize zeros(), ones(),
zeros_like(), ones_like(), by simply taking an arbitrary fill value:
Le 14/01/2013 18:33, Benjamin Root a écrit :
How about initialized()?
A verb! +1 from me!
Shouldn't it be initialize() then ? I'm not so fond of it though,
because initialize is pretty broad in the field of programming.
What about refurbishing the already existing tile() function ? As
On Mon, Jan 14, 2013 at 9:57 AM, Benjamin Root ben.r...@ou.edu wrote:
On Mon, Jan 14, 2013 at 7:38 AM, Pierre Haessig pierre.haes...@crans.org
wrote:
Hi,
Le 14/01/2013 00:39, Nathaniel Smith a écrit :
(The nice thing about np.filled() is that it makes np.zeros() and
np.ones() feel like
On Mon, Jan 14, 2013 at 1:12 PM, Pierre Haessig
pierre.haes...@crans.org wrote:
In [8]: tile(nan, (3,3)) # (it's a verb ! )
tile, in my opinion, is useful in some cases (for people who think in
terms of repmat()) but not very NumPy-ish. What I'd like is a function
that takes
- an initial
On Mon, Jan 14, 2013 at 1:56 PM, David Warde-Farley
d.warde.far...@gmail.com wrote:
On Mon, Jan 14, 2013 at 1:12 PM, Pierre Haessig
pierre.haes...@crans.org wrote:
In [8]: tile(nan, (3,3)) # (it's a verb ! )
tile, in my opinion, is useful in some cases (for people who think in
terms of
Thanks Pierre for noting that np.tile already
provides a chunk of this functionality:
a = np.tile(5,(1,2,3))
a
array([[[5, 5, 5],
[5, 5, 5]]])
np.tile(1,a.shape)
array([[[1, 1, 1],
[1, 1, 1]]])
I had not realized a scalar first argument was possible.
Alan Isaac
On Sun, Jan 13, 2013 at 12:27 PM, Nathaniel Smith n...@pobox.com wrote:
Hi all,
PR 2875 adds two new functions, that generalize zeros(), ones(),
zeros_like(), ones_like(), by simply taking an arbitrary fill value:
https://github.com/numpy/numpy/pull/2875
So
np.ones((10, 10))
is the
Hi,
On Sun, Jan 13, 2013 at 5:27 PM, Nathaniel Smith n...@pobox.com wrote:
Hi all,
PR 2875 adds two new functions, that generalize zeros(), ones(),
zeros_like(), ones_like(), by simply taking an arbitrary fill value:
https://github.com/numpy/numpy/pull/2875
So
np.ones((10, 10))
is the
On 2013/01/13 7:27 AM, Nathaniel Smith wrote:
Hi all,
PR 2875 adds two new functions, that generalize zeros(), ones(),
zeros_like(), ones_like(), by simply taking an arbitrary fill value:
https://github.com/numpy/numpy/pull/2875
So
np.ones((10, 10))
is the same as
np.filled((10,
On Sun, Jan 13, 2013 at 6:27 PM, Nathaniel Smith n...@pobox.com wrote:
Hi all,
PR 2875 adds two new functions, that generalize zeros(), ones(),
zeros_like(), ones_like(), by simply taking an arbitrary fill value:
https://github.com/numpy/numpy/pull/2875
So
np.ones((10, 10))
is the same
On Sun, Jan 13, 2013 at 11:24 PM, Robert Kern robert.k...@gmail.com wrote:
On Sun, Jan 13, 2013 at 6:27 PM, Nathaniel Smith n...@pobox.com wrote:
Hi all,
PR 2875 adds two new functions, that generalize zeros(), ones(),
zeros_like(), ones_like(), by simply taking an arbitrary fill value:
On Sun, Jan 13, 2013 at 11:24 PM, Robert Kern robert.k...@gmail.com wrote:
On Sun, Jan 13, 2013 at 6:27 PM, Nathaniel Smith n...@pobox.com wrote:
Hi all,
PR 2875 adds two new functions, that generalize zeros(), ones(),
zeros_like(), ones_like(), by simply taking an arbitrary fill value:
On Sun, Jan 13, 2013 at 6:39 PM, Nathaniel Smith n...@pobox.com wrote:
On Sun, Jan 13, 2013 at 11:24 PM, Robert Kern robert.k...@gmail.com
wrote:
On Sun, Jan 13, 2013 at 6:27 PM, Nathaniel Smith n...@pobox.com wrote:
Hi all,
PR 2875 adds two new functions, that generalize zeros(),
On Sun, Jan 13, 2013 at 11:24 PM, Robert Kern robert.k...@gmail.com wrote:
One alternative that does not expand the API with two-liners is to let
the ndarray.fill() method return self:
a = np.empty(...).fill(20.0)
On 1/13/2013 6:39 PM, Nathaniel Smith wrote:
This violates the
On Sun, Jan 13, 2013 at 11:48 PM, Skipper Seabold jsseab...@gmail.com wrote:
On Sun, Jan 13, 2013 at 6:39 PM, Nathaniel Smith n...@pobox.com wrote:
On Sun, Jan 13, 2013 at 11:24 PM, Robert Kern robert.k...@gmail.com
wrote:
On Sun, Jan 13, 2013 at 6:27 PM, Nathaniel Smith n...@pobox.com
On Mon, Jan 14, 2013 at 1:04 AM, Nathaniel Smith n...@pobox.com wrote:
On Sun, Jan 13, 2013 at 11:48 PM, Skipper Seabold jsseab...@gmail.com wrote:
On Sun, Jan 13, 2013 at 6:39 PM, Nathaniel Smith n...@pobox.com wrote:
On Sun, Jan 13, 2013 at 11:24 PM, Robert Kern robert.k...@gmail.com
wrote:
48 matches
Mail list logo