How can the shape of a pytables table column be defined by a variable?
问题 I'm trying to create an IsDescription subclass, so that I can define the structure of a table I'm trying to create. One of the attributes of the subclass** needs to be shaped given a certain length that is unknown until runtime (it depends on a file being parsed), but is fixed at runtime. Sample code: import tables class MyClass(tables.IsDescription): def __init__(self, param): var1 = tables.Float64Col(shape=(param)) MyClass1 = MyClass(12) Which returns: TypeError: object.__new__() takes no