I'm new to python/spyder, and I'm trying to make a sankey diagram, but no data is included in the plot, it's just empty. I found out that I need to convert from dataframe to lists, but this hasn't helped, and the plot is still empty. I kept it very simple, and pretty much copied it straight from a guide from plotly, and just imported my own data.
Here is my code, where I just removed the filepath.
Can anyone tell my what my mistake is?
edit to add image of xlsx file : xlsx file
edit 2 image of new Plot
import plotly.graph_objects as go
import pandas as pd
# go.renderers.default = "browser"
df = pd.read_excel (r'C:\filepath\data.xlsx')
labels=pd.DataFrame(df, columns= ['Label'])
label_list=labels.values.tolist()
sources=pd.DataFrame(df, columns= ['Source'])
source_list=sources.values.tolist()
targets=pd.DataFrame(df, columns= ['Target'])
target_list=targets.values.tolist()
values=pd.DataFrame(df, columns= ['Value'])
value_list=values.values.tolist()
fig = go.Figure(data=[go.Sankey(
node = dict(
pad = 15,
thickness = 20,
line = dict(color = "black", width = 0.5),
label = label_list,
color = "blue"
),
link = dict(
source = source_list,
target = target_list,
value = value_list
))])
fig.update_layout(title_text="Basic Sankey Diagram", font_size=10)
fig.show()