I have a dataframe,which has 'prod_key','prod_name','Sales','Volume'. I want to get all the descriptive statistics of the df.
groupby_cols = ['prod_key','prod_name']
funs = [F.mean, F.min, F.max,F.count]
aggregate_cols = [ 'Sales','Volume' ]
exprs = [f(F.col(c)) for f in funs for c in aggregate_cols]
df_description = df.groupBy(*groupby_cols).agg(*exprs)
I got null values in the max function results.Min function works fine. Anything wrong with this? Thanks.