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 the column id in the data frame.
I have tried like below
df['id'].max()
But got below error
TypeError: 'Column' object is not callable
Please let me know how to find the maximum value of a column in data frame
In the answer by @Dadep the link gives the correct answer
解决方案
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: