Skip to main content
`Ctrl`+`K`

# pandas.HDFStore.remove

HDFStore.remove(key, where=None, start=None, stop=None)

  Remove pandas object partially by specifying the where condition.

  If `where` is not provided, the entire object stored at `key` (and any of its child nodes) is removed. When `where` is given, only matching rows are deleted, which requires the object to be in `table` format.

  Parameters:
    key str

      Node to remove or delete rows from.

    where list of Term (or convertible) objects, optional

      Conditions selecting which rows to remove.

    start int, optional

      Row number to start selection.

    stop int, optional

      Row number to stop selection.

  Returns:
    int or None

      Number of rows removed (or `None` if the object is not a Table).

  Raises:
    KeyError

      If `key` is not a valid store.

  See also

  `HDFStore.append`

    Append data to an existing table.

  `HDFStore.put`

    Store an object in the file.

  Examples

      >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=["A", "B"])
      >>> store = pd.HDFStore("store.h5", "w")
      >>> store.put("data", df)
      >>> store.remove("data")
      >>> store.close()