Skip to main content
`Ctrl`+`K`

# pandas.HDFStore.append_to_multiple

HDFStore.append_to_multiple(d, value, selector, data_columns=None, axes=None, dropna=<no_default>, **kwargs)

  Append to multiple tables.

  Splits `value` column-wise according to `d` and appends each slice to the corresponding table. The `selector` table is the one you query against; its columns are made data_columns so they can be used in `where` clauses.

  Parameters:
    d dict

      Mapping of table_name to table_columns. `None` is acceptable as the values for one node (that table will get all the remaining columns).

    value DataFrame or Series

      Pandas object to split across the tables.

    selector str

      Designates the indexable table; all of its columns will be made data_columns unless `data_columns` is passed, in which case those are used.

    data_columns list of str or True, optional

      Columns to create as data columns, or `True` to use all columns.

    axes default None

      This parameter is currently not accepted.

    dropna bool, default False

      If `True`, drop rows from all tables if any single row in each table has all NaN.

      Deprecated since version 3.1.0: The `dropna` keyword is deprecated and will be removed in a future version. Use `DataFrame.dropna()` before writing instead.

    **kwargs

      Additional keyword arguments forwarded to `HDFStore.append()`.

  See also

  `HDFStore.append`

    Append to a single table.

  `HDFStore.select_as_multiple`

    Read from multiple tables with a single `where`.

  Examples

      >>> df = pd.DataFrame({"A": [1, 2], "B": [3, 4], "C": [5, 6]})
      >>> store = pd.HDFStore("store.h5", "w")
      >>> store.append_to_multiple(
      ...     {"t1": ["A", "B"], "t2": None}, df, selector="t1"
      ... )
      >>> store.close()