How should python dictionaries be stored in pytables?
问题 pytables doesn't natively support python dictionaries. The way I've approached it is to make a data structure of the form: tables_dict = { 'key' : tables.StringCol(itemsize=40), 'value' : tables.Int32Col(), } (note that I ensure that the keys are <40 characters long) and then create a table using this structure: file_handle.createTable('/', 'dictionary', tables_dict) and then populate it with: file_handle.dictionary.append(dictionary.items()) and retrieve data with: dict(file_handle