2

I am doing some twitter analysis and would like to use the pySankey package to visualise my results. But when I try to use this package, I get the following error that originates from the package itself. Does anyone know how to fix this? I am using python 3

UnboundLocalError Traceback (most recent call last) in () 6 7 sankey.sankey(df['State'], df['Location'], aspect=20, colorDict=colorDict, ----> 8 fontsize=1, figure_name="Twitter Sentiment-Topic Per State" 9 )

/anaconda3/lib/python3.6/site-packages/pySankey/sankey.py in sankey(left, right, leftWeight, rightWeight, colorDict, leftLabels, rightLabels, aspect, rightColor, fontsize, figure_name, closePlot)

UnboundLocalError: local variable 'topEdge' referenced before assignment

inimaduas
  • 21
  • 2

1 Answers1

0

You may want to give a try to https://github.com/ricklupton/ipysankeywidget

p.s. it provides interactive jupyter functionality, etc.enter image description here

https://nbviewer.jupyter.org/github/ricklupton/ipysankeywidget/blob/master/examples/More%20examples.ipynb#Styling

Another nice sankey python lib is: https://github.com/ricklupton/floweaver

Neil
  • 7,482
  • 6
  • 50
  • 56