Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/98.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 获取类型错误:不可损坏类型:';dict#u键';在jupyter笔记本中_Python_Pandas_Machine Learning_Jupyter Notebook_Data Science - Fatal编程技术网

Python 获取类型错误:不可损坏类型:';dict#u键';在jupyter笔记本中

Python 获取类型错误:不可损坏类型:';dict#u键';在jupyter笔记本中,python,pandas,machine-learning,jupyter-notebook,data-science,Python,Pandas,Machine Learning,Jupyter Notebook,Data Science,这是我全部代码的一部分,在这里我得到了TypeError。这就是我所做的 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 ea

这是我全部代码的一部分,在这里我得到了TypeError。这就是我所做的

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()


无法找出如何解决此错误。

发布完整错误回溯
元组(data.groupby(['Country']).groups.keys())
而不是
data.groupby(['Country']).groups.keys()