PyCharm 2017.3 Help

Viewing as Array or DataFrame

Limitations

This command is available for:

Hence, NumPy and/or pandas must be downloaded and installed in your Python interpreter.

Viewing as array or DataFrame

To use the command View as Array/View as DataFrame, follow these steps:

  1. Launch the debugger session.
  2. In the Variables tab of the Debug tool window, select an array or a DataFrame.
  3. Click a link View as Array/View as DataFrame to the right.
    py view as array

    Alternatively, you can choose View as Array or View as DataFrame on the context menu.

    The Data View tool window appears.

One can also use the command View as Array from the Python console.

To view as array from the Python Console, follow these steps:

  1. Launch the Python Console.
  2. Execute a Python code, for example:
    import pandas as pd import numpy as np array = np.random.random((36, 36)) array1 = np.random.random((36, 10)) df = pd.DataFrame(array) df2 = pd.DataFrame(array1) print("Put breakpoint here") df[0][0] = 1 print("The End")
  3. In the toolbar of the console, click show watches. The variables declared in the console, appear to the right.
  4. Do one of the following:
    • Click the link View as Array/View as DataFrame:
      py view as array from console link
    • On the context menu of a variable, choose View as Array/ View as DataFrame:
      py view as array from console

Actions available via the Data View tool window

In the Data View tool window, one can do the following:

  • Change the format of presentation. For example, if in the Format field one specifies %.5f, then 5 digits will appear after dot; if one specifies %.2f, the presentation of the data will change to showing 2 digits after dot. See Python documentation for details.
  • Close the viewer tab by clicking close1, and open a new one by clicking add.
  • Make the presentation black-and-white in the new tabs by clearing the check-command Colored by Default that appears in the drop-down menu cogwheel black with arrow. If this command is cleared, and a new DataFrame/array is opened, then the new presentation will be colorless.
  • It's possible to change from the colored to colorless modes for the current tab by right-clicking a tab and selecting the check-command Colored:
    py view as array colorless
  • Resize columns using the double-headed arrow double headed arrow icon:
    py data frame tw

Data View is a tool window, and as such, it inherits all the behaviors that are common to all the tool windows. Refer to the section Working with Tool Windows to learn more.

Last modified: 28 March 2018

See Also