File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 15
15
}
16
16
17
17
18
- def get_data_home () :
18
+ def _get_data_home () -> pathlib . PosixPath :
19
19
"""Return the path of the data directory"""
20
20
return pathlib .Path (cp .__file__ ).parents [1 ] / "causalpy" / "data"
21
21
22
22
23
- def load_data (dataset : str = None ):
23
+ def load_data (dataset : str = None ) -> pd .DataFrame :
24
+ """Loads the requested dataset and returns a pandas DataFrame.
25
+
26
+ :param dataset: The desired dataset to load
27
+ """
24
28
25
29
if dataset in DATASETS :
26
30
27
- data_dir = get_data_home ()
31
+ data_dir = _get_data_home ()
28
32
datafile = DATASETS [dataset ]
29
33
file_path = data_dir / datafile ["filename" ]
30
34
return pd .read_csv (file_path )
Original file line number Diff line number Diff line change
1
+ :mod: `causalpy.data.datasets `
2
+ =============================
3
+
4
+ .. toctree ::
5
+ :maxdepth: 1
6
+
7
+ .. automodule :: causalpy.data.datasets
8
+ :members:
9
+ :undoc-members:
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ Documentation outline
113
113
api_pymc_experiments
114
114
api_pymc_models
115
115
api_plot_utils
116
+ api_datasets
116
117
117
118
118
119
Index
You can’t perform that action at this time.
0 commit comments