def to_hdf(self, path_or_buf, key, **kwargs):
    "\n        Write the contained data to an HDF5 file using HDFStore.\n\n        Hierarchical Data Format (HDF) is self-describing, allowing an\n        application to interpret the structure and contents of a file with\n        no outside information. One HDF file can hold a mix of related objects\n        which can be accessed as a group or as individual objects.\n\n        In order to add another DataFrame or Series to an existing HDF file\n        please use append mode and a different a key.\n\n        For more information see the :ref:`user guide <io.hdf5>`.\n\n        Parameters\n        ----------\n        path_or_buf : str or pandas.HDFStore\n            File path or HDFStore object.\n        key : str\n            Identifier for the group in the store.\n        mode : {'a', 'w', 'r+'}, default 'a'\n            Mode to open file:\n\n            - 'w': write, a new file is created (an existing file with\n              the same name would be deleted).\n            - 'a': append, an existing file is opened for reading and\n              writing, and if the file does not exist it is created.\n            - 'r+': similar to 'a', but the file must already exist.\n        format : {'fixed', 'table'}, default 'fixed'\n            Possible values:\n\n            - 'fixed': Fixed format. Fast writing/reading. Not-appendable,\n              nor searchable.\n            - 'table': Table format. Write as a PyTables Table structure\n              which may perform worse but allow more flexible operations\n              like searching / selecting subsets of the data.\n        append : bool, default False\n            For Table formats, append the input data to the existing.\n        data_columns :  list of columns or True, optional\n            List of columns to create as indexed data columns for on-disk\n            queries, or True to use all columns. By default only the axes\n            of the object are indexed. See :ref:`io.hdf5-query-data-columns`.\n            Applicable only to format='table'.\n        complevel : {0-9}, optional\n            Specifies a compression level for data.\n            A value of 0 disables compression.\n        complib : {'zlib', 'lzo', 'bzip2', 'blosc'}, default 'zlib'\n            Specifies the compression library to be used.\n            As of v0.20.2 these additional compressors for Blosc are supported\n            (default if no compressor specified: 'blosc:blosclz'):\n            {'blosc:blosclz', 'blosc:lz4', 'blosc:lz4hc', 'blosc:snappy',\n            'blosc:zlib', 'blosc:zstd'}.\n            Specifying a compression library which is not available issues\n            a ValueError.\n        fletcher32 : bool, default False\n            If applying compression use the fletcher32 checksum.\n        dropna : bool, default False\n            If true, ALL nan rows will not be written to store.\n        errors : str, default 'strict'\n            Specifies how encoding and decoding errors are to be handled.\n            See the errors argument for :func:`open` for a full list\n            of options.\n\n        See Also\n        --------\n        DataFrame.read_hdf : Read from HDF file.\n        DataFrame.to_parquet : Write a DataFrame to the binary parquet format.\n        DataFrame.to_sql : Write to a sql table.\n        DataFrame.to_feather : Write out feather-format for DataFrames.\n        DataFrame.to_csv : Write out to a csv file.\n\n        Examples\n        --------\n        >>> df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]},\n        ...                   index=['a', 'b', 'c'])\n        >>> df.to_hdf('data.h5', key='df', mode='w')\n\n        We can add another object to the same file:\n\n        >>> s = pd.Series([1, 2, 3, 4])\n        >>> s.to_hdf('data.h5', key='s')\n\n        Reading from HDF file:\n\n        >>> pd.read_hdf('data.h5', 'df')\n        A  B\n        a  1  4\n        b  2  5\n        c  3  6\n        >>> pd.read_hdf('data.h5', 's')\n        0    1\n        1    2\n        2    3\n        3    4\n        dtype: int64\n\n        Deleting file with data:\n\n        >>> import os\n        >>> os.remove('data.h5')\n        "
    from pandas.io import pytables
    return pytables.to_hdf(path_or_buf, key, self, **kwargs)
Write the contained data to an HDF5 file using HDFStore.

Hierarchical Data Format (HDF) is self-describing, allowing an
application to interpret the structure and contents of a file with
no outside information. One HDF file can hold a mix of related objects
which can be accessed as a group or as individual objects.

In order to add another DataFrame or Series to an existing HDF file
please use append mode and a different a key.

For more information see the :ref:`user guide <io.hdf5>`.

Parameters
----------
path_or_buf : str or pandas.HDFStore
    File path or HDFStore object.
key : str
    Identifier for the group in the store.
mode : {'a', 'w', 'r+'}, default 'a'
    Mode to open file:

    - 'w': write, a new file is created (an existing file with
      the same name would be deleted).
    - 'a': append, an existing file is opened for reading and
      writing, and if the file does not exist it is created.
    - 'r+': similar to 'a', but the file must already exist.
format : {'fixed', 'table'}, default 'fixed'
    Possible values:

    - 'fixed': Fixed format. Fast writing/reading. Not-appendable,
      nor searchable.
    - 'table': Table format. Write as a PyTables Table structure
      which may perform worse but allow more flexible operations
      like searching / selecting subsets of the data.
append : bool, default False
    For Table formats, append the input data to the existing.
data_columns :  list of columns or True, optional
    List of columns to create as indexed data columns for on-disk
    queries, or True to use all columns. By default only the axes
    of the object are indexed. See :ref:`io.hdf5-query-data-columns`.
    Applicable only to format='table'.
complevel : {0-9}, optional
    Specifies a compression level for data.
    A value of 0 disables compression.
complib : {'zlib', 'lzo', 'bzip2', 'blosc'}, default 'zlib'
    Specifies the compression library to be used.
    As of v0.20.2 these additional compressors for Blosc are supported
    (default if no compressor specified: 'blosc:blosclz'):
    {'blosc:blosclz', 'blosc:lz4', 'blosc:lz4hc', 'blosc:snappy',
    'blosc:zlib', 'blosc:zstd'}.
    Specifying a compression library which is not available issues
    a ValueError.
fletcher32 : bool, default False
    If applying compression use the fletcher32 checksum.
dropna : bool, default False
    If true, ALL nan rows will not be written to store.
errors : str, default 'strict'
    Specifies how encoding and decoding errors are to be handled.
    See the errors argument for :func:`open` for a full list
    of options.

See Also
--------
DataFrame.read_hdf : Read from HDF file.
DataFrame.to_parquet : Write a DataFrame to the binary parquet format.
DataFrame.to_sql : Write to a sql table.
DataFrame.to_feather : Write out feather-format for DataFrames.
DataFrame.to_csv : Write out to a csv file.

Examples
--------
>>> df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]},
...                   index=['a', 'b', 'c'])
>>> df.to_hdf('data.h5', key='df', mode='w')

We can add another object to the same file:

>>> s = pd.Series([1, 2, 3, 4])
>>> s.to_hdf('data.h5', key='s')

Reading from HDF file:

>>> pd.read_hdf('data.h5', 'df')
A  B
a  1  4
b  2  5
c  3  6
>>> pd.read_hdf('data.h5', 's')
0    1
1    2
2    3
3    4
dtype: int64

Deleting file with data:

>>> import os
>>> os.remove('data.h5')
def to_hdf(self, path_or_buf, key, **kwargs):
    "\n        Write the contained data to an HDF5 file using HDFStore.\n\n        Hierarchical Data Format (HDF) is self-describing, allowing an\n        application to interpret the structure and contents of a file with\n        no outside information. One HDF file can hold a mix of related objects\n        which can be accessed as a group or as individual objects.\n\n        In order to add another DataFrame or Series to an existing HDF file\n        please use append mode and a different a key.\n\n        For more information see the :ref:`user guide <io.hdf5>`.\n\n        Parameters\n        ----------\n        path_or_buf : str or pandas.HDFStore\n            File path or HDFStore object.\n        key : str\n            Identifier for the group in the store.\n        mode : {'a', 'w', 'r+'}, default 'a'\n            Mode to open file:\n\n            - 'w': write, a new file is created (an existing file with\n              the same name would be deleted).\n            - 'a': append, an existing file is opened for reading and\n              writing, and if the file does not exist it is created.\n            - 'r+': similar to 'a', but the file must already exist.\n        format : {'fixed', 'table'}, default 'fixed'\n            Possible values:\n\n            - 'fixed': Fixed format. Fast writing/reading. Not-appendable,\n              nor searchable.\n            - 'table': Table format. Write as a PyTables Table structure\n              which may perform worse but allow more flexible operations\n              like searching / selecting subsets of the data.\n        append : bool, default False\n            For Table formats, append the input data to the existing.\n        data_columns :  list of columns or True, optional\n            List of columns to create as indexed data columns for on-disk\n            queries, or True to use all columns. By default only the axes\n            of the object are indexed. See :ref:`io.hdf5-query-data-columns`.\n            Applicable only to format='table'.\n        complevel : {0-9}, optional\n            Specifies a compression level for data.\n            A value of 0 disables compression.\n        complib : {'zlib', 'lzo', 'bzip2', 'blosc'}, default 'zlib'\n            Specifies the compression library to be used.\n            As of v0.20.2 these additional compressors for Blosc are supported\n            (default if no compressor specified: 'blosc:blosclz'):\n            {'blosc:blosclz', 'blosc:lz4', 'blosc:lz4hc', 'blosc:snappy',\n            'blosc:zlib', 'blosc:zstd'}.\n            Specifying a compression library which is not available issues\n            a ValueError.\n        fletcher32 : bool, default False\n            If applying compression use the fletcher32 checksum.\n        dropna : bool, default False\n            If true, ALL nan rows will not be written to store.\n        errors : str, default 'strict'\n            Specifies how encoding and decoding errors are to be handled.\n            See the errors argument for :func:`open` for a full list\n            of options.\n\n        See Also\n        --------\n        DataFrame.read_hdf : Read from HDF file.\n        DataFrame.to_parquet : Write a DataFrame to the binary parquet format.\n        DataFrame.to_sql : Write to a sql table.\n        DataFrame.to_feather : Write out feather-format for DataFrames.\n        DataFrame.to_csv : Write out to a csv file.\n\n        Examples\n        --------\n        >>> df = pd.DataFrame({'A': [1, 2, 3], 'B': [4, 5, 6]},\n        ...                   index=['a', 'b', 'c'])\n        >>> df.to_hdf('data.h5', key='df', mode='w')\n\n        We can add another object to the same file:\n\n        >>> s = pd.Series([1, 2, 3, 4])\n        >>> s.to_hdf('data.h5', key='s')\n\n        Reading from HDF file:\n\n        >>> pd.read_hdf('data.h5', 'df')\n        A  B\n        a  1  4\n        b  2  5\n        c  3  6\n        >>> pd.read_hdf('data.h5', 's')\n        0    1\n        1    2\n        2    3\n        3    4\n        dtype: int64\n\n        Deleting file with data:\n\n        >>> import os\n        >>> os.remove('data.h5')\n        "
    from pandas.io import pytables
    return pytables.to_hdf(path_or_buf, key, self, **kwargs)