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 = 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 = scagnostics(df)
for x, y, result in results:
measures, bins = result
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 a tuples of
scagnostic results for each column pair:
(x, y, (measures, bins))
"""
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.0a4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 018b51796715b4e268690eb47671b05ae292bdd63fdb5db264f0ede3648899c4 |
|
MD5 | 680ec049690a1026738ecfbe34c9809d |
|
BLAKE2b-256 | 0149a45590b0877bca91ea0069ccb78d4e4ab98a5d29a16c758ba6da4bf34a10 |
Hashes for pyscagnostics-0.1.0a4-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45409e91da7497394cd58f6352c3684c283ac4c29e7f08b49898dafeb8e9c1d8 |
|
MD5 | 304685e6932f3e2a1f7bac36b7f5340a |
|
BLAKE2b-256 | 3a653878fa8dae4eafbb715b613d44c1477a6bdf08ce16d7414892f8aa77f5cd |
Hashes for pyscagnostics-0.1.0a4-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb7918e9a3280cabe88757fa1e1090bb1f66d7ccd9e1282ae6619adef09a2c28 |
|
MD5 | 84de3d09a66b3a3975a735b05d9090b1 |
|
BLAKE2b-256 | 5610f18d71361a8ccda701d9fa3207fd56556890e81019f8343dee610d80e395 |
Hashes for pyscagnostics-0.1.0a4-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1a2cd294c2fa0d4c6e41d48bf904753de7002242ab59b2f830ee8c56b8d8f37 |
|
MD5 | 2082e71be0893528153f198551591caa |
|
BLAKE2b-256 | 841a7647a7b865940ffbcd97d90d264a025b7c2e98d677d2248dd9abd06192ce |
Hashes for pyscagnostics-0.1.0a4-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c798d41a1b46c9b05b83b67054f4831259a5215d8ade503ec7d9c468529d3eee |
|
MD5 | 1dd990f5f37655edf9ee0ecaaf305198 |
|
BLAKE2b-256 | 3d238045d8e543a94ca68d5cb5058e3cfe1ed1e7525cbd62f44206708a3a3431 |
Hashes for pyscagnostics-0.1.0a4-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f65460e44cefdf7e0d0b3ab6eb92cb5fbef57c6113b7950d1b40297eb919da1d |
|
MD5 | 51f9f081cf9b3b984cbf1eddbd960c55 |
|
BLAKE2b-256 | df544ec93c6cd1ce90869231f3df1e7c7eb02d8875aea8af27449bcaf6c790b1 |
Hashes for pyscagnostics-0.1.0a4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f39959ffa4c68567396430413bc27b09d7d4bb8f8aa21e60da937254d55b6283 |
|
MD5 | d849b55d191823d41fe3b3799b811f58 |
|
BLAKE2b-256 | 6421dd1f446b38f45e8f2d6266d9e4c767439d81695c99030092f451a374e3ba |
Hashes for pyscagnostics-0.1.0a4-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af563c97ac4a2db92229570ee4c050cd6a35128ef782d6a57686102dc6a2fd1d |
|
MD5 | 51cb2d41a68d53a355f4810f82c0dec2 |
|
BLAKE2b-256 | 0af9d3ee6fcfa69a225b5d0250ec529f1e427edc3547e77e2336f68bc0193452 |
Hashes for pyscagnostics-0.1.0a4-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91259e559b3a63e8f5218d456ea71453615ed653e64adc802931ad9d57790a9e |
|
MD5 | 77737b62bc54c73d462a419fa47322d7 |
|
BLAKE2b-256 | c95878ce2cf2bc09b0482d1b2c05fdaf775aa95a39d90fbcb8f2c9ce35f56522 |
Hashes for pyscagnostics-0.1.0a4-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ea783707ab7ae6ca8f785783104afb2b059c9e7c6bbd9427e507e34ad0ea30d |
|
MD5 | c576bb2ede8e3bfdb072faf7ac79d89f |
|
BLAKE2b-256 | 9fc9718e1639ffc10e5e7de4e07b68e9642b4785fb8680666dfe6ec3c5e54a75 |
Hashes for pyscagnostics-0.1.0a4-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36fd329ea01781825d4d877373189b2e91dc493a1ddd5878357223b01abe769d |
|
MD5 | 1ec6271e4289e3c48f2e41c0c7ee2917 |
|
BLAKE2b-256 | 6fbfa20010f6fedca034ebbee57f3797b82d22ec85bcb6b59cb2846f8ec63563 |
Hashes for pyscagnostics-0.1.0a4-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04533671febd40b1cec09df7451afd066f04fe6d67b4bf66651ef0e43c1323e3 |
|
MD5 | 34bea2964da8bfa80b72aebc19491327 |
|
BLAKE2b-256 | 5c13d30bb59b040cf6b580fee7a71a112e61b3a331dbb3edaedc6a1d22696cdf |
Hashes for pyscagnostics-0.1.0a4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbfca4ed8ce839742408127f4408fbabf5e7ebd95bd0d1ed4ba83d49eae424f7 |
|
MD5 | e4ce24b29122bd684b86082bfa9e1c15 |
|
BLAKE2b-256 | 2fbaf07aac95e1b68a079e67ff801cea3a688cce767febf79e59be9ab251b23d |
Hashes for pyscagnostics-0.1.0a4-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1b0b03fd269dfa6d4b353570a40c12e84a75715dc0704d775222cf1d5f86a83 |
|
MD5 | bff0dc1845abd80a3e3703a5c24e3a91 |
|
BLAKE2b-256 | b97fb710350d65f77cf5fc36817dd393d2235f4ca78d968bc6f4c8d9db19abf3 |
Hashes for pyscagnostics-0.1.0a4-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbe943b63a0f31c5c2eacc866a2683b92c65ea7808ef4ac91a7802f182a778ab |
|
MD5 | 7837c13b4e71d16f9f6fd68c48e7ce69 |
|
BLAKE2b-256 | 741677010c83f6658ae4b3968b35fe950509faeb8cbcdbc70cc1535c91b9303e |
Hashes for pyscagnostics-0.1.0a4-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ac026f00ac29f51983f81343f10865eb04050d0273b9e851c8dffc9a72ddd6b |
|
MD5 | 5dd01377c0b8c3560567a173c7319477 |
|
BLAKE2b-256 | bb7af08fa0c83264b3933aa9e08f0b3c0243c86d4b29942c679b9fbf944bfb57 |
Hashes for pyscagnostics-0.1.0a4-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d187bc1dcf3d3f442f0bc1eba53968a705a64e4e8c5cf057a0e3649cbd48b079 |
|
MD5 | 6218870f2f6701d7ce8fc322acc9e654 |
|
BLAKE2b-256 | 5e248df2e48842996b9d687e7259880a07ffabd20702720f4b9d2dcce7f75763 |
Hashes for pyscagnostics-0.1.0a4-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecf5fe5693af106e1a5858ccc7e7dec04106e2a5a0699da10f034b8c72905abd |
|
MD5 | 9d185b957508508ab274da5b825b1ed4 |
|
BLAKE2b-256 | 8d767931851fe57bfeeed1146c169fb4e92e1c1aa19709087a1b5b4e3b600664 |