File tree Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -813,26 +813,26 @@ def drop_nulls(
813
813
"""
814
814
...
815
815
816
- def to_array (self , dtype : DType ) -> Any :
816
+ def to_array (self ) -> Any :
817
817
"""Convert to array-API-compliant object.
818
818
819
- Parameters
820
- ----------
821
- dtype : DType
822
- The dtype of the array-API-compliant object to return.
823
- Must be one of:
824
-
825
- - Bool()
826
- - Int8()
827
- - Int16()
828
- - Int32()
829
- - Int64()
830
- - UInt8()
831
- - UInt16()
832
- - UInt32()
833
- - UInt64()
834
- - Float32()
835
- - Float64()
819
+ The resulting array will have the corresponding dtype from the
820
+ Array API:
821
+
822
+ - Bool() -> 'bool'
823
+ - Int8() -> 'int8'
824
+ - Int16() -> 'int16'
825
+ - Int32() -> 'int32'
826
+ - Int64() -> 'int64'
827
+ - UInt8() -> 'uint8'
828
+ - UInt16() -> 'uint16'
829
+ - UInt32() -> 'uint32'
830
+ - UInt64() -> 'uint64'
831
+ - Float32() -> 'float32'
832
+ - Float64() -> 'float64'
833
+
834
+ and multiple columns' dtypes are combined according to the
835
+ `Array API's type promotion rules <https://data-apis.org/array-api/latest/API_specification/type_promotion.html>`_.
836
836
837
837
Returns
838
838
-------
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def main(df_raw: SupportsDataFrameAPI) -> SupportsDataFrameAPI:
18
18
if isinstance (df .col (col_name ).dtype , pdx .Int64 )
19
19
],
20
20
)
21
- arr = df .to_array (pdx . Int64 () )
21
+ arr = df .to_array ()
22
22
arr = some_array_function (arr )
23
23
df = pdx .dataframe_from_2d_array (arr , names = ["a" , "b" ])
24
24
return df .dataframe
You can’t perform that action at this time.
0 commit comments