How to find maximum value of a column in python dataframe

前端 未结 4 492
遥遥无期
遥遥无期 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:21

    I'm coming from scala, but I do believe that this is also applicable on python.

    val max = df.select(max("id")).first()
    

    but you have first import the following :

    from pyspark.sql.functions import max
    

提交回复
热议问题