Kevin Christman (el 2008-02-14 a les 23:16:27 -0800) va dir::

> I have a question regarding nested tables.  The populating a nested
> table example in the PyTables UserManual (pp. 44-45) only deals with a
> nested table that is called once and really doesn't subdivide.
> However, what if my data structure looks something like:
> 
> [... sorry, the table is mangled ...]
>  
> I'm not sure how to use the row.append() for such a situation.  For
> example, I first populate MotorName, then Set#1, then 25% and 80%.
> Next I want to proceed to the next "subrow", so do I do a row.append()
> now?  If so does it append that "subrow" only, or does it
> automatically jump to the next MotorName row (2314)?  Or is there
> another preferred method of filling such nested tables?

Since ``table.row`` refers to a new, full row in ``table``, calling
``row.append()`` appends *the full row* to the table, and moves on to
the next one.  Thus, when appending rows, you should make sure that all
fields (including the nested ones) get their desired (or default)
values before calling ``row.append()``.  Calling it more than once in
the appending loop will result in unwanted rows!

HTH,

::

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

Attachment: signature.asc
Description: Digital signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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