Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reformat ipynb code on Pycharm?

I know that "ctrl+alt+shift+L" is the 'reformat files' shortcut in Pycharm.

I can reformat .py code using the above shortcut, but I can not reformat .ipynb files.

When I open the reformat files tool and run it, it does not produce any changes.

How can I reformat ipynb code on Pycharm?

reformat file window

like image 799
OoO Avatar asked Oct 13 '25 03:10

OoO


1 Answers

I met the same problem.

In fact, in PyCharm 2018.3.6, the code reformat function worked in ipynb files. But in PyCharm 2019.3.3, the UI of jupyter notebook changed. And the code reformat function could not work.

Now I have to use the jupyter note book extension in browser to reformat my code.

It seems like a bug of PyCharm. Other person have met this problem. https://towardsdatascience.com/jupyter-notebooks-in-the-ide-visual-studio-code-versus-pycharm-5e72218eb3e8

like image 161
Dragon Yu Avatar answered Oct 15 '25 09:10

Dragon Yu