to_hdf¶
-
hhpy.main.to_hdf(df: pandas.core.frame.DataFrame, file: str, groupby: Union[str, List[str]] = None, key: str = None, replace: bool = False, do_print=True, **kwargs) → None[source]¶ saves a pandas DataFrame as h5 file, if groupby is supplied will save each group with a different key. Needs with groupby OR key to be supplied. Extends on pandas.DataFrame.to_hdf.
Parameters: - df – DataFrame to save
- file – filename to save the DataFrame as
- groupby – if supplied will save each sub-DataFrame as a different key. [optional]
- key – The key to write as. Ignored if groupby is supplies.
- replace – Whether to replace or append to existing files. Defaults to append. [optional]
- do_print – Whether to print intermediate steps to console [optional]
- kwargs – Other keyword arguments passed to pd.DataFrame.to_hdf [optional]
Returns: None