Framework for Python

Data

data_save()

Save a DataFrame and record its hash.

Usage

data_save(
    data: pd.DataFrame,
    path: str,
    type: str | None = None,
    delimiter: str = 'comma',
    locked: bool = True,
    force: bool = False,
) -> pd.DataFrame

Arguments

Name Type Default Description
data required pd.DataFrame

The data to save.

path required str

A catalog name such as "inputs.intermediate.cleaned" or a file path ending in .csv or .parquet. A name's leading parts select a folder from directories: the longest run that names a key, such as inputs_intermediate or inputs_private_raw. The rest becomes the file name. A name is also added to the data catalog, so data_read() finds it.

type str | None None

"parquet" or "csv". Default: from the file extension, or Parquet for a catalog name.

delimiter str 'comma'

Delimiter for CSV files: comma, tab, semicolon, or space.

locked bool True

Whether later reads must find the file unchanged.

force bool False

Create the folder if it does not exist.

Value

data, so the call can end a pipeline.