I was wondering is there is a good and comprehensive way to debug python code step by step so that I can have a better idea of all the variables involved, their dimensions and values?
What can be done to do step-by-step debugging?
I was wondering is there is a good and comprehensive way to debug python code step by step so that I can have a better idea of all the variables involved, their dimensions and values?
What can be done to do step-by-step debugging?
JupyterLab is the current generation of Jupyter interface and has a debugger mode that allows you to step through code. See this post here and a related one here.
Documentation is here.
You can try it out without installing anything on your own system by clicking here to launch a temporary Jupyter session running on a remote computer via the MyBinder service, and then open a new notebook file from the launcher. You can step the sections 'Debug code in notebook' and 'Explore the code state' there in the documentation.
For %%debug
, which is from IPython that Jupyter inherits much from, see here and other posts in that thread.
%debug
? any docs for this? –
Puissant vs code has a really good support of Jupyter notebooks. You can debug within the cell and go through cell contents line by line while looking at the variables in real-time. It also has a variable explorer that you can use to check your variables. You can also select the Python interpreter (from python venv or conda).
Just open any *.ipynb
file in vs code and it will suggest you to install multiple extensions (e.g., Jupyter-related extensions) to work effectively with this. Even for the variable explorer, there are multiple extensions that can help you summarize your data on the go without any additional coding.
© 2022 - 2024 — McMap. All rights reserved.