How to find maximum value of a column in python dataframe

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

    if you are using pandas .max() will work :

    >>> df2=pd.DataFrame({'A':[1,5,0], 'B':[3, 5, 6]})
    >>> df2['A'].max()
    5
    

    Else if it's a spark dataframe:

    Best way to get the max value in a Spark dataframe column

提交回复
热议问题