pd.DataFrame is not stored efficiently to hdf5 format
#### Problem description

I have a pandas dataframe that takes 4 MB of the memory:

```Python
    >>> df.memory_usage(deep=True).sum() / (1024 ** 2)
    >>> 3.9931907653808594
```

When I save this dataframe to hdf5 file, the space 'my_data.hdf5' takes on disk is 21.1 MB:

```Python
    >>> df.to_hdf('my_data.hdf5', key='df', format='table')
```
This is a problem because the way that the pd.DataFrame.to_hdf stores the dataframe is not efficient.

#### Expected Output

I expected the .hdf5 file saved on the disk takes a similar amount of space as the space taken by pandas dataframe in the memory (4MB instead of 21 MB).

#### More information about the dataframe `df`

`df.info()` returns:
```Python
    <class 'pandas.core.frame.DataFrame'>
    Float64Index: 1440 entries, 1262300460.0 to 1262386800.0
    Columns: 879 entries,
    dtypes: category(212), float32(667)
    memory usage: 4.0 MB
```

`df.dtypes.unique()` returns:
```Python
    array([dtype('float32'),
           CategoricalDtype(categories=['Closing', 'Off'], ordered=False),
           CategoricalDtype(categories=['Active'], ordered=False),
           CategoricalDtype(categories=['-'], ordered=False),
           CategoricalDtype(categories=[], ordered=False),
           CategoricalDtype(categories=['Active', 'Off'], ordered=False),
           CategoricalDtype(categories=['Low', 'Off'], ordered=False),
           CategoricalDtype(categories=['Low'], ordered=False)], dtype=object)
```
#### More tests

 1. If I convert the categorical columns of the dataframe to integer data type, then the dataframe takes 4MB of memory. When I save it to hdf format, it takes 4.3 MB on disk.

This is how I convert categorical columns to integer datatype:

```Python
    for col in df.columns[df.dtypes == 'category']:
        df[col] = df[col].cat.codes
```
 
 2. If I convert the categorical columns of the dataframe to 'object' data type, then the dataframe takes 24 MB of memory. When I save it to hdf format, it takes 9.7 MB on disk.


#### Output of ``pd.show_versions()``

<details>

INSTALLED VERSIONS
------------------
commit: None
python: 3.6.4.final.0
python-bits: 64
OS: Darwin
OS-release: 17.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: en_GB.UTF-8

pandas: 0.23.3
pytest: 3.6.1
pip: 10.0.1
setuptools: 39.0.1
Cython: None
numpy: 1.14.2
scipy: 1.0.1
pyarrow: 0.9.0
xarray: 0.10.7
IPython: 6.3.1
sphinx: 1.7.2
patsy: 0.5.0
dateutil: 2.6.1
pytz: 2018.3
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.4
feather: 0.4.0
matplotlib: 2.2.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 1.0.1
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None

</details>
