/PandasDataFrameGUI

A minimalistic GUI for analyzing Pandas DataFrames.

Primary LanguagePythonMIT LicenseMIT

Pandas DataFrame GUI

A minimalistic GUI for analyzing Pandas DataFrames based on wxPython.

Usage

import dfgui
dfgui.show(df)

Features

  • Tabular view of data frame
  • Columns are sortable (by clicking column header)
  • Columns can be enabled/disabled (left click on 'Columns' tab)
  • Columns can be rearranged (right click drag on 'Columns' tab)
  • Generic filtering: Write arbitrary Python expression to filter rows. Warning: Uses Python's eval -- use with care.
  • Histogram plots
  • Scatter plots

Demo & Docs

The default view: Nothing fancy, just scrolling and sorting. The value of cell can be copied to clipboard by right clicking on a cell.

screen1

The column selection view: Left clicking enables or disables a column in the data frame view. Columns can be dragged with a right click to rearrange them.

screen2

The filter view: Allows to write arbitrary Pandas selection expressions. The syntax is: An underscore _ will be replaced by the corresponding data frame column. That is, setting the combo box to a column named "A" and adding the condition _ == 1 would result in an expression like df[df["A"] == 1, :]. The following example filters the data frame to rows which have the value 669944 in column "UserID" and datetime.date value between 2016-01-01 and 2016-03-01.

screen3

Histogram view:

screen4

Scatter plot view:

screen5

Requirements

Since wxPython is not pip-installable, dfgui does not handle dependencies automatically. You have to make sure the following packages are installed:

  • pandas/numpy
  • matplotlib
  • wx

Installation Instructions

I haven't submitted dfgui to PyPI (yet), but you can install directly from git (having met all requirements). For instance:

pip install git+https://github.com/bluenote10/PandasDataFrameGUI

or if you prefer a regular git clone:

git clone git@github.com:bluenote10/PandasDataFrameGUI.git dfgui
cd dfgui
pip install -e .
# and to check if everything works:
./demo.py

In fact, dfgui only consists of a single module, so you might as well just download the file dfgui/dfgui.py.

Anaconda/Windows Instructions

Install wxpython through conda or the Anaconda GUI.

"Open terminal" in the Anaconda GUI environment.

git clone "https://github.com/bluenote10/PandasDataFrameGUI.git"
cd dfgui
pip install -e .
conda package --pkg-name=dfgui --pkg-version=0.1 # this should create a package file
conda install --offline dfgui-0.1-py27_0.tar.bz2 # this should install into your conda environment

Then restart your Jupyter kernel.