(已解决)PySpark : AttributeError: ‘DataFrame‘ object has no attribute ‘iteritems‘
•
大数据
AttributeError: ‘DataFrame’ object has no attribute ‘iteritems’
原因在使用SparkSession对象中createDataFrame函数想要将pandas的dataframe转换成spark的dataframe时出现的

因为createDataFrame使用了新版本pandas弃用的iteritems(),所以报错

解决办法,把pandas还原成老版本
# 卸载新版本 pip uninstall pandas # 安装老版本 pip install pandas==1.5.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://www.net2asp.com/7b246e1d28.html
