This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |