Home>

An error occurs when you try to store data and make it a Sankey chart.
I don't know why.
Is it simply because the data types do not match?
Thank you.

df = pd.read_gbq (query, 'business-intelli-0099')
from ipysankeywidget import SankeyWidget
SankeyWidget (links = df.to_dict ('records'))

Error details

KeyError Traceback (most recent call last)
<ipython-input-113-3162edfdae41>in<module>
      1 from ipysankeywidget import SankeyWidget
---->2 SankeyWidget (links = df.to_dict ('records'))
~ \ AppData \ Local \ Continuum \ anaconda3 \ lib \ site-packages \ ipysankeywidget \ sankey_widget.py in __init __ (self, ** kwargs)
     51 values ​​= set ()
     52 for i, link in enumerate (kwargs.get ('links', [])):
--->53 linksource = link ['source']
     54 linktarget = link ['target']
     55 if 'type' in link:
KeyError: 'source'