diff --git a/spec/API_specification/dataframe_api/column_object.py b/spec/API_specification/dataframe_api/column_object.py index 0145757b..e0bef139 100644 --- a/spec/API_specification/dataframe_api/column_object.py +++ b/spec/API_specification/dataframe_api/column_object.py @@ -700,3 +700,25 @@ def fill_null(self: Column[DType], value: Scalar, /) -> Column[DType]: """ ... + + def to_array_object(self, dtype: Any) -> Any: + """ + Convert to array-API-compliant object. + + Parameters + ---------- + dtype : Any + The dtype of the array-API-compliant object to return. + + Returns + ------- + Any + An array-API-compliant object. + + Notes + ----- + While numpy arrays are not yet array-API-compliant, implementations + may choose to return a numpy array (for numpy prior to 2.0), with the + understanding that consuming libraries would then use the + ``array-api-compat`` package to convert it to a Standard-compliant array. + """ diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index acb7260a..636c49bb 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -828,3 +828,25 @@ def fill_null( """ ... + + def to_array_object(self, dtype: Any) -> Any: + """ + Convert to array-API-compliant object. + + Parameters + ---------- + dtype : Any + The dtype of the array-API-compliant object to return. + + Returns + ------- + Any + An array-API-compliant object. + + Notes + ----- + While numpy arrays are not yet array-API-compliant, implementations + may choose to return a numpy array (for numpy prior to 2.0), with the + understanding that consuming libraries would then use the + ``array-api-compat`` package to convert it to a Standard-compliant array. + """