On Fri, Jan 30, 2009 at 5:18 AM, Neal Becker wrote:
> A nit, but it would be nice if 'ones' could fill with a value other than 1.
>
> Maybe an optional val= keyword?
You can use the "tile" function for this. "tile(3,3)" creates an
array of 3 3's.
Geoffrey
___
On Sat, Jan 31, 2009 at 10:30, Sebastian Walter
wrote:
> Wouldn't it be nice to have numpy a little more generic?
> All that would be needed was a little check of the arguments.
>
> If I do:
> numpy.trace(4)
> shouldn't numpy be smart enough to regard the 4 as a 1x1 array?
Why? It's not a 1x1 arr
Scott Sinclair gmail.com> writes:
> >>> import numpy as np
> >>> x = np.eye(3)
> >>> x
> array([[ 1., 0., 0.],
>[ 0., 1., 0.],
>[ 0., 0., 1.]])
> >>> x.resize((5,5))
> Traceback (most recent call last):
> File "", line 1, in
> ValueError: cannot resize an array that has b
Maybe I declared success too soon... The build / install of numpy seems to
work (using MS C++ / Intel Fortran), but upon trying to import numpy I get:
>>>from numpy import *
Traceback (most recent call last):
File "C:\", line 1, in
File "C:\Python26\Lib\site-packages\numpy\__init__.py",
Wouldn't it be nice to have numpy a little more generic?
All that would be needed was a little check of the arguments.
If I do:
numpy.trace(4)
shouldn't numpy be smart enough to regard the 4 as a 1x1 array?
numpy.sin(4) works!
and if
x = my_class(4)
wouldn't it be nice if
numpy.trace(x)
would c