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
If you want a specific column :
import pyspark.sql.functions as F df.agg(F.sum("my_column")).collect()[0][0]