[SciPy-user] How to start with SciPy and NumPy

Vicent vginer at gmail.com
Sun Jan 25 11:45:58 EST 2009


On Sun, Jan 25, 2009 at 13:26, Vicent <vginer at gmail.com> wrote:

>
>
> If I used NumPy arrays, then every value would be stored as "float" (I
> guess), and then an extra field would be necessary in order to store and get
> the actual type for each variable.
>
> I mean, I would have a "variable" class which would contain "value" and
> "type" as properties (among others), and then I would have a NumPy array of
> "variable" objects.
>
>
> Stop! [ I am thinking...]
>
> Anyway, I'll have a "variable" object, because I need to store some
> information for each variable, it doesn't depend on wether I use lists or
> arrays to store "variables".
>
> So, within each "variable" element in the NumPy array, the "value" property
> for that "variable" can contain an integer value, or a boolean value, etc.
> No matter about "different types of elements", because all of them are
> "wrapped" with the "variable" structure.
>
>
>
I've been reading a little about NumPy arrays and "dtypes" or data-types.

I understand I can create arrays where each element follows a specific
data-type structure.

But, if I create a class, can objects (which are instances) from that class
be elements of a NumPy array?

I mean, can I build a NumPy array whose elements are objects of a class I've
defined?

Sorry if my expressions are not right enough...

--
Vicent


-- 
Vicent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20090125/d408ff1d/attachment.html>


More information about the SciPy-User mailing list