daft.from_pydict#
- from_pydict(data: Dict[str, Union[list, np.ndarray, pa.Array, pa.ChunkedArray]]) DataFrame [source]#
Creates a DataFrame from a Python dictionary.
Example
>>> import daft >>> df = daft.from_pydict({"foo": [1, 2]}) >>> df.show() ╭───────╮ │ foo │ │ --- │ │ Int64 │ ╞═══════╡ │ 1 │ ├╌╌╌╌╌╌╌┤ │ 2 │ ╰───────╯ (Showing first 2 of 2 rows)
- Parameters:
data – Key -> Sequence[item] of data. Each Key is created as a column, and must have a value that is a Python list, Numpy array or PyArrow array. Values must be equal in length across all keys.
- Returns:
DataFrame created from dictionary of columns
- Return type: