How to specify min_itemsize for an index column

439 Views Asked by At

I am unable to specify the minimum size for the index in a to_hdf append operation. Min_itemsize works for the data columns, so how can I get it to work for the index column?

This code:

from pandas import *

df = DataFrame(['1','2'],index=['a','b'])
df.index.name = 'symbol'

df.to_hdf("store.h5",'df',append = True,format='table',min_itemsize = { 'symbol' : 10} )

generates this error message:

ValueError: min_itemsize has the key [symbol] which is not an axis or data_column 
0

There are 0 best solutions below