Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /pfun-health_pfun-cma-model /pfun_cma_model /data.py
| from pathlib import Path | |
| import pandas as pd | |
| from pfun_cma_model.engine.data_utils import format_data | |
| from pfun_cma_model.misc.pathdefs import PFunDataPaths | |
| __all__ = [ | |
| "format_data", | |
| "PFunDataPaths", | |
| "read_sample_data", | |
| ] | |
| def read_sample_data(convert2json: bool) -> pd.DataFrame | str: | |
| """Read the sample dataset from the PFunDataPaths. | |
| Args: | |
| convert2json (bool): If True, convert the DataFrame to JSON string format. | |
| Returns: | |
| pd.DataFrame or str: The sample dataset as a DataFrame or JSON string. | |
| Example: | |
| >>> df = read_sample_data() | |
| >>> print(df.head()) | |
| """ | |
| df = PFunDataPaths().read_sample_data() | |
| if convert2json is False: | |
| return df | |
| return df.to_json(orient="records") | |
Xet Storage Details
- Size:
- 766 Bytes
- Xet hash:
- 48f20e23594aafcb392481d259d62c97217d4c3675ebb33713da90f4f18bb6ca
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.