Skip to content

Commit

Permalink
documentation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
percygautam committed Aug 12, 2020
1 parent c78c2ad commit 19ac99a
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions arviz/data/inference_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,24 @@ def stack(
Examples
--------
Use ``stack`` to stack any number of existing dimensions into a single new dimension. We first check the
original object:
Use ``stack`` to stack any number of existing dimensions into a single new dimension.
We first check the original object:
.. ipython::
In [1]: import arviz as az
...: idata = az.load_arviz_data("rugby")
...: idata
In order to stack two dimensions ``chain`` and ``draw`` to ``sample``, we can use:
.. ipython::
In [1]: idata.stack(sample=["chain", "draw"], inplace=True)
...: idata
We can also take the example of custom InferenceData object and perform stacking. We first
check the original object:
.. ipython::
Expand Down

0 comments on commit 19ac99a

Please sign in to comment.