On Sun, Feb 1, 2009 at 12:24 AM, Robert Kern wrote:
> 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
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
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
On Fri, Jan 30, 2009 at 13:18, Christopher Barker wrote:
> I think you want to subclass an ndarray here. It's a bit tricky to so,
> but if you look in the wiki and these mailing list archives, you'll find
> advise on how to do it.
That still won't work. numpy.linalg.inv() simply does a particular
I think you want to subclass an ndarray here. It's a bit tricky to so,
but if you look in the wiki and these mailing list archives, you'll find
advise on how to do it.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959 voic
Hey,
What is the best solution to get this code working?
Anyone a good idea?
-- test.py ---
import numpy
import numpy.linalg
class afloat:
def __init__(self,x):
self.x = x
def __add__(self,rhs):