Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Choosing and changing a kernel

Learning goals

Selecting a kernel

In JupyterLab, the active kernel is shown near the top-right of an open notebook. You can select or change it by clicking the kernel name. You can also use the Kernel menu and choose Change Kernel…. kernel1

The exact list you see depends on the kernels available in your Jupyter4NFDI environment. image

Suppose you create a variable in Python:

message = "hello"
print(message)

If you then change the notebook to an R kernel, the notebook cells and their existing outputs remain visible, but the new R kernel does not know about the Python variable message.

You would also need to use R syntax in newly executed cells, for example:

message <- "hello"
print(message)

When you switch kernel languages:

Note Changing a Python notebook to use an R kernel does not automatically convert Python code into R. The notebook file remains the same, but code cells must contain syntax understood by the selected kernel.