Skip to main content

Wrangle dataframes for use in Sankey visualizations

Project description

# Sankeyfy - Data wrangling for easy Sankey Visualizations

The Sankeyfy package aims to simplify the creation of a Sankey
visualization through a straightforward function call. Simply
run the "sankeyfy" function on your dataframe, and it will output
the necessary dataframes for a Sankey chart.

I built this for specifically for use with the **Plotly** API,
but this should also be useful for its sources or other D3 libraries.

The function accounts for the following scenarios, and attempts
to leverage sensible default behavior (but feel free to give feedback
or contribute!):

1. *Default Scenario:* **Pre-aggregated format**
* Input is a table of categorical variables/columns with a
single aggregate column (counts/count distinct, etc.)

2. **Raw Format**
* Input is a raw table where each row is an observation and
the columns are all categorical variables.
* Currently assumes there is a unique id field, will add default
functionality for this later


Please feel free to give me any feedback or contribute with a PR,
and hopefully this saves your some time trying to build out some cool
Sankey visuals!


## To Do:

1. DONE - Create Default NULL behavior as an option (Fill with an "unknown" category that you can feed the value for)
2. DONE - Build functionality to create an ID field if one isn't provided...

Copyright 2018, MIT License




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

sankeyfy-0.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sankeyfy-0.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file sankeyfy-0.2.tar.gz.

File metadata

  • Download URL: sankeyfy-0.2.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for sankeyfy-0.2.tar.gz
Algorithm Hash digest
SHA256 c5aa65f47a7074030a1a53cef12b305203bbe868c8d02a177a6216899debcf9c
MD5 9e87955f0629d2c552b21070026fd5de
BLAKE2b-256 0d50fa50b704e8811e1e305a5e2fea778705fda0fbb57626692ce03ab9ae7e32

See more details on using hashes here.

File details

Details for the file sankeyfy-0.2-py3-none-any.whl.

File metadata

  • Download URL: sankeyfy-0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for sankeyfy-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f076fc1c7d1e890cfc4466d15f763a8f40e89091f5f2e6efa15dfa576cd0bcc9
MD5 311a2a8af9dc19e5a07ed8dea171d97b
BLAKE2b-256 68d72162b8ff3dd7e4a24c1db792ef7d209555de93d05c78691fbdfd90a9e1b3

See more details on using hashes here.

Supported by

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