Vince Fulco (el 2007-11-25 a les 23:28:19 -0500) va dir::

>[...]
> Essentially I am taking a CSV file, converting the lines to numpy
> arrays and loading them into tables.  Upon running a query, I retrieve
> the coordinates so I can then increment the rows forward by 1 and 2
> periods and collect the observations.  However I am left with an
> ndarray with each line type as numpy void.  Running calculations on
> this type, (i.e. cumsum by row) causes an error "cannot perform
> accumulate with flexible type".
>[...]

I'm not quite sure of having understood the problem, but please note
that ``read*()``ing from a table results in a NumPy record array, i.e.
an array where rows are of an heterogeneous, compound type (void type in
NumPy parlance).  Even if your table only has one column, you will get
an array of this kind.

If you want to retrieve a single column from a ``read*()`` operation,
you may

  a. pass the name of the column as the ``field`` argument to the
     method, or
  b. given the resulting NumPy array ``arr``, use ``arr['colname']``.

But remember, tables *always have a compound type*.  Did I get the
problem (and the solution) right? ;)

::

        Ivan Vilata i Balaguer   >qo<   http://www.carabos.com/
               Cárabos Coop. V.  V  V   Enjoy Data
                                  ""

Attachment: signature.asc
Description: Digital signature

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to