Roo
Roo

Reputation: 902

How to find indentation level in Jupyter notebook?

I am using Jupyter notebook and I have multiple loops, functions, and so on and each add one level of indentation. Sometimes I want to add a piece of code not to the last block but a few block/frame higher.

In the text editors like notebook++ there is a vertical line that determines the indentation level. Is there the same feature in Jupyter notebook?

enter image description here

Upvotes: 5

Views: 4878

Answers (1)

FaCoffee
FaCoffee

Reputation: 7909

I would really benefit from something like this, especially when the code block gets rather long. As far as I know, there is no such thing in Jupyter, unfortunately. I was told on GitHub that the Spyder release planned for Q4 2017 would have included this, but I haven't seen it so far (Q1 2018).

If you really need to run your code on Jupyter and want to check the indentation levels, I would suggest writing your code in yhat Rodeo, check the indentation levels, and then paste your code back to Jupyter.

This is a cumbersome workaround, but at the moment it is the best thing I know that would work.

EDIT

VS Code, the free Microsoft IDE, is a valid alternative to yhat Rodeo.

Upvotes: 4

Related Questions