A Tuesday 15 January 2008, Luca Della Santina escrigué:
> I'd like to add basic spreadsheet-like functionalities to my
> application which bases its data model upon pytables, I was looking
> for a way to modify the structure of an exsistent Table, in
> particular:
>
> 1) How to move/insert a column into the Table
> 2) How to change the type of a column and convert its data
> 3) How to change the name of a column
>
> If I well understood, by design the structure of columns defined for
> a table (by the custom tables.IsDescription subclass) is not meant to
> be directly changed by the user after the table is created.
>
> Users may circumnavigate the problem creating a temporary table with
> the desidered column structure and then merge the old column values
> into the new table structure, like it is shown in the example
> "add-column.py" of pytables' documentation, but obviously it is not
> an efficient approach compared to an in-place change of column
> properties.
>
> Are there are alternative ways to accomplish these task? If not, is
> there space in pytables development plans to enhance the
> possibilities to modify the columns' structure of a table?

Plainly said, there is right now no alternatives for altering the 
structure of a table without rewriting it entirely.  This is why 
PyTables has to be mostly useful for (very fast access to) read-only 
data and (fast) row appends or updates.

Doing 1) and 2) in a effective way is not impossible, but would require 
an implementation of column-wise tables first (columns in PyTables are 
row-wise right now).  Of course, this is a recurrent issue that has 
been discussed several times on this list, but as the implementation 
is, to say the least, not easy, that should wait until we have time and 
resources enough (or someone steps ahead and contributes one!).

Doing 3) should not require column-wise tables at all, but it is not 
implemented yet (and should be not very difficult; volunteers?).

Ciao,

-- 
>0,0<   Francesc Altet     http://www.carabos.com/
V   V   Cárabos Coop. V.   Enjoy Data
 "-"

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