From: Vicent M. <uv...@on...> - 2004-06-16 16:15:03
|
Hi again Ahmad, El Wednesday 16 June 2004 17:18, Ahmad Hosseinzadeh escribio: > Hi, > > I'm new to PyTables. > I don't know how to declare a string field with > variable length in my tables. You cannot. In a table object rows are defined inheriting the IsDescription class. This class, in turn, uses Col classes to declare the fields of the row. In particular fields of type string are declared using the StringCol class. As you can see in the manual (section 4.11.2) the very first parameter of the class constructor fixes the length of the string, so no variable length strings are available. However they can be simulated setting the length parameter to the maximum length you need. The reason is that when strings are read they just use its original size, not the maximum size given to the constructor. Hopefully support for tables with variable length of fields (VLTable) will be included in the release 1.0 of pytables. > Also I have problem with updating a table or array. > I want to update a record of my table (PyTables) but I > don't know how. > I have the same problem with arrays in PyTables. Updates are not yet supported. You will have to wait to release 0.9 > My solution is to remove the previous one and create a > new record or array but it is not efficient. > Can anyone help me? > > Thanks. > Ahmad. > -- Share what you know, learn what you don't |