<h4 dir="auto">A small, complete example of the issue</h4>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import pandas as pd
import numpy as np
from multiprocessing import Pool
import warnings

# To avoid natural name warnings
warnings.filterwarnings('ignore')

def init(hdf_store):
    global hdf_buff
    hdf_buff = hdf_store

def reader(name):
    df = hdf_buff[name]
    return (name, df)

def main():
    # Creating the store
    with pd.HDFStore('storage.h5', 'w') as store:
        for i in range(100):
            df = pd.DataFrame(np.random.rand(5,3), columns=list('abc'))
            store.append(str(i), df, index=False, expectedrows=5)
    # Reading concurrently with one connection
    with pd.HDFStore('storage.h5', 'r') as store:
        with Pool(4, initializer=init, initargs=(store,)) as p:
            ret = pd.concat(dict(p.map(reader, [str(i) for i in range(100)])))

if __name__ == '__main__':
    main()
"><pre class="notranslate"><code class="notranslate">import pandas as pd
import numpy as np
from multiprocessing import Pool
import warnings

# To avoid natural name warnings
warnings.filterwarnings('ignore')

def init(hdf_store):
    global hdf_buff
    hdf_buff = hdf_store

def reader(name):
    df = hdf_buff[name]
    return (name, df)

def main():
    # Creating the store
    with pd.HDFStore('storage.h5', 'w') as store:
        for i in range(100):
            df = pd.DataFrame(np.random.rand(5,3), columns=list('abc'))
            store.append(str(i), df, index=False, expectedrows=5)
    # Reading concurrently with one connection
    with pd.HDFStore('storage.h5', 'r') as store:
        with Pool(4, initializer=init, initargs=(store,)) as p:
            ret = pd.concat(dict(p.map(reader, [str(i) for i in range(100)])))

if __name__ == '__main__':
    main()

</code></pre></div>
<p dir="auto">The above code either fails loudly with the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="tables.exceptions.HDF5ExtError: HDF5 error back trace

  File &quot;H5Dio.c&quot;, line 173, in H5Dread
    can't read data
  File &quot;H5Dio.c&quot;, line 554, in H5D__read
    can't read data
  File &quot;H5Dchunk.c&quot;, line 1856, in H5D__chunk_read
    error looking up chunk address
  File &quot;H5Dchunk.c&quot;, line 2441, in H5D__chunk_lookup
    can't query chunk address
  File &quot;H5Dbtree.c&quot;, line 998, in H5D__btree_idx_get_addr
    can't get chunk info
  File &quot;H5B.c&quot;, line 340, in H5B_find
    unable to load B-tree node
  File &quot;H5AC.c&quot;, line 1262, in H5AC_protect
    H5C_protect() failed.
  File &quot;H5C.c&quot;, line 3574, in H5C_protect
    can't load entry
  File &quot;H5C.c&quot;, line 7954, in H5C_load_entry
    unable to load entry
  File &quot;H5Bcache.c&quot;, line 143, in H5B__load
    wrong B-tree signature

End of HDF5 error back trace"><pre class="notranslate"><code class="notranslate">tables.exceptions.HDF5ExtError: HDF5 error back trace

  File "H5Dio.c", line 173, in H5Dread
    can't read data
  File "H5Dio.c", line 554, in H5D__read
    can't read data
  File "H5Dchunk.c", line 1856, in H5D__chunk_read
    error looking up chunk address
  File "H5Dchunk.c", line 2441, in H5D__chunk_lookup
    can't query chunk address
  File "H5Dbtree.c", line 998, in H5D__btree_idx_get_addr
    can't get chunk info
  File "H5B.c", line 340, in H5B_find
    unable to load B-tree node
  File "H5AC.c", line 1262, in H5AC_protect
    H5C_protect() failed.
  File "H5C.c", line 3574, in H5C_protect
    can't load entry
  File "H5C.c", line 7954, in H5C_load_entry
    unable to load entry
  File "H5Bcache.c", line 143, in H5B__load
    wrong B-tree signature

End of HDF5 error back trace
</code></pre></div>
<p dir="auto">Or with the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="multiprocessing.pool.RemoteTraceback:
&quot;&quot;&quot;
Traceback (most recent call last):
  File &quot;/home/kartik/miniconda3/lib/python3.5/multiprocessing/pool.py&quot;, line 119, in worker
    result = (True, func(*args, **kwds))
  File &quot;/home/kartik/miniconda3/lib/python3.5/multiprocessing/pool.py&quot;, line 44, in mapstar
    return list(map(*args))
  File &quot;/home/kartik/Documents/Code/Scripts/Benchmarking and optimization stuff/HDF_Concurrent.py&quot;, line 13, in reader
    df = hdf_buff[name]
  File &quot;/home/kartik/miniconda3/lib/python3.5/site-packages/pandas/io/pytables.py&quot;, line 461, in __getitem__
    return self.get(key)
  File &quot;/home/kartik/miniconda3/lib/python3.5/site-packages/pandas/io/pytables.py&quot;, line 677, in get
    raise KeyError('No object named %s in the file' % key)
KeyError: 'No object named 7 in the file'
&quot;&quot;&quot;"><pre class="notranslate"><code class="notranslate">multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/home/kartik/miniconda3/lib/python3.5/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/home/kartik/miniconda3/lib/python3.5/multiprocessing/pool.py", line 44, in mapstar
    return list(map(*args))
  File "/home/kartik/Documents/Code/Scripts/Benchmarking and optimization stuff/HDF_Concurrent.py", line 13, in reader
    df = hdf_buff[name]
  File "/home/kartik/miniconda3/lib/python3.5/site-packages/pandas/io/pytables.py", line 461, in __getitem__
    return self.get(key)
  File "/home/kartik/miniconda3/lib/python3.5/site-packages/pandas/io/pytables.py", line 677, in get
    raise KeyError('No object named %s in the file' % key)
KeyError: 'No object named 7 in the file'
"""
</code></pre></div>
<p dir="auto">But in this case, <code class="notranslate">object 7</code> clearly exists in the table. Any help?</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details>
<h2 dir="auto">INSTALLED VERSIONS</h2>
<p dir="auto">commit: None<br>
python: 3.5.2.final.0<br>
python-bits: 64<br>
OS: Linux<br>
OS-release: 4.4.0-47-generic<br>
machine: x86_64<br>
processor: x86_64<br>
byteorder: little<br>
LC_ALL: None<br>
LANG: en_US.UTF-8<br>
LOCALE: en_US.UTF-8</p>
<p dir="auto">pandas: 0.19.0<br>
nose: None<br>
pip: 8.1.2<br>
setuptools: 27.2.0<br>
Cython: 0.25.1<br>
numpy: 1.11.2<br>
scipy: 0.18.1<br>
statsmodels: 0.6.1<br>
xarray: 0.8.2<br>
IPython: 5.1.0<br>
sphinx: None<br>
patsy: 0.4.1<br>
dateutil: 2.5.3<br>
pytz: 2016.7<br>
blosc: None<br>
bottleneck: 1.1.0<br>
tables: 3.3.0<br>
numexpr: 2.6.1<br>
matplotlib: 1.5.3<br>
openpyxl: None<br>
xlrd: None<br>
xlwt: None<br>
xlsxwriter: 0.9.3<br>
lxml: None<br>
bs4: None<br>
html5lib: None<br>
httplib2: None<br>
apiclient: None<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: None<br>
jinja2: 2.8<br>
boto: None<br>
pandas_datareader: None</p>
</details>
<p dir="auto">I find the <code class="notranslate">Index.to_series</code> method is a convenient way to allow indices to act as columns of a dataframe where desired. However, the behavior of <code class="notranslate">MultiIndex.to_series</code>, which gives a <code class="notranslate">Series</code> of tuples, is less useful.</p>
<p dir="auto">Would it be convenient to provide a <code class="notranslate">to_dataframe</code> method for index classes? This would be a natural extension of the utility of <code class="notranslate">to_series</code>, and more useful for <code class="notranslate">MultiIndex</code> objects I would think.</p>
<p dir="auto">I'm   something equivalent to:</p>
<blockquote>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def to_dataframe(self):
   DataFrame(self.tolist(), columns=self.names, index=self)"><pre class="notranslate"><code class="notranslate">def to_dataframe(self):
   DataFrame(self.tolist(), columns=self.names, index=self)
</code></pre></div>
</blockquote>