PyCharm 2020.2 Help

Scientific mode

Scientific mode in PyCharm provides support for interactive scientific computing and data visualization. To enable the mode use one of the following ways

  • From the main menu, select View | Scientific mode.

  • In your code, add an import statement for numpy. PyCharm shows the banner that suggests you to enable the Scientific mode:

    Enable the scientific view

    Click the Use scientific mode link on the banner.

User interface in the scientific mode

With this mode enabled, the following changes are introduced to the UI:

The project opened with the Scientific mode enabled
  • The SciView tool window appears. It has two tabs to preview data frames in the Data tab and matplotlib charts in the Plots tab.

  • Python console is shown.

  • The Documentation tool window appears (a pinned version of the Quick Documentation popup), showing the inline documentation for the symbol at caret:

In the Scientific mode you can format your code as a set of executable cells to run each separately. To split your code into cells just add # %% lines where appropriate.

Executable code cells

Scientific project

You can get all the Scientific mode settings predefined by choosing the corresponding project type in the New Project wizard.

creating a new scientific project in PyCharm

When choosing the Scientific project type, you need to ensure that you have Conda interpreter installed. Once this is done, all you need is to specify the project name. You can also alter the name of the data folder if needed.

Note that to work with Matplotlib, Numpy, or or Pandas, you need to install these packages on your Python interpreter.

Analyzing data

When you preview variable in the Python Console, you can click DataFrame or Array links to view these types in the Data tab of the SciView tool window.

Viewing data frames

Building matplotlib charts

In the Scientific mode, a graph opens in its own tab in the SciView window, allowing you to resize it, zoom in and out, and so on. You can alter this behavior by toggling the Show plots in tool window checkbox (Settings/Preferences | Tools | Python Scientific).

Matplotlib debuggin

When stopping on a breakpoint, a tab appears in the SciView with the graph being debugged. See the Debug section of the Scientific Mode tutorial.

Matplotlib is available also in console. See the Running in console section of the Scientific Mode tutorial. When starting a Python console (Tools | Python Console...), one can import Matplotlib, and build graphs as required:

building graphs with matplotlib

The Python console is accessible for further inputs.

Last modified: 23 June 2020