我有 Python 2.7 的 Anaconda,我正在尝试使用 Vincent。我做了 pip install ,这似乎有效。我尝试在 Spyder 和 iPython 中分别运行它,但似乎都不起作用。我在 iPython 中试过这个:
import vincent
import pandas as pd
vincent.core.initialize_notebook()
X= [
[0,0,1,1,1,0],
[1,1,0,0,0,1],
[1,0,0,0,1,1],
[0,1,1,0,0,0],
[0,0,0,1,0,0],
[0,0,1,1,1,0],
[1,1,0,0,0,1]
]
x1 = pd.DataFrame(X)
line = vincent.Line(x1)
line.display()
我收到以下错误:
Javascript error adding output!
TypeError: Object doesn't support this action
See your browser Javascript console for more details.
然后我尝试在 Spyder 中运行它。它创建了线对象,但没有显示任何内容。当我输入
type(line)
我明白了
<class 'vincent.charts.Line'>
这很好,但我想展示这条线!我是否缺少依赖项,或者我的语法是否关闭?