[Numpy-discussion] isn't it a bug in array.fill()?

Keith Goodman kwgoodman@gmail....
Fri Aug 29 12:27:51 CDT 2008


On Fri, Aug 29, 2008 at 10:19 AM, dmitrey <dmitrey.kroshko@scipy.org> 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 = np.array([1,2])
>> x.fill(10)
>> x
   array([10, 10])
>> x = x.fill(10)  # <-- Danger!
>> print x
None


More information about the Numpy-discussion mailing list