Automatic cell execution timing in jupyter lab

Requirement JupyterLab >= 2.0.2 Let’s move step by step Extension available for JupyterLab is jupyterlab-execute-time First enable Extension Manager After enabling you see new button in side task bar at the end “Extension Manager” You can also enable it with the following steps: Go into advanced settings editor. Open the Extension Manager section. Add the … Read more

Plotly chart not showing in Jupyter notebook

You need to change init_notebook_mode call and remove connected=True, if you want to work in offline mode. Such that: # Import the necessaries libraries import plotly.offline as pyo import plotly.graph_objs as go # Set notebook mode to work in offline pyo.init_notebook_mode() # Create traces trace0 = go.Scatter( x=[1, 2, 3, 4], y=[10, 15, 13, 17] … Read more

How to run a single line or selected code in a Jupyter Notebook or JupyterLab cell?

Updated answer As there have been a few updates of JupyterLab since my first answer (I’m now on 1.1.4), and it has been stated that JupyterLab 1.0 will eventually replace the classic Jupyter Notebook, here’s what I think is the best approach right now and even more so in the time to come: In JupyterLab … Read more

printing bold, colored, etc., text in ipython qtconsole

In Jupyter Notebooks, one clean way of solving this problem is using markdown: from IPython.display import Markdown, display def printmd(string): display(Markdown(string)) And then do something like: printmd(“**bold text**”) Of course, this is great for bold, italics, etc., but markdown itself does not implement color. However, you can place html in your markdown, and get something … Read more

Reconnecting remote Jupyter Notebook and get current cell output

This is a long-running missing feature in jupyter notebooks. I use a near-identical setup: my notebook runs inside a tmux session in a remote server, and I use it locally with ssh tunneling. Before doing any work, I run the following snippet in the first cell: import sys import logging nblog = open(“nb.log”, “a+”) sys.stdout.echo … Read more

Jupyter Notebooks not displaying progress bars

The answer is in this GitHub issue. The key is to ensure that you have the ipywidgets notebook extension enabled using the following command: jupyter nbextension enable –py widgetsnbextension For the old JupyterLab 2.0 you’ll also need to install the JupyterLab extension: jupyter labextension install @jupyter-widgets/jupyterlab-manager For the old JupyterLab 2.0 installing the JupyterLab extension … Read more