PlotlyRequestError: Authentication credentials were not provided python

Viewed 2331

I'm trying to do some visualizations using plotly. But when I'm trying to do the visualizations I always get the following error.

enter image description here

Following is my code.

#Boxplot and histogram of Total Direct Variable Cost grouped by with or with Financial Class
import chart_studio.plotly as py

from  plotly.offline import iplot
trace0 = go.Box(
    y=healthcare.loc[healthcare['A'] == 'Inpatient']['B'],
    name = 'Inpatient',
    marker = dict(
        color = 'rgb(214, 12, 140)',
    )
)
trace1 = go.Box(
    y=healthcare.loc[healthcare['A'] == 'InBorn']['B'],
    name = 'InBorn',
    marker = dict(
        color = 'rgb(0, 128, 128)',
    )
)
data = [trace0, trace1]
layout = go.Layout(
    title = "CCCCCCCCCCCC"
)

fig = go.Figure(data=data,layout=layout)
py.iplot(fig)
2 Answers

I had the same problem, so I changed py.iplot(fig) to fig.show()

Related