How to find maximum value of a column in python dataframe

前端 未结 4 489
遥遥无期
遥遥无期 2021-02-07 15:36

I have a data frame in pyspark. In this data frame I have column called id that is unique.

Now I want to find the maximum value of

4条回答
  •  独厮守ぢ
    2021-02-07 16:32

    You can use the aggregate max as also mentioned in the pyspark documentation link below:

    Link : https://spark.apache.org/docs/latest/api/python/pyspark.sql.html?highlight=agg

    Code:

    row1 = df1.agg({"id": "max"}).collect()[0]
    

提交回复
热议问题