training_classical_control.nb_utils#

Module Contents#

Classes#

TflWorkshopMagic

Functions#

set_random_seed

Sets random seed (as name suggests…).

display_dataframes_side_by_side

Display pandas dataframes side by side in a jupyter notebook.

display_array

Displays numpy arrays as latex bmatrix.

show_video

Renders the given frames as a video.

Data#

__all__

API#

training_classical_control.nb_utils.__all__#

[‘set_random_seed’, ‘TflWorkshopMagic’, ‘display_dataframes_side_by_side’, ‘display_array’, ‘show_vi…

training_classical_control.nb_utils.set_random_seed(seed: int = 16) None[source]#

Sets random seed (as name suggests…).

class training_classical_control.nb_utils.TflWorkshopMagic(shell)[source]#

Bases: IPython.core.magic.Magics

set_random_seed(seed: str)[source]#
load_latex_macros(line)[source]#
view_hint(path: os.PathLike)[source]#
presentation_style(style_file: str)[source]#

Apply the styles to the notebook (outside presentation mode). NOTE: Has to be the last command in a cell.

:param style_file: Relative path to the CSS file containing the style that will be applied to the notebook cells. Defaults to rise.css

training_classical_control.nb_utils.display_dataframes_side_by_side(dataframes: collections.abc.Sequence[pandas.DataFrame], captions: collections.abc.Sequence = ())[source]#

Display pandas dataframes side by side in a jupyter notebook.

Inspired by: https://stackoverflow.com/a/64323280

training_classical_control.nb_utils.display_array(name: str, array: numpy.typing.NDArray) None[source]#

Displays numpy arrays as latex bmatrix.

training_classical_control.nb_utils.show_video(frames: list[numpy.typing.NDArray], fps: float, *, title: str | None = None, **kwargs: Any) None[source]#

Renders the given frames as a video.

If no frames are passed, then it simply returns without doing anything.