diff --git a/spec/API_specification/dataframe_api/__init__.py b/spec/API_specification/dataframe_api/__init__.py index cd6ef443..afca3cb0 100644 --- a/spec/API_specification/dataframe_api/__init__.py +++ b/spec/API_specification/dataframe_api/__init__.py @@ -12,6 +12,16 @@ from ._types import DType +__all__ = [ + "__dataframe_api_version", + "column_from_sequence", + "concat", + "dataframe_from_dict", + "isnull", + "null", +] + + __dataframe_api_version__: str = "YYYY.MM" """ String representing the version of the DataFrame API specification to which diff --git a/spec/API_specification/dataframe_api/column_object.py b/spec/API_specification/dataframe_api/column_object.py index 0d8a8a27..3fec189c 100644 --- a/spec/API_specification/dataframe_api/column_object.py +++ b/spec/API_specification/dataframe_api/column_object.py @@ -456,3 +456,17 @@ def unique_indices(self, *, skip_nulls: bool = True) -> Column[int]: To get the unique values, you can do ``col.get_rows(col.unique_indices())``. """ ... + + def fill_nan(self, value: float | 'null', /) -> Column: + """ + Fill floating point ``nan`` values with the given fill value. + + Parameters + ---------- + value : float or `null` + Value used to replace any ``nan`` in the column with. Must be + of the Python scalar type matching the dtype of the column (or + be `null`). + + """ + ... diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index 70c39025..e348051f 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -706,3 +706,20 @@ def isnan(self) -> DataFrame: In particular, does not check for `np.timedelta64('NaT')`. """ ... + + def fill_nan(self, value: float | 'null', /) -> DataFrame: + """ + Fill ``nan`` values with the given fill value. + + The fill operation will apply to all columns with a floating-point + dtype. Other columns remain unchanged. + + Parameters + ---------- + value : float or `null` + Value used to replace any ``nan`` in the column with. Must be + of the Python scalar type matching the dtype of the column (or + be `null`). + + """ + ...