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 wil 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. Create Default NULL behavior as an option (Fill with an "unknown" category that you can feed the value for)
2. Build functionality to create an ID field if one isn't provided...
Copyright 2018, MIT License
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 wil 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. Create Default NULL behavior as an option (Fill with an "unknown" category that you can feed the value for)
2. Build functionality to create an ID field if one isn't provided...
Copyright 2018, MIT License
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 Distribution
sankeyfy-0.1.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sankeyfy-0.1.tar.gz.
File metadata
- Download URL: sankeyfy-0.1.tar.gz
- Upload date:
- Size: 3.8 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18d320822f7d111cf28c4a7063867bab28656f7354eee511a2a08c8a64eb847d
|
|
| MD5 |
734afba2d5c9a25a27e2beb47d2a4f6e
|
|
| BLAKE2b-256 |
ff9e5391f94168b0b257acfc93fff52da031fd304918a764d2327a7cf58af049
|
File details
Details for the file sankeyfy-0.1-py3-none-any.whl.
File metadata
- Download URL: sankeyfy-0.1-py3-none-any.whl
- Upload date:
- Size: 4.0 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2650fa74f355b03a76fa23422c48b678229cec9f99bab18955491c05f642ceaa
|
|
| MD5 |
0aadf096dd24e3adc93a85faaac254fd
|
|
| BLAKE2b-256 |
658a2cbd12276f3f13e9568e00f01a86974f9f65ad41b0eb74f732e9fd12478b
|