Numpy 1.3 In [1]: import numpy as np In [2]: a = np.zeros(5).fill(5) In [3]: a In [4]: type(a) Out[4]: <type 'NoneType'> In [5]: a = np.zeros(5) In [6]: a.fill(5) In [7]: a Out[7]: array([ 5., 5., 5., 5., 5.]) What i'm trying to do may not be the best way, but I think it should still have worked. Thoughts? Cheers, Chris
On Fri, Jul 31, 2009 at 17:15, Chris Colbert<sccolbert@gmail.com> wrote:
Numpy 1.3
In [1]: import numpy as np
In [2]: a = np.zeros(5).fill(5)
In [3]: a
In [4]: type(a) Out[4]: <type 'NoneType'>
In [5]: a = np.zeros(5)
In [6]: a.fill(5)
In [7]: a Out[7]: array([ 5., 5., 5., 5., 5.])
What i'm trying to do may not be the best way, but I think it should still have worked.
Thoughts?
Not a bug. As you can see from In[6], .fill() does not return anything (except the obligatory None). This is just like how list.sort() returns None. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
ahh, yeah I see now. Thanks! nothing like making myself look the fool on a friday! Cheers! On Fri, Jul 31, 2009 at 6:20 PM, Robert Kern<robert.kern@gmail.com> wrote:
On Fri, Jul 31, 2009 at 17:15, Chris Colbert<sccolbert@gmail.com> wrote:
Numpy 1.3
In [1]: import numpy as np
In [2]: a = np.zeros(5).fill(5)
In [3]: a
In [4]: type(a) Out[4]: <type 'NoneType'>
In [5]: a = np.zeros(5)
In [6]: a.fill(5)
In [7]: a Out[7]: array([ 5., 5., 5., 5., 5.])
What i'm trying to do may not be the best way, but I think it should still have worked.
Thoughts?
Not a bug. As you can see from In[6], .fill() does not return anything (except the obligatory None). This is just like how list.sort() returns None.
-- Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Fri, Jul 31, 2009 at 4:30 PM, Chris Colbert <sccolbert@gmail.com> wrote:
ahh, yeah I see now. Thanks!
nothing like making myself look the fool on a friday!
If you have to choose a day, Friday is the day of choice. Or a least it supposedly works that way for bad news and politics. Chuck
participants (4)
-
Charles R Harris
-
Chris Colbert
-
Ian Mallett
-
Robert Kern