QuokkaContext.from_polars
Create a DataStream from a polars DataFrame. The DataFrame will be materialized. If you don't know what this means, don't worry about it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df |
Polars DataFrame
|
The polars DataFrame to create the DataStream from. |
required |
Returns:
Name | Type | Description |
---|---|---|
DataStream | The DataStream created from the polars DataFrame. |
Examples:
>>> import polars as pl
>>> from pyquokka.df import QuokkaContext
>>> qc = QuokkaContext()
>>> df = pl.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
>>> stream = qc.from_polars(df)
>>> stream.count()
Source code in pyquokka/df.py
694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 |
|