Hi there,

I have some generic functions that take time series data with 2 numpy array
arguments, time and value, and return 2 numpy arrays of time and value.

I would like to place these arrays into a Numpy structured array or
directly into a new pytables table with fields, time and value.

Now Ive found I could do this:

    t, v = some_func(t, v)

    A = np.empty(len(t), dtype=[('time', np.float64), ('value',
np.float64)])

    A['time'] = t
    A['value'] = v

    hfile.createTable(grp, 'signal', description=A)
    hfile.flush()

But this seems rather clunky and inefficient.  Any suggestions to make this
repackaging a little smoother?
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to