我有一个数据框,希望使用plotly在其中一列上创建折线图。
我有以下代码,但无法正常工作
df['col1'].iplot(kind='scatter', filename='cufflinks/cf-simple-line')
谁能看到原因?我不确定是否应该使用.offline
答案 0 :(得分:1)
cf.go_offline()
代码按预期运行:
import plotly.offline as py
import plotly.graph_objs as go
import pandas as pd
import cufflinks as cf
cf.go_offline()
df0 = pd.DataFrame({"fruits": ["apple", "mango", "lime"],
"number of sold items": [20, 26, 32]})
df0["fruits"].iplot(kind="scatter", filename="lineplot-with-cufflinks")