How to specify min_itemsize for an index column

≯℡__Kan透↙ 提交于 2019-12-23 20:24:44

问题


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 

来源:https://stackoverflow.com/questions/27222271/how-to-specify-min-itemsize-for-an-index-column

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!