我使用PyTables將Python數據存儲在HDF5文件中,它需要一個輔助類來創建一個表。這裏有一個例子: class PacketData(pt.IsDescription):
data = pt.UInt8Col(shape=(128,))
# later code does this:
self.tdata = self.hfile.createTable(self.g,
我將一個pandas數據框存儲爲一個包含MultiIndex的pytable。 MultiIndex的第一個級別是與用戶ID對應的字符串。現在,大多數用戶ID都是13個字符,但其中一些是15個字符。當我追加一個包含long userID的記錄時,pytables會產生一個錯誤,因爲它需要一個13個字符的字段。 ValueError('Trying to store a string with le