pybmds Recipes

The examples below describe some key capabilities of pybmds.

Modeling

Data Manipulation

Jupyter Notebooks

Recipes are written using Jupyter notebooks. There are many excellent tutorials online describing how to use Jupyter notebooks and this is beyond the scope of pybmds. However, a few tips are described below for new Jupyter users.

Rendering figures

The built-in plotting functionality of pybmds uses matplotlib. To render matplotlib figures within a Jupyter notebook, add this line to the top of the notebook:

%matplotlib inline

After running this cell, matplotlib figures will appear inline after execution, if it is the final output in a cell. For more information, see this summary from Stack Overflow.

Displaying extra output

By default, notebook cells only display the last output of the code that is executed in them, and anything that is printed to standard out (for example anything using the print() function). You can also display content at any time in a cell by using the display method. This will allow you to show plots or text in the middle of loops, or show multiple outputs from a single cell. We utilize this function in some recipes.

from IPython.display import display

display(...)

Anything that is passed to this function will be shown after the cell is executed.