【发布时间】:2019-04-09 13:26:43
【问题描述】:
我在将数据从 csv 文件加载到 bokeh 时遇到问题,从 bokeh 数据库它可以工作,但是当我尝试从 csv 文件时它没有加载,所以我一直在阅读但到目前为止没有运气。 提前致谢
df = pd.read_csv('unemployment1948.csv', delimiter = ',', index_col =
'Year')
df = pd.DataFrame(df)
df.head()
output_notebook()
group = df[35:].groupby('Year')
source = ColumnDataSource(df)
group.describe()
df.columns
#source = ColumnDataSource(df(x=df.loc[15:40].index,
# y=df.loc[15:40].Annual))
p = figure(plot_height=300, plot_width=900, x_range=group,
title='Umployment over the years',
x_axis_label='Year', y_axis_label='Annual')
p.circle(x=index, y='Annual', width=0.9, color ='#35B778' , source=source)
show(p)
【问题讨论】:
标签: python-3.x csv plot bokeh