notebook

Module notebook

A module with helper functions for Jupyterlab notebooks.

npfc.notebook.display_image_table(imgs, max_img_per_row=4)[source]

Display a table filled with images.

Parameters
  • imgs (list) – an iterable containing images

  • max_img_per_row (int) – the maximum number of images per row

Return type

str

Returns

the HTML code for displaying the images in a table in Jupyterlab.

npfc.notebook.gallery(images, row_height='auto')[source]

Shows a set of images in a gallery that flexes with the width of the notebook.

This works only with PNG images.

Very strongly inspired after: https://mindtrove.info/

Parameters
  • images (list) – list of URLs, bytes or IPython.Display.Image objects to display.

  • row_height (str) – CSS height value to assign to all images. Set to ‘auto’ by default to show images with their native dimensions. Set to a value like ‘250px’ to make all rows in the gallery equal height.

Return type

str

Returns

the HTML code for displaying the gallery of images in Jupyterlab.