Hi all.
I have this simple piece of code:
import pandas as pd
import plotly.express as px
import numpy as npdf2 = pd.read_csv(‘agenti-sum.csv’, sep=‘,’)
df2 = df2.replace(np.nan, 0)
fig = px.sunburst(df2, path=[‘agente’, ‘cliente’], values=‘valore’)
fig.show()
And my csv data is this:
agente,cliente,tbese,quantita,valore
Asia,Bahrain,1952,50.939,120447
Asia,Bahrain,1952,37.484,46886859
Europe,Belgium,1952,68,-873
Europe,Benin,1952,38.223,1738315
With these datas I get a blank screen… The Sunburst chart does not appear.
But when I change the negative number
Europe,Belgium,1952,68,-873
in positive
Europe,Belgium,1952,68,873
it works fine.
Likewise… if I simply change the first field in this way.
Eur,Belgium,1952,68,-873
Europe,Benin,1952,38.223,1738315
or the second field
Europe,Benin,1952,68,-873
Europe,Benin,1952,38.223,1738315
It works with no problem.
I don’t know is this is a bug…
My plotly version is 4.10.0.
Any ideas?
Is there something wrong with my code?
Many thaks for your time.
Kind regards.
G.