code:
mydf = testDF.groupBy(testDF.word).count()
mydf.show()
output:
+-----------+-----+
| word|count|
+-----------+-----+
| she| 2208|
| mothers| 93|
| poet| 59|
| moving| 18|
| active| 6|
| foot| 169|
I wanted to order this data frame based on word count in descending order.
code:
countDF = mydf.orderBy(mydf.count.desc())
countDF.show()
Error:
AttributeError: 'function' object has no attribute 'desc'
Please let me know on where am I going wrong.