【发布时间】:2022-04-01 12:25:38
【问题描述】:
这是我的整个代码的一部分,我在这里得到了 Typerror。这就是我所做的。
plt.figure(figsize=(14,6))
plt.plot(data.groupby(['Country']).groups.keys(), data.groupby(['Country'])['CustomerID'].count())
plt.xticks(rotation = 90, fontsize = 14)
plt.title("Number of transanctions done for each country")
plt.ylabel("No. of trans.")
plt.xlabel("Country")
plt.show()
不知道如何解决这个错误。
【问题讨论】:
-
发布完整错误回溯
-
试试
tuple(data.groupby(['Country']).groups.keys())而不是data.groupby(['Country']).groups.keys()?
标签: python pandas machine-learning jupyter-notebook data-science