Skip to content

Commit e60739c

Browse files
authored
add to-array-object (#209)
1 parent 8632788 commit e60739c

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

spec/API_specification/dataframe_api/column_object.py

+22
Original file line numberDiff line numberDiff line change
@@ -700,3 +700,25 @@ def fill_null(self: Column[DType], value: Scalar, /) -> Column[DType]:
700700
701701
"""
702702
...
703+
704+
def to_array_object(self, dtype: Any) -> Any:
705+
"""
706+
Convert to array-API-compliant object.
707+
708+
Parameters
709+
----------
710+
dtype : Any
711+
The dtype of the array-API-compliant object to return.
712+
713+
Returns
714+
-------
715+
Any
716+
An array-API-compliant object.
717+
718+
Notes
719+
-----
720+
While numpy arrays are not yet array-API-compliant, implementations
721+
may choose to return a numpy array (for numpy prior to 2.0), with the
722+
understanding that consuming libraries would then use the
723+
``array-api-compat`` package to convert it to a Standard-compliant array.
724+
"""

spec/API_specification/dataframe_api/dataframe_object.py

+22
Original file line numberDiff line numberDiff line change
@@ -816,3 +816,25 @@ def fill_null(
816816
817817
"""
818818
...
819+
820+
def to_array_object(self, dtype: Any) -> Any:
821+
"""
822+
Convert to array-API-compliant object.
823+
824+
Parameters
825+
----------
826+
dtype : Any
827+
The dtype of the array-API-compliant object to return.
828+
829+
Returns
830+
-------
831+
Any
832+
An array-API-compliant object.
833+
834+
Notes
835+
-----
836+
While numpy arrays are not yet array-API-compliant, implementations
837+
may choose to return a numpy array (for numpy prior to 2.0), with the
838+
understanding that consuming libraries would then use the
839+
``array-api-compat`` package to convert it to a Standard-compliant array.
840+
"""

0 commit comments

Comments
 (0)