title: Pandas HDFStore: changing dtype of indexes
body: <p><strong>Does there exist a way of controlling the data type that is used for storing indexes of data frames when using <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.io.pytables.HDFStore.append.html" rel="nofollow">HDFStore.append</a>?</strong></p>
  
  <p>It seems pandas indexes are always stored with 64bits in the hdf5 file. I would like to increase storage efficiency and reduce the size of the index columns.</p>
  
  <p>I have a unique 3 column multi index and saving them as uint64 indexes is an enormous waste of space in my application:</p>
  
  <p>Given the following data frame</p>
  
  <pre><code>In [15]: df.dtypes
  Out[15]: indA              int32
  indB              int16
  indC              int8
  data              float32
  dtype: object
  </code></pre>
  
  <p>simply setting <code>df.set_index(['indA', 'indB', 'indC'])</code> before <code>HDFStore.append</code> results in <code>indA</code>, <code>indB</code> and <code>indC</code> being stored as <code>Int64Col</code> in the hdf5 file.</p>
  
  <p>Not setting a pandas index and specifying pytables data columns instead:</p>
  
  <pre><code>store.append('mytable', df, data_columns=['indA', 'indB', 'indB'])
  </code></pre>
  
  <p><code>indA</code>, <code>indB</code> and <code>indC</code> are stored with their original dtypes, however an additional <code>Int64Col</code> is stored in the hdf5 file.</p>
  
  <p>This does not really help: by storing in the original dtypes I am saving/conserving 56 bits for the three <code>ind</code> columns. The additional (superfluous) index column however costs 64 bits...</p>
  
  <p>Any ideas?</p>