On Fri, Aug 29, 2008 at 3:03 PM, Alan G Isaac <[EMAIL PROTECTED]> wrote:
> Stéfan van der Walt wrote:
> > At first, I also thought it might be more intuitive to return the
> > output array, but then I realised that it would make it more difficult
> > to realise that the operation is being performe
Stéfan van der Walt wrote:
> At first, I also thought it might be more intuitive to return the
> output array, but then I realised that it would make it more difficult
> to realise that the operation is being performed in-place. Maybe it
> is good to remind programmers of what happens under the
2008/8/29 Charles R Harris <[EMAIL PROTECTED]>:
>> I like that idea. A lot of numpy functions return a reference to the
>> modified array when the output array (out) is specified.
>
> Google up the various discussions of python sort to see why Guido doesn't
> like that sort of thing. We've had that
I suppose all the discussion on comp.lang.python
about list methods (especially sort) is becoming
relevant to this thread.
Cheers,
Alan Isaac
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-d
Keith Goodman wrote:
> On Fri, Aug 29, 2008 at 10:51 AM, Keith Goodman <[EMAIL PROTECTED]> wrote:
>
>> On Fri, Aug 29, 2008 at 10:42 AM, dmitrey <[EMAIL PROTECTED]> wrote:
>>
>>> Keith Goodman wrote:
>>>
Yeah, I do stuff like that too. fill works in place so it returns None.
>>>
On Fri, Aug 29, 2008 at 11:51 AM, Keith Goodman <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 29, 2008 at 10:42 AM, dmitrey <[EMAIL PROTECTED]>
> wrote:
> >
> > Keith Goodman wrote:
> >> Yeah, I do stuff like that too. fill works in place so it returns None.
> >>
> >>
> x = np.array([1,2])
>
On Fri, Aug 29, 2008 at 10:51 AM, Keith Goodman <[EMAIL PROTECTED]> wrote:
> On Fri, Aug 29, 2008 at 10:42 AM, dmitrey <[EMAIL PROTECTED]> wrote:
>>
>> Keith Goodman wrote:
>>> Yeah, I do stuff like that too. fill works in place so it returns None.
>>>
>>>
> x = np.array([1,2])
> x.fill(10)
On Fri, Aug 29, 2008 at 10:42 AM, dmitrey <[EMAIL PROTECTED]> wrote:
>
> Keith Goodman wrote:
>> Yeah, I do stuff like that too. fill works in place so it returns None.
>>
>>
x = np.array([1,2])
x.fill(10)
x
>>array([10, 10])
>>
x = x.fill(10) # <-- Danger!
print
Keith Goodman wrote:
> Yeah, I do stuff like that too. fill works in place so it returns None.
>
>
>>> x = np.array([1,2])
>>> x.fill(10)
>>> x
>>>
>array([10, 10])
>
>>> x = x.fill(10) # <-- Danger!
>>> print x
>>>
> None
>
Since result "None" is never used it would be
On Fri, Aug 29, 2008 at 10:19 AM, dmitrey <[EMAIL PROTECTED]> wrote:
> hi all,
> isn't it a bug
> (latest numpy from svn, as well as my older version)
>
> from numpy import array
> print array((1,2,3)).fill(10)
> None
Yeah, I do stuff like that too. fill works in place so it returns None.
>> x =
sorry, it isn't a bug, it's my fault, fill() returns None and do
in-place modification.
D.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
hi all,
isn't it a bug
(latest numpy from svn, as well as my older version)
from numpy import array
print array((1,2,3)).fill(10)
None
Regards, D.
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/nu
12 matches
Mail list logo