Graph theoretic scatterplot diagnostics
Project description
pyscagnostics
Python wrapper for computing graph theoretic scatterplot diagnostics.
Scagnostics describe various measures of interest for pairs of variables, based on their appearance on a scatterplot. They are useful tool for discovering interesting or unusual scatterplots from a scatterplot matrix, without having to look at every individual plot.
Wilkinson L., Anand, A., and Grossman, R. (2006). High-Dimensional visual analytics: Interactive exploration guided by pairwise views of point distributions. IEEE Transactions on Visualization and Computer Graphics, November/December 2006 (Vol. 12, No. 6) pp. 1363-1372.
Installation
pip install pyscagnostics
Usage
from pyscagnostics import scagnostics
# Using NumPy arrays or lists
measures, _ = scagnostics(x, y)
print(measures)
# Using Pandas DataFrame
all_measures = scagnostics(df)
for measures, _ in all_measures:
print(measures)
Documentation
def scagnostics(
*args,
bins: int=50,
remove_outliers: bool=True
) -> Tuple[dict, np.ndarray]:
"""Scatterplot diagnostic (scagnostic) measures
Scagnostics describe various measures of interest for pairs of variables,
based on their appearance on a scatterplot. They are useful tool for
discovering interesting or unusual scatterplots from a scatterplot matrix,
without having to look at every individual plot.
Example:
`scagnostics` can take an x, y pair of iterables (e.g. lists or NumPy arrays):
```
from pyscagnostics import scagnostics
import numpy as np
# Simulate data for example
x = np.random.uniform(0, 1, 100)
y = np.random.uniform(0, 1, 100)
measures, bins = pyscagnostics.scagnostics(x, y)
```
A Pandas DataFrame can also be passed as the singular required argument. The
output will be a generator of results:
```
from pyscagnostics import scagnostics
import numpy as np
import pandas as pd
# Simulate data for example
x = np.random.uniform(0, 1, 100)
y = np.random.uniform(0, 1, 100)
z = np.random.uniform(0, 1, 100)
df = pd.DataFrame({
'x': x,
'y': y,
'z': z
})
results = pyscagnostics.scagnostics(df)
for measures, bins in results:
print(measures)
```
Args:
*args:
x, y: Lists or numpy arrays
df: A Pandas DataFrame
bins: Max number of bins for the hexagonal grid axis
The data are internally binned starting with a (bins x bins) hexagonal grid
and re-binned with smaller bin sizes until less than 250 empty bins remain.
remove_outliers: If True, will remove outliers before calculations
Returns:
(measures, bins)
measures is a dict with scores for each of 9 scagnostic measures.
See pyscagnostics.measure_names for a list of measures
bins is a 3 x n numpy array of x-coordinates, y-coordinates, and
counts for the hex-bin grid. The x and y coordinates are re-scaled
between 0 and 1000. This is returned for debugging and inspection purposes.
If the input is a DataFrame, the output will be a generator yielding scagnostics
for each combination of column pairs
"""
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pyscagnostics-0.1.0a2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fb49e8dd3c49a68c5bcda3077445bce2756cd26b4946d639756d5651cdce3bb |
|
MD5 | 7b3de33cac7243f4fd8e3f859ba7a0e5 |
|
BLAKE2b-256 | 9277bd740268e785ba61db0421cc8102d4af597104f08d7629ef1d05f50d6d38 |
Hashes for pyscagnostics-0.1.0a2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94a98f41868d02078de2a7812e263bf82add03394cf637306a8797c02acc4ee5 |
|
MD5 | 27109da04d117f2deeeab5ad0221227b |
|
BLAKE2b-256 | 176215fd126dc306a93c29a881101a3c7e8d55f7c449988eb8a32e3dd6ac1292 |
Hashes for pyscagnostics-0.1.0a2-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4366dd2d5822209e5c08e2d3c5ddac77e948b9e71192fdbd2a7b182acffa1b7 |
|
MD5 | c4c7fd3d53d98b0e01db65c39fdd0461 |
|
BLAKE2b-256 | 7b27bc14d4d2c73ed4d6285d4591b526e71abdf6962d717dd7995cfb05443465 |
Hashes for pyscagnostics-0.1.0a2-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15724f3d1da8f07226a29729a86ef9c6594e7003c3211c8213b39e1f0b1930d1 |
|
MD5 | fc7ebdc2a185431afd3e582fbda5c8ff |
|
BLAKE2b-256 | f5aa4dec3229c62f7ffe67b22f3f3582787497f758693d6da93c5e35d84c2def |
Hashes for pyscagnostics-0.1.0a2-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f71f778046889547bf58f86bab2ef2204150ace2f5bbdfc55904a4710a2e2fbc |
|
MD5 | a67e5c0e545c5861d6b676166e21d3ec |
|
BLAKE2b-256 | 0bbeee21ea2acf8d06fe4ffccf2522d1e002cbb09f3be9f0c6a7ce7ad42898dc |
Hashes for pyscagnostics-0.1.0a2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e38907f6075267f4fc54da6ae82f0a4bb8e9cd30ebf58cb43f008a0b5938056 |
|
MD5 | 116d4f29b001c0f2af11dfda7d45badd |
|
BLAKE2b-256 | d0460b5c75335ec9853ce032e8b953ffdf0b30c898c5bb47ebca878a8bfffa32 |
Hashes for pyscagnostics-0.1.0a2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f77cefe75c0a4fd193941aff609fa5d39dacfcd6af9c2686eedc2cc4d619d59a |
|
MD5 | 824c4b5b2f264aca830d13e35d75f9d2 |
|
BLAKE2b-256 | afe1ce30dd8c3a5a82eea1a4ebc5dbf70d6d3f3f9378b79c3c21eeafaa7ef890 |
Hashes for pyscagnostics-0.1.0a2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57b3232ddc40874afe698761e5dd20258572cb4e2f506a40e646d2d6ca9bc681 |
|
MD5 | 12fecbb54c1d7295eb32444070441d4c |
|
BLAKE2b-256 | 8539e9a772298b2695376596c206cbfeaf7c085306152131e8f4fbacafb42d07 |
Hashes for pyscagnostics-0.1.0a2-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84e32d37d97ee94fc9642457b1d66e4f62c60ee782a62b61ab70d2c576b3c6ad |
|
MD5 | f5dc16e107ff9b3acedaa7dec02611a3 |
|
BLAKE2b-256 | 2b190895035a6c406b26a8cbb09db1488c794a934d3a28fefffbba862513bea6 |
Hashes for pyscagnostics-0.1.0a2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc52d925fe5666696a461ced497df1a7f8f64399ef6df41ab7356199b9ade969 |
|
MD5 | c0354a40d460959f01037509e2c83ee6 |
|
BLAKE2b-256 | 2f6be100fe209b0cb4332fb304ab5d3cbb39c0c5747343db0216b6ea215c89a1 |
Hashes for pyscagnostics-0.1.0a2-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea2c21a246829b7a5ff9071d3f638fca495e523766b74ba34cbf67f084bc3303 |
|
MD5 | b41a1e61208eaf71ff6b864ffb20b131 |
|
BLAKE2b-256 | 6e098622d752a446684e85d591b8b3cdc872ef21bbb94c24850ec46e5dc87bf6 |
Hashes for pyscagnostics-0.1.0a2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a8866277412140601f4cf93c35141969d17ab21fdab72451f7065a5774025a1 |
|
MD5 | 56d325920c5b38c2f1381cd331fe32d1 |
|
BLAKE2b-256 | 0cdf23d46b2517adc994452aae2651e8fcd4ebf81ea13d66808f6deba26fd27b |
Hashes for pyscagnostics-0.1.0a2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32da2ee4f75b55bc2593cee6368733f90a456afac093cf88979ed5a69a91795b |
|
MD5 | 21ba2510fed5c55d5acb59e5bc40c4be |
|
BLAKE2b-256 | fa21b9e2f189e019c006757e343be545780df78aa8406fd6bf9c43b03604f174 |
Hashes for pyscagnostics-0.1.0a2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4ca108bc2df331b436c7a7c44b51d05dd7126f9c161e356f23f55a20e4ffc52 |
|
MD5 | 5466f97b5478b0da5749237d0c470dc9 |
|
BLAKE2b-256 | 31903a806845b0a4e611ccdb7114cda2afa24ddc17334306aa20dcf6dd852b94 |
Hashes for pyscagnostics-0.1.0a2-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a888bfda8209e73bf40add46b50b13cbbaad632742403ee1d718668c2ddb6a7d |
|
MD5 | ddbeb678c4816f6973ef754e4b67ada9 |
|
BLAKE2b-256 | d537f93634d7b19408650057157e259a08ab256c9019f638782ea5b6fbe9f50b |
Hashes for pyscagnostics-0.1.0a2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7fdaf87bfeda24535427f51ba90197b3c7d847a950d4fb180232b2050dc01f0b |
|
MD5 | ec603141355d9870607aa03367069a5b |
|
BLAKE2b-256 | 81506217e022363cd6d7f003a6a7ebee6132d58a780dad36ec46ac7815796df4 |
Hashes for pyscagnostics-0.1.0a2-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 043e224e936aa1c4e1e065029afad220b8e500999ab34655144cd57470554922 |
|
MD5 | ce40ac3606456d44c09dc0de57802c1f |
|
BLAKE2b-256 | 54937216de393fe07bf5b9ad8c705283474ea34f03645881d9a4ced78521ca8a |
Hashes for pyscagnostics-0.1.0a2-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09178aad3c73cedbcc93362ed25669b36bfbaa253603ad4184531b7e106c8b35 |
|
MD5 | 40b6067fdf0830edd4bf2dc9cd239aa3 |
|
BLAKE2b-256 | cca8abf2a9219a2d91750c96314a66cc480f24265764d40f2dfc605f998c57f1 |