atoti.Table.drop()#
- Table.drop(filter=None, /)#
Delete some of the table’s rows.
- Parameters:
filter (Condition[ColumnIdentifier, Literal['eq', 'ge', 'gt', 'le', 'lt', 'ne', 'isin'], Constant | None, ~typing.Literal['and', 'or'] | None] | None) – Rows where this condition evaluates to
True
will be deleted. IfNone
, all the rows will be deleted.
Example
>>> df = pd.DataFrame( ... columns=["City", "Price"], ... data=[ ... ("London", 240.0), ... ("New York", 270.0), ... ("Paris", 200.0), ... ], ... ) >>> table = session.read_pandas(df, keys=["City"], table_name="Cities") >>> table.head().sort_index() Price City London 240.0 New York 270.0 Paris 200.0 >>> table.drop((table["City"] == "Paris") | (table["Price"] <= 250.0)) >>> table.head().sort_index() Price City New York 270.0 >>> table.drop() >>> table.head() Empty DataFrame Columns: [Price] Index: []