From 90687ece6b054b3527fed85361a9a2405d8841cd Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sun, 12 Nov 2023 12:01:59 +0000 Subject: [PATCH] add drop_nulls --- .../dataframe_api/dataframe_object.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index 142090e8..ddba939a 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -854,6 +854,28 @@ def fill_null( """ ... + def drop_nulls( + self, + *, + column_names: list[str] | None = None, + ) -> Self: + """Drop rows containing null values. + + Parameters + ---------- + column_names : list[str] | None + A list of column names to consider when dropping nulls. + If ``None``, all columns will be considered. + + Raises + ------ + KeyError + If ``column_names`` contains a column name that is not present in + the dataframe. + + """ + ... + def to_array(self, dtype: DType) -> Any: """Convert to array-API-compliant object.