Skip to content

Instantly share code, notes, and snippets.

View wintermonster's full-sized avatar

Nikhil Ahuja wintermonster

View GitHub Profile
@ken333135
ken333135 / genSankey
Created May 8, 2019 07:57
Wrapper Function to create Sankey Diagram from DataFrame
def genSankey(df,cat_cols=[],value_cols='',title='Sankey Diagram'):
# maximum of 6 value cols -> 6 colors
colorPalette = ['#4B8BBE','#306998','#FFE873','#FFD43B','#646464']
labelList = []
colorNumList = []
for catCol in cat_cols:
labelListTemp = list(set(df[catCol].values))
colorNumList.append(len(labelListTemp))
labelList = labelList + labelListTemp
@bennylope
bennylope / flake8parser.py
Last active August 14, 2023 05:16
A helper script to create summarize flake8 output.
#!/usr/bin/env python
"""
A script for parsing a flake8 error log and generating useful stats about the
errors in the code.
Author: Ben Lopatin (I think I wrote it, at least, no guarantee)
License: BSD
"""