Skip to content

Commit

Permalink
fix(datasets): add save_dataframe method
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Jun 23, 2023
1 parent ee4a166 commit 9633738
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/hyfi/main/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,31 @@ def load_dataframe(
data_file, data_dir, filetype, columns, index_col, verbose, **kwargs
)

@staticmethod
def save_dataframe(
data: pd.DataFrame,
data_file: str,
data_dir: str = "",
columns: Optional[Sequence[str]] = None,
index: bool = False,
filetype: str = "parquet",
suffix: str = "",
verbose: bool = False,
**kwargs,
):
"""Save data to a file"""
Datasets.save_dataframes(
data,
data_file,
data_dir,
columns,
index,
filetype,
suffix,
verbose,
**kwargs,
)

@staticmethod
def save_dataframes(
data: Union[pd.DataFrame, dict],
Expand Down

0 comments on commit 9633738

Please sign in to comment.