如何在Google Colab上导入绘图

时间:2019-09-24 05:45:29

标签: python google-colaboratory

嗨,我正尝试在GoogleColab上导入plotly

我使用了代码import plotly.plotly as py import plotly.graph_objs as go,它返回

ImportError: The plotly.plotly module is deprecated, please install the chart-studio package and use the chart_studio.plotly module instead.

有人可以对此有所说明吗?谢谢。

2 个答案:

答案 0 :(得分:5)

如错误所述,请尝试使用以下命令安装chart-sudio

!pip install chart_studio

然后像这样导入它:

import chart_studio.plotly as py
import plotly.graph_objs as go

这是屏幕截图:

enter image description here

答案 1 :(得分:2)

情节已更新。试试这个:

import plotly.express as px