|
15 | 15 | "DataFrame",
|
16 | 16 | "Column",
|
17 | 17 | "column_from_sequence",
|
| 18 | + "column_from_1d_array", |
18 | 19 | "concat",
|
19 | 20 | "dataframe_from_dict",
|
| 21 | + "dataframe_from_2d_array", |
20 | 22 | "is_null",
|
21 | 23 | "null",
|
22 | 24 | "Int64",
|
@@ -105,6 +107,57 @@ def dataframe_from_dict(data: Mapping[str, Column[Any]]) -> DataFrame:
|
105 | 107 | """
|
106 | 108 | ...
|
107 | 109 |
|
| 110 | + |
| 111 | +def column_from_1d_array(array: Any, *, name: str, dtype: Any) -> Column[Any]: |
| 112 | + """ |
| 113 | + Construct Column from 1D array. |
| 114 | +
|
| 115 | + See `dataframe_from_2d_array` for related 2D function. |
| 116 | +
|
| 117 | + Only Array-API-compliant 1D arrays are supported. |
| 118 | + Cross-kind casting is undefined and may vary across implementations. |
| 119 | + Downcasting is disallowed. |
| 120 | +
|
| 121 | + Parameters |
| 122 | + ---------- |
| 123 | + array : array |
| 124 | + array-API compliant 1D array |
| 125 | + name : str |
| 126 | + Name to give columns. |
| 127 | + dtype : DType |
| 128 | + Dtype of column. |
| 129 | +
|
| 130 | + Returns |
| 131 | + ------- |
| 132 | + Column |
| 133 | + """ |
| 134 | + ... |
| 135 | + |
| 136 | +def dataframe_from_2d_array(array: Any, *, names: Sequence[str], dtypes: Mapping[str, Any]) -> DataFrame: |
| 137 | + """ |
| 138 | + Construct DataFrame from 2D array. |
| 139 | +
|
| 140 | + See `column_from_1d_array` for related 1D function. |
| 141 | +
|
| 142 | + Only Array-API-compliant 2D arrays are supported. |
| 143 | + Cross-kind casting is undefined and may vary across implementations. |
| 144 | + Downcasting is disallowed. |
| 145 | +
|
| 146 | + Parameters |
| 147 | + ---------- |
| 148 | + array : array |
| 149 | + array-API compliant 2D array |
| 150 | + names : Sequence[str] |
| 151 | + Names to give columns. Must be the same length as ``array.shape[1]``. |
| 152 | + dtypes : Mapping[str, DType] |
| 153 | + Dtype of each column. Must be the same length as ``array.shape[1]``. |
| 154 | +
|
| 155 | + Returns |
| 156 | + ------- |
| 157 | + DataFrame |
| 158 | + """ |
| 159 | + ... |
| 160 | + |
108 | 161 | class null:
|
109 | 162 | """
|
110 | 163 | A `null` object to represent missing data.
|
|
0 commit comments