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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file pandas-visual-analysis-0.0.4.tar.gz.

File metadata

  • Download URL: pandas-visual-analysis-0.0.4.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.12

File hashes

Hashes for pandas-visual-analysis-0.0.4.tar.gz
Algorithm Hash digest
SHA256 a42cae09c755fa1da55716f5e405d9344fb6ada5bcdd911067260ef54343681c
MD5 3875289f4fd9e054b155885e511e5753
BLAKE2b-256 523353d5cb5e384b39890ea61ac050b1b567d0c90153f2f439846e29d8657d46

See more details on using hashes here.

File details

Details for the file pandas_visual_analysis-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: pandas_visual_analysis-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.12

File hashes

Hashes for pandas_visual_analysis-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5004cce06062ad29d25b2bbb3376f16d6c8d5b8a505c519cab9928e34ab41da5
MD5 5b416112b2a603c571723e9355866e21
BLAKE2b-256 d53ae91c3df844cabb7807598ee6499447d3d6a440adf48caed5042a6b3f4a07

See more details on using hashes here.

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