Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get similar functionality to RStudio in PyCharm

I normally use RStudio to do data science work. I load the datasets, and then write and try new code line by line, changing parameters, exploring the data, and executing small chunks at a time. I'm currently using PyCharm for a project in Python, and it seems to be geared to software development, running and debugging entire scripts from start to finish, which is incredibly slow and frustrating when used to the RStudio mode.

Is it possible to have a similar data science environment to RStudio is it better to change tool to something else?

like image 530
Strabonio Avatar asked Nov 15 '25 23:11

Strabonio


2 Answers

If you want to run code line-by-line you could try this plugin: https://plugins.jetbrains.com/plugin/11945-python-smart-execute.

If you want to change the default hotkey from "Ctrl+Shift+A" to default RStudio "Ctrl + Enter" you could do that here.

Also, here's a ticket about merging the plugin into PyCharm: https://youtrack.jetbrains.com/issue/PY-38919.

like image 150
Vladimir Koshelev Avatar answered Nov 18 '25 13:11

Vladimir Koshelev


You can enable "Scientific Mode" in PyCharm. In this mode all code is executed inside the same interactive Python Console, all plots and tabular data are shown in a separate panel, there is a separate panel with Documentation. Also it supports code cells execution (code blocks inside *.py file separated by #%%), current line/file execution in Python Console (available in the context menu in the editor).

The full description is available here: https://www.jetbrains.com/help/pycharm/matplotlib-support.html

like image 32
Elizaveta Shashkova Avatar answered Nov 18 '25 13:11

Elizaveta Shashkova