pastas.dataset.load_dataset#
- pastas.dataset.load_dataset(name: str) pandas.DataFrame | dict[str, pandas.DataFrame]#
Load csv-files from a subfolder in the pastas dataset repository on GitHub.
- Parameters:
name (str) – The name of the subfolder, i.e., collenteur_2023. For a list of available datasets, see the pastas-data repository on GitHub (www.github.com/pastas/pastas-data).
- Returns:
The loaded dataset(s). If one csv file is found, returns a pandas DataFrame. If multiple csv files are found, returns a dictionary with file names as keys and dataframes as values.
- Return type:
- Raises:
Exception – If the request status code is not 200 (OK), an exception is raised. This:
is likely due to an invalid folder name. Check the pastas-data repository on GitHub –
for available datasets. –
Examples
>>> ps.load_dataset("collenteur_2021") Returns the dataset from the "collenteur_2021" subfolder as a pandas DataFrame.
>>> ps.load_dataset("collenteur_2023") Returns a dictionary with datasets from the "collenteur_2023" subfolder. The keys are the file names and the values are pandas DataFrames.