I have been trying to create a Vincent time series line plot. My code is as follows:
#!/usr/bin/env python
import pandas as pd
import numpy as np
import vincent
#test data
df2 = pd.DataFrame({ 'A' : 1., 'B' : pd.Timestamp('20130102'),'C' : pd.Series(1,index=list(range(4)),dtype='float32'),'D' : np.array([3] * 4,dtype='int32'), 'E' : pd.Categorical(["test","train","test","train"]), 'F' : 'foo' })
vis = vincent.Line(df2) # test
vis.axis_titles(x='Time', y='Freq')
vis.legend(title='Words')
vis.to_json('chart.json')
vis.display()
I get no output (no display or chart.json created) or any errors. The other similar problems on here are due to Ipython notebook or Canopy issues, for example this; I am not using Ipython, notebook or Canopy. My question is: why is there no json created?
EDIT: OK maybe I am using Ipython without knowing it! I get this output:
<IPython.core.display.HTML at 0x7f980791e2d0>
However adding vis.core.initialize_notebook()
from this solution does not help.
It was an issue with Eclipse. My working directory was for some reason set to a subdirectory where the json file WAS being created. I post this in case someone else is as stupid as me.
EDIT: I added the Eclipse tag. Should have been there in the beginning.