2017-07-11 49 views
0
import pandas as pd 
    import numpy as np 
    from bokeh.palettes import Spectral11 
    from bokeh.plotting import figure, show, output_file 
    output_file('temp.html') 
    toy_df = pd.DataFrame(data=np.random.rand(5,3), columns = ('a', 'b' ,'c'), index = pd.DatetimeIndex(start='01-01-2015',periods=5, freq='d')) 
    numlines=len(toy_df.columns) 
    mypalette=Spectral11[0:numlines] 

    p = figure(width=500, height=300, x_axis_type="datetime") 
    p.multi_line(xs=[toy_df.index.values]*numlines, 
      ys=[toy_df[name].values for name in toy_df], 
      line_color=mypalette, 
      line_width=5) 
    show(p) 

我使用背景虚化有折线图有这样的代码蟒蛇绘制折线图,​​它工作正常进行一次,但现在我得到这个错误:使用背景虚化

ImportError: No module named palettes 

有什么建议?

回答

0

你要么有一个古代安装散景,或破碎的。 bokeh.palettes在近三年前的版本0.4中增加了。

+0

我只是安装了一切,它的工作原理是一次...如果它坏了我该如何解决这个问题? –

+0

文件系统和操作系统问题基本上不可能在没有实际挖掘系统的情况下进行调试。我可以建议的最好的事情是重新安装。 – bigreddot