pyflink.dataframe.convert.from_dict#
- from_dict(data: Mapping[str, Sequence[Any]], schema: List[str] | None = None) DataFrame[source]#
Create a DataFrame from a dictionary of sequences.
- Parameters:
data – A dictionary where keys are column names and values are sequences of column values. All sequences must have the same length.
schema – Optional list of column names. If provided, only these columns will be used, in this order. If None, uses all keys from data.
- Returns:
A new DataFrame.
- Example::
>>> import pyflink.dataframe as pf >>> df = pf.from_dict({"a": [1, 2, 3], "b": ["x", "y", "z"]})