I have a pyspark dataframe with a column of numbers. I need to sum that column and then have the result return as an int in a python variable.
df = spark.cr
I think the simplest way:
df.groupBy().sum().collect()
will return a list. In your example:
In [9]: df.groupBy().sum().collect()[0][0] Out[9]: 130