NB! Scientific mode only available in Pro version of PyCharm.
Started wondering how do i execute Jupyter style of cell codes in PyCharm and found out you can make executable cells in PyCharm by enabling Scientific mode.
You can enable Scientific Mode from View –> Scientific Mode.
Cell model enables code execution by cell so you can run python code in order and small portions. As example importing .csv dataset and teaching dataset to machine learning mode in small portions.. Instead of every time you execute your whole code starting from scratch and waiting to import .csv file and teaching model again. Portion of code can be executed from small green arrow or CTRL+ENTER.
New executable cells can be created in .ipynb and .py files with “#%%” that adds automatic cell reference and “# In:” that manually adds cell reference. Numbered cells just reference to previous cells with lower numbers. Green arrow executes codes in order inside Python console as show in image below.
Jupyter notebook support
If you want to get more features like cell debug mode or Jupyter shortcuts for executing and creating new cells, you can install Jupyter package for PyCharm and run Jupyter server or Docker container and start using .ipynb files.
Jupyter notebook mode enables automatically while using .ipynb file and has different console with visualizations enabled.
Some example code in project Github: https://github.com/Dunttus/AI-Project/blob/master/testing/ssh_login_tests/train_ssh_events.py
What is “# In[num]:”: https://stackoverflow.com/questions/48737788/what-does-innum-mean-in-jupyter-notebooks
PyCharm scientific mode: https://youtu.be/46RjXawJQgg