Re: [Numpy-discussion] minor improvment to ones

2009-01-31 Thread Geoffrey Irving
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 ___

Re: [Numpy-discussion] using numpy functions on an array of objects

2009-01-31 Thread Robert Kern
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

Re: [Numpy-discussion] ndarray.resize method and reference counting

2009-01-31 Thread Jon Olav Vik
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

Re: [Numpy-discussion] Building on WinXP 64-bit, Intel Compilers

2009-01-31 Thread Mike Colonno
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",

Re: [Numpy-discussion] using numpy functions on an array of objects

2009-01-31 Thread Sebastian Walter
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