pandas.HDFStore.remove#
- HDFStore.remove(key, where=None, start=None, stop=None)[source]#
Remove pandas object partially by specifying the where condition.
If
whereis not provided, the entire object stored atkey(and any of its child nodes) is removed. Whenwhereis given, only matching rows are deleted, which requires the object to be intableformat.- Parameters:
- keystr
Node to remove or delete rows from.
- wherelist of Term (or convertible) objects, optional
Conditions selecting which rows to remove.
- startint, optional
Row number to start selection.
- stopint, optional
Row number to stop selection.
- Returns:
- int or None
Number of rows removed (or
Noneif the object is not a Table).
- Raises:
- KeyError
If
keyis not a valid store.
See also
HDFStore.appendAppend data to an existing table.
HDFStore.putStore 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()