I am attempting to run queries on a table and then do some summary
calculations on the results.  However, I seem to be stuck with a
results format which can't be referenced easily by columns nor have
calculations run on it.  The code below may be unnecessarily
complicated but I was unable to get slices to work properly on
non-contiguous time periods with table.read(start,stop,step).

<snippet of code>
tser2 = [x.nrow for x in table1.where(foo_condition)]
#
tser3 = map(int,tser2)
tser4 = numpy.array(tser3)
tser5 = tser4 + 1
tser6 = tser4 + 2

month1 = table1.readCoordinates(tser4)
month2 = table1.readCoordinates(tser5)
</snippet ends>

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".

Happened to find an earlier discussion by Mr. Stephen Simmons whereby
he converted to numpy.array post the table.read(). So I am unsure as
to the right path to pursue.  I was under the impression, when a numpy
array was imported into the table, one should get a numpy array as a
result query.  The mis-guided read.coordinates() exercise must be
screwing this up

Unfortunately I can't include all the code due to the proprietary
nature of the research I am doing.  Would appreciate any tips and/or
tricks however.  Thank you for your valuable time.

Best regards,

-- 
Vince Fulco

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to