更新时间:2023-02-23 22:24:51
collect()
将结果作为 Python 列表返回.要从列表中获取值,您只需要像这样取第一个元素:
collect()
returns your results as a python list. To get the value out of the list you just need to take the first element like this:
saleDF.groupBy("salesNum").mean()).collect()[0]