fsspec_utils.utils.types
API Reference¶
dict_to_dataframe()
¶
Convert a dictionary or list of dictionaries to a Polars DataFrame.
Handles various input formats: - Single dict with list values -> DataFrame rows - Single dict with scalar values -> Single row DataFrame - List of dicts with scalar values -> Multi-row DataFrame - List of dicts with list values -> DataFrame with list columns
Parameters:
Name | Type | Description |
---|---|---|
data |
dict or list[dict] |
The input data, either a dictionary or a list of dictionaries. |
unique |
bool |
If True, duplicate rows will be removed from the resulting DataFrame. |
Returns:
polars.DataFrame
: Polars DataFrame containing the converted data.
Examples:
to_pyarrow_table()
¶
Convert various data formats to PyArrow Table.
Handles conversion from Polars DataFrames, Pandas DataFrames, dictionaries, and lists of these types to PyArrow Tables.
Parameters:
Name | Type | Description |
---|---|---|
data |
Any |
Input data to convert. |
concat |
bool |
Whether to concatenate multiple inputs into single table. |
unique |
bool |
If True, duplicate rows will be removed from the resulting Table. |
Example:
Returns:
pyarrow.Table
: PyArrow Table containing the converted data.
Example: