• 카테고리

    질문 & 답변
  • 세부 분야

    데이터 분석

  • 해결 여부

    미해결

iplot 에러 관련 질문입니다,

20.07.30 15:43 작성 조회수 554

1

안녕하세요. 이번에 iplot 강의를 듣다가 df.iplot(kind = "bar") 코드를 실행했더니 오류 메시지로

File "D:\Python\lib\site-packages\chart_studio\api\v2\utils.py", line 82, in validate_response
    raise exceptions.PlotlyRequestError(message, status_code, content)
chart_studio.exceptions.PlotlyRequestError: Authentication credentials were not provided.

이 오류 메시지가 떴어요. 이건 처음보는 메시지인데 어떻게 해결할 수 있을까요?? 

아래는 전체 코드입니다.

import chart_studio.plotly as py

import cufflinks as cf 

cf.go_offline(connected = True)

import numpy as np

df = pd.DataFrame(np.random.rand(10, 2), columns = ['A', 'B'])

print(df.iplot(kind = 'bar'))

답변 1

답변을 작성해보세요.

0

안녕하세요. chart_studio 를 실행하는 방법이 두가지가 있는데, 하나는 online 또다른 하나는 offline 입니다.

online 경우에는 인증키등을 요청해요. 그러나 offline 경우에는 그런 부분을 요청하지 않는데, 일종의 버그로 보여요.

주피터노트북 주석에 씌여져 있는대로, 완전히 컴퓨터를 껐다 켜서, 재실행을 해보시면 좋을 것 같고요.

정안되면, 다음과 같이 인증키를 받아서, 설정을 하는 코드를 한번 실행해주시면 해결될 것 같습니다. (살짝 복잡한데, 이 부분은 해당 프로그램 이슈이기도 하니, 양해를 부탁드려요)

감사합니다.

Chart Studio provides a web-service for hosting graphs! Create a free account to get started. Graphs are saved inside your online Chart Studio account and you control the privacy. Public hosting is free, for private hosting, check out our paid plans.

After installing the Chart Studio package, you're ready to fire up python:

$ python

and set your credentials:

import chart_studio
chart_studio.tools.set_credentials_file(username='DemoAccount', api_key='lr1c37zw81')

You'll need to replace 'DemoAccount' and 'lr1c37zw81' with your Plotly username and API key.
Find your API key here.