[Numpy-discussion] python user defined type

Christopher Barker Chris.Barker@noaa....
Fri Jul 11 12:03:50 CDT 2008


Nicolas Rougier wrote:
> My Unit class is supposed to represent a neuron that can be linked to
> any other unit. The neuron itself is merely a (float) potential that can
> vary along time under the influence of other units and learning.

> gather these units into groups which are in fact 2D matrix of units.

If you don't want to get into numpy internals, or write your own array 
classes, my thought is to re-think the structure, and rather than have 
an array of Unit objects, have a subclass of numpy array that represents 
the group, that is an array floats, plus whatever meta information you 
need.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov


More information about the Numpy-discussion mailing list