Skip to content

rendner/py-plugin-dataframe-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

577 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python: Styled DataFrame Viewer

Note

PyCharm 2024.2.1 - 2024.3.x Users: If you're using PyCharm versions >= 2024.2.1 and < 2025.1, the Python debugger has string truncation bugs that prevent fetching DataFrame data. Please see the workaround documentation: WORKAROUND_PYCHARM_2024.2.1_TO_2025.1.md

Installation

What It Is

View, sort and filter DataFrames or a Python dict when debugging.

Note: The plugin requires one of the supported Python DataFrame libraries:

  • pandas
  • polars

preview of the plugin

Supported DataFrame Libraries

Features

How Does It Work

The plugin can be used to view DataFrames from a Debug Session or a Python Console.

Examples:

Example: Debug Session

Generate a DataFrame:

# code for pandas
import pandas as pd

df = pd.DataFrame.from_dict({"a": range(200), "b": range(100, 300), "c": range(200, 400)})

breakpoint()
# code for polars
import polars as pl

df = pl.from_dict({"a": range(200), "b": range(100, 300), "c": range(200, 400)})

breakpoint()

Run the code in debug mode in your JetBrains IDE. The program stops at the line with the breakpoint() command.

Select the Threads & Variables tab of the debugger (as seen in the screenshot below). Right-click on df to open the context menu. Select View as Styled DataFrame.

select view as action

This opens a new window which shows the DataFrame df:

DataFrame df

Example: Python Console

Enter the code to generate a DataFrame:

# code for pandas
import pandas as pd

df = pd.DataFrame.from_dict({"a": range(200), "b": range(100, 300), "c": range(200, 400)})
# code for polars
import polars as pl

df = pl.from_dict({"a": range(200), "b": range(100, 300), "c": range(200, 400)})

Right-click on df, in the variable view, to open the context menu. Select View as Styled DataFrame.

select view as action

This opens a new window which shows the DataFrame df:

DataFrame df

Packages

No packages published