diive.to_diive_format¶
- diive.to_diive_format(data, timestamp_name=None)[source]¶
Coerce a DataFrame to the diive parquet format.
Ensures the data follows the diive convention:
One header row: MultiIndex columns are flattened to their top level so there is a single level of column names.
Named timestamp index: the index name must be one of
'TIMESTAMP_END','TIMESTAMP_MIDDLE'or'TIMESTAMP_START'(indicating what the timestamp marks). Passtimestamp_nameto set it; otherwise the existing index name is validated.
- Parameters:
- Return type:
- Returns:
A (possibly copied) DataFrame in diive format.
- Raises:
ValueError – If no valid timestamp index name is available.