Skip to main content

A package for interactive visual analysis in Jupyter notebooks.

Project description

banner

Status

https://github.com/meffmadd/pandas-visual-analysis/workflows/Tests/badge.svg Documentation Status https://codecov.io/gh/meffmadd/pandas-visual-analysis/branch/master/graph/badge.svg MIT License

Release

PyPI Conda PyPI - Python Version

Code

Codacy Badge Maintainability https://img.shields.io/badge/code%20style-black-000000.svg GitHub code size in bytes


Generates an interactive visual analysis widget to analyze a pandas DataFrame in Jupyter notebooks. It can display various different types of graphs with support for linked-brushing in interactive widgets. This allows data exploration and cognition to be simple, even with complex multivariate datasets.

There is no need to create and style plots or interactivity - its all ready without any configuration.


interactivity

Installation

Using pip

To install this package with pip run:

pip install pandas-visual-analysis

Using conda

To install this package with conda run:

conda install -c meffmadd pandas-visual-analysis

From Source

To install this package from source, clone into the repository or download the zip file and run:

python setup.py install

Usage

Basic Usage

Having a DataFrame, for example:

import pandas as pd
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
url = "https://raw.githubusercontent.com/mwaskom/seaborn-data/master/mpg.csv"

df = pd.read_csv(url)

you can just pass it to VisualAnalysis to display the default layout:

from pandas_visual_analysis import VisualAnalysis
VisualAnalysis(df)

If you want to specify which columns of the DataFrame are categorical, just pass the categorical_columns option:

from pandas_visual_analysis import VisualAnalysis
categorical = ["name", "origin", "model_year", "cylinders"]
VisualAnalysis(df, categorical_columns=categorical)

Selection Types


selection types

By default a new selection replaces the old selection, however, it is also possible to add data points to the existing selection by selecting the Additive selection type. By choosing the Subtractive selection newly selected data points are removed from the selection.

Using DataSource

Instead of passing the DataFrame object directly to VisualAnalysis it is possible to use a DataSource object. This enables linked-brushing across multiple notebook cells if the object is used across cells.

from pandas_visual_analysis import VisualAnalysis, DataSource

data = DataSource(df)
VisualAnalysis(data)

Later you can create a new analysis with the brushing still preserved simply by using the same data object created earlier.

VisualAnalysis(data)

Using Layouts

If you want to specify your own layout, you can do that by passing the layout parameter. The parameter is a list of rows, where each row is in turn a list specifying the Widgets in that row.

from pandas_visual_analysis import VisualAnalysis

VisualAnalysis(df,
    layout=[["Scatter", "Scatter"],
            ["ParallelCoordinates"]]
)

Here, two scatter plots will share the first row while the second row only contains a parallel coordinates plot. In order to see all the possible options you can call the widgets class-method of VisualAnalysis.

VisualAnalysis.widgets()

This outputs the following list of possible plots:

['Scatter',
 'ParallelCoordinates',
 'BrushSummary',
 'Histogram',
 'ParallelCategories',
 'BoxPlot']

Any of those can be part of the layout specification. See also: widgets Documentation.

For more advanced features of the VisualAnalysis class see: VisualAnalysis Documentation

Documentation

For more details see the Official Documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandas-visual-analysis-0.0.4.tar.gz (24.3 kB view hashes)

Uploaded Source

Built Distribution

pandas_visual_analysis-0.0.4-py3-none-any.whl (34.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page