What's difference between 'groupby.apply'and'groupby.agg
'? , Why processed data are displayed as 'NoneType'?
- This is for Spark 2.1.0,I want to turn a column into multiple rows,same column can be connected with commas,when I use
groupby.apply
, there are no output, when I usegroupby.agg
, procedures can be followed as what I think. - I use
.count()
of procedures, but it shows 'NoneType
' object has no attribute 'count
'.
data1=df.groupBy('_c0').agg(collect_list('_c1')).show()
print(data1.count())
data1=df.groupBy('_c0').apply(collect_list('_c1')).show()
I want to know how many number of rows and cols of procedures.