You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/case_studies/index.rst
+23-31Lines changed: 23 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,53 +4,45 @@
4
4
Case Studies
5
5
===================
6
6
7
-
.. panels::
7
+
.. grid:: 1 2 2 2
8
+
:gutter: 4
8
9
9
-
**Interval manipulation**
10
+
.. grid-item-card:: Interval manipulation
10
11
11
-
This tutorial introduces the use of :mod:`staircase` for manipulating intervals. The ideas demonstrated form the basis for `the piso package <https://piso.readthedocs.io>`_.
12
+
This tutorial introduces the use of :mod:`staircase` for manipulating intervals. The ideas demonstrated form the basis for `the piso package <https://piso.readthedocs.io>`_.
12
13
13
-
.. link-button:: intervals
14
-
:type: ref
15
-
:text:
16
-
:classes: stretched-link
17
14
18
-
---
15
+
.. button-ref:: casestudies.intervals
16
+
:ref-type: ref
17
+
:class: stretched-link
19
18
20
-
**Queue analysis**
19
+
.. grid-item-card:: Queue analysis
21
20
22
-
This case study illustrates the use of :mod:`staircase` for queue analysis, including the exploration of the queue size distribution.
21
+
This case study illustrates the use of :mod:`staircase` for queue analysis, including the exploration of the queue size distribution.
23
22
24
-
.. link-button:: queues
25
-
:type: ref
26
-
:text:
27
-
:classes: stretched-link
23
+
.. button-ref:: casestudies.queues
24
+
:ref-type: ref
25
+
:class: stretched-link
28
26
29
-
---
30
27
31
-
**Asset utilisation**
28
+
.. grid-item-card:: Asset utilisationn
32
29
33
-
This case study demonstrates the use of :mod:`staircase` for quick calculation of asset utilisation over various time periods.
30
+
This case study demonstrates the use of :mod:`staircase` for quick calculation of asset utilisation over various time periods.
34
31
35
-
.. link-button:: utilisation
36
-
:type: ref
37
-
:text:
38
-
:classes: stretched-link
32
+
.. button-ref:: casestudies.utilisation
33
+
:ref-type: ref
34
+
:class: stretched-link
39
35
36
+
.. grid-item-card:: Data leakage
40
37
41
-
---
38
+
This case study shows how :mod:`staircase` can be used to simplify feature engineering, for machine learning models, while avoiding *data leakage*.
42
39
43
-
**Data leakage**
40
+
.. button-ref:: casestudies.dataleakage
41
+
:ref-type: ref
42
+
:class: stretched-link
44
43
45
-
This case study shows how :mod:`staircase` can be used to simplify feature engineering, for machine learning models, while avoiding *data leakage*.
Copy file name to clipboardExpand all lines: docs/case_studies/utilisation.rst
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,21 +21,21 @@ We begin by importing the asset data into a :class:`pandas.DataFrame` instance.
21
21
import pandas as pd
22
22
import staircase as sc
23
23
24
-
data = pd.read_csv(asset_data, parse_dates=['start', 'end'], dayfirst=True)
24
+
data = pd.read_csv(asset_data, parse_dates=['start', 'end'])
25
25
data
26
26
27
27
For the analysis we would like a :class:`staircase.Stairs` object for each asset. Each Stairs object will represent a step function which has a value of zero, when the asset is not in use, and a value of one when the asset is in use. We can pandas' groupby process (`"split-apply-combine" <https://pandas.pydata.org/docs/user_guide/groupby.html>`_) with the :class:`staircase.Stairs` constructor method to get a :class:`pandas.Series`, indexed by asset name, with :class:`staircase.Stairs` values:
Note that since we want to examine 2020 we clip the step function at the year endpoints, making the functions undefined for any time outside of 2020 (see :ref:`user_guide.gotchas` for why this is a good idea). :meth:`pandas.Series.apply` is used here, rather than looping, for efficiency.
We can access an individual :class:`staircase.Stairs` object with the corresponding asset name. For example, to plot the step function corresponding to asset Z, for the first day:
0 commit comments