Dataframe
matchlab.sources.dataframe
¶
Reading a source from a dataframe already in memory.
Classes:
-
DataFrame–A dataframe already in memory.
DataFrame
¶
Bases: Location
flowchart TD
matchlab.sources.dataframe.DataFrame[DataFrame]
matchlab.sources.base.Location[Location]
matchlab.sources.base.Location --> matchlab.sources.dataframe.DataFrame
click matchlab.sources.dataframe.DataFrame href "" "matchlab.sources.dataframe.DataFrame"
click matchlab.sources.base.Location href "" "matchlab.sources.base.Location"
A dataframe already in memory.
Methods:
-
read–Get this location's rows, in batches.
Attributes:
-
df(FromResources[DataFrameClass]) –The rows to read.
-
model_config–
model_config
class-attribute
instance-attribute
¶
read
¶
read(batch_size: int | None = None, rename: dict[str, str] | Callable | None = None, return_type: DataFrameType = POLARS, schema_overrides: dict[str, DataType] | None = None) -> Generator[DataFrameClass, None, None]
Get this location's rows, in batches.
Parameters:
-
(batch_size¶int | None, default:None) –The size used for internal batching.
-
(rename¶dict[str, str] | Callable | None, default:None) –Renaming to apply to the rows that come back.
- If a dictionary is provided, it will be used to rename the columns.
- If a callable is provided, it will take the old name as input and return the new name.
-
(return_type¶DataFrameType, default:POLARS) –The type of data to return. Defaults to "polars".
-
(schema_overrides¶dict[str, DataType] | None, default:None) –Types to force on the columns that come back, rather than letting the location infer them.