@@ -138,10 +138,8 @@ def column_from_1d_array(array: Any, *, name: str = "") -> Column:
138
138
See `dataframe_from_2d_array` for related 2D function.
139
139
140
140
Only Array-API-compliant 1D arrays are supported.
141
- Cross-kind casting is undefined and may vary across implementations.
142
- Downcasting is disallowed.
143
141
144
- The resulting column will have the dtype to the
142
+ The resulting column will have the dtype corresponding to the
145
143
Array API one:
146
144
147
145
- 'bool' -> Bool()
@@ -170,22 +168,34 @@ def column_from_1d_array(array: Any, *, name: str = "") -> Column:
170
168
...
171
169
172
170
173
- def dataframe_from_2d_array (array : Any , * , schema : dict [str , DType ]) -> DataFrame :
171
+ def dataframe_from_2d_array (array : Any , * , names : Sequence [str ]) -> DataFrame :
174
172
"""Construct DataFrame from 2D array.
175
173
176
174
See `column_from_1d_array` for related 1D function.
177
175
178
176
Only Array-API-compliant 2D arrays are supported.
179
- Cross-kind casting is undefined and may vary across implementations.
180
- Downcasting is disallowed.
177
+
178
+ The resulting columns will have the dtype corresponding to the
179
+ Array API one:
180
+
181
+ - 'bool' -> Bool()
182
+ - 'int8' -> Int8()
183
+ - 'int16' -> Int16()
184
+ - 'int32' -> Int32()
185
+ - 'int64' -> Int64()
186
+ - 'uint8' -> UInt8()
187
+ - 'uint16' -> UInt16()
188
+ - 'uint32' -> UInt32()
189
+ - 'uint64' -> UInt64()
190
+ - 'float32' -> Float32()
191
+ - 'float64' -> Float64()
181
192
182
193
Parameters
183
194
----------
184
195
array : array
185
196
array-API compliant 2D array
186
- dtypes : Mapping[str, DType]
187
- Dtype of each column. Must be the same length as ``array.shape[1]``.
188
- Keys determine column names.
197
+ names : Sequence[str]
198
+ Names to give columns.
189
199
190
200
Returns
191
201
-------
0 commit comments