2
我想從數據框中繪製條形圖。這裏是數據幀 而當我嘗試寫代碼來顯示barplot時,它會返回此錯誤。 TypeError: unsupported operand type(s) for /: 'str' and 'int'
我GOOGLE了它,很多人都添加了這個關鍵字kind="count"
,但dint的工作。這是我正在使用的代碼。顯示barplot的seaborn錯誤
#Using seaborn to get the hours against the user_count
sns.set_style("whitegrid")
ax = sns.barplot(x= 'hours', y= 'user_count', data=dff)
ax.set(ylabel = 'User Count')
ax.set(xlabel = 'Hour of the Day')
ax.set_title('2017-06-02/ Friday')
plt.show()
謝謝!!我認爲標題很重要。 – Aurora
@Aurora標題無關緊要,但數據類型的確很重要 –