1
我有這樣一個數據幀:當總和()的一個專欄中,我得到這個錯誤AttributeError的:「據幀」對象有沒有屬性「和」
+-----+--------+
|count| country|
+-----+--------+
| 12| Ireland|
| 5|Thailand|
+-----+--------+
當我添加總和()函數來獲得總第一列「計數」的我得到這個錯誤:
AttributeError: 'DataFrame' object has no attribute 'sum'
我導入from pyspark.sql.functions import sum
如何總結或我缺少什麼?
謝謝你,感謝任何幫助。
請分享您的代碼 –