【发布时间】:2018-01-09 10:47:36
【问题描述】:
我正在尝试根据该数据创建图
Word count
17 in 2
15 on 2
33 the 2
8 you 2
0 valar 1
29 all 1
24 + 1
25 hotel 1
26 are 1
使用此代码:
%matplotlib inline
words_df[words_df['count'] > 10000].plot(x='Word',kind='bar')
但我收到此消息错误:
TypeError: Empty 'DataFrame': no numeric data to plot
你能告诉我问题出在哪里吗???
【问题讨论】:
-
你的数据框是什么样子的?你能发布
print(words_df.head())的输出吗? -
它看起来像我在帖子中发布的内容。字数 17 in 2 15 on 2 33 the 2 8 you 2 0 valar 1 29 all 1 24 + 1 25 hotel 1 26 are 1
标签: python pandas dataframe matplotlib plot