Vincent plots are not showing up, not receiving errors

被刻印的时光 ゝ 提交于 2019-12-20 02:54:49

问题


For some reason I am getting the below when I try and plot something with Vincent:

<IPython.core.display.HTML at 0x10db19650>
<IPython.core.display.Javascript at 0x10db19d50>

Here's the code:

import pandas as pd
import vincent

data = pd.read_csv('kd.csv')
pd.set_option('display.max_columns', None)

df = pd.DataFrame(data=[data['Age'], data['FG'], data['FGA'], data['3P'], data['3PA']])
df = df.T

df[['FG', 'FGA', '3P', '3PA']] = df[['FG', 'FGA', '3P', '3PA']].astype(float)

line = vincent.Line(df)

line.display()

This happens in IPython and Ipython Notebook. Any idea why?


回答1:


Not sure if you found answer yet but it's a simple solution.

import vincent as v
v.core.initialize_notebook()

From there your plots should render correctly within Ipython notebook. A call to line.display() is unnecessary.



来源:https://stackoverflow.com/questions/22212336/vincent-plots-are-not-showing-up-not-receiving-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!