问题
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