[DOCUMENTATION] fixed groupby aggregation example for pyspark
[DOCUMENTATION] fixed groupby aggregation example for pyspark

## What changes were proposed in this pull request?

fixing documentation for the groupby/agg example in python

## How was this patch tested?

the existing example in the documentation dose not contain valid syntax (missing parenthesis) and is not using `Column` in the expression for `agg()`

after the fix here's how I tested it:

```
In [1]: from pyspark.sql import Row

In [2]: import pyspark.sql.functions as func

In [3]: %cpaste
Pasting code; enter '--' alone on the line to stop or use Ctrl-D.
:records = [{'age': 19, 'department': 1, 'expense': 100},
: {'age': 20, 'department': 1, 'expense': 200},
: {'age': 21, 'department': 2, 'expense': 300},
: {'age': 22, 'department': 2, 'expense': 300},
: {'age': 23, 'department': 3, 'expense': 300}]
:--

In [4]: df = sqlContext.createDataFrame([Row(**d) for d in records])

In [5]: df.groupBy("department").agg(df["department"], func.max("age"), func.sum("expense")).show()

+----------+----------+--------+------------+
|department|department|max(age)|sum(expense)|
+----------+----------+--------+------------+
|         1|         1|      20|         300|
|         2|         2|      22|         600|
|         3|         3|      23|         300|
+----------+----------+--------+------------+

Author: Mortada Mehyar <mortada.mehyar@gmail.com>

Closes #13587 from mortada/groupby_agg_doc_fix.

HyukjinKwon/spark,nchammas/spark,aokolnychyi/spark,rikima/spark,guoxiaolongzte/spark,markhamstra/spark,tengpeng/spark,rikima/spark,shuangshuangwang/spark,wzhfy/spark,eyalfa/spark,ueshin/apache-spark,setjet/spark,nlalevee/spark,sahilTakiar/spark,ddna1021/spark,pgandhi999/spark,zero323/spark,rezasafi/spark,lvdongr/spark,shaneknapp/spark,skonto/spark,cin/spark,apache-spark-on-k8s/spark,bravo-zhang/spark,akopich/spark,andrewor14/spark,minixalpha/spark,akopich/spark,shubhamchopra/spark,byakuinss/spark,guoxiaolongzte/spark,janewangfb/spark,ptkool/spark,map222/spark,xflin/spark,kiszk/spark,publicRoman/spark,dongjoon-hyun/spark,zzcclp/spark,rekhajoshm/spark,ConeyLiu/spark,BryanCutler/spark,chuckchen/spark,caneGuy/spark,ibm-research-ireland/sparkoscope,tengpeng/spark,LantaoJin/spark,JerryLead/spark,zero323/spark,hvanhovell/spark,goldmedal/spark,sureshthalamati/spark,kissmetrics/spark,witgo/spark,jrshust/spark,mike0sv/spark,zero323/spark,ibm-research-ireland/sparkoscope,facaiy/spark,huang1900/spark,actuaryzhang/spark,jlopezmalla/spark,mzl9039/spark,shaneknapp/spark,holdenk/spark,BryanCutler/spark,ron8hu/spark,JoshRosen/spark,ddna1021/spark,ueshin/apache-spark,yanboliang/spark,shuangshuangwang/spark,facaiy/spark,bravo-zhang/spark,highfei2011/spark,WindCanDie/spark,apache-spark-on-k8s/spark,sureshthalamati/spark,1haodian/spark,witgo/spark,apache/spark,brad-kaiser/spark,guoxiaolongzte/spark,ron8hu/spark,wzhfy/spark,witgo/spark,alunarbeach/spark,sureshthalamati/spark,publicRoman/spark,zuotingbing/spark,techaddict/spark,holdenk/spark,bdrillard/spark,mzl9039/spark,Aegeaner/spark,rekhajoshm/spark,dbtsai/spark,rezasafi/spark,narahari92/spark,debugger87/spark,poffuomo/spark,taroplus/spark,chuckchen/spark,dhruve/spark,WeichenXu123/spark,rikima/spark,esi-mineset/spark,JoshRosen/spark,adrian-ionescu/apache-spark,ddna1021/spark,tejasapatil/spark,saltstar/spark,Aegeaner/spark,tejasapatil/spark,jkbradley/spark,sachintyagi22/spark,shuangshuangwang/spark,1haodian/spark,mzl9039/spark,saltstar/spark,nchammas/spark,mike0sv/spark,loneknightpy/spark,adrian-ionescu/apache-spark,eyalfa/spark,cloud-fan/spark,ddna1021/spark,szhem/spark,sahilTakiar/spark,loneknightpy/spark,hvanhovell/spark,SnappyDataInc/spark,zzcclp/spark,kissmetrics/spark,spark-test/spark,alunarbeach/spark,xuanyuanking/spark,guoxiaolongzte/spark,facaiy/spark,lxsmnv/spark,aosagie/spark,minixalpha/spark,JoshRosen/spark,ueshin/apache-spark,kissmetrics/spark,bOOm-X/spark,map222/spark,saltstar/spark,aray/spark,srowen/spark,dhruve/spark,WindCanDie/spark,byakuinss/spark,cloud-fan/spark,dongjoon-hyun/spark,nchammas/spark,liutang123/spark,tejasapatil/spark,setjet/spark,srowen/spark,sahilTakiar/spark,jlopezmalla/spark,jkbradley/spark,markhamstra/spark,sahilTakiar/spark,nlalevee/spark,milliman/spark,UndeadBaneGitHub/spark,aray/spark,Aegeaner/spark,sureshthalamati/spark,liutang123/spark,ConeyLiu/spark,vinodkc/spark,skonto/spark,aray/spark,someorz/spark,rekhajoshm/spark,WeichenXu123/spark,UndeadBaneGitHub/spark,dongjoon-hyun/spark,Panos-Bletsos/spark-cost-model-optimizer,yanboliang/spark,esi-mineset/spark,map222/spark,saltstar/spark,nilsgrabbert/spark,shuangshuangwang/spark,WeichenXu123/spark,icexelloss/spark,kimoonkim/spark,vinodkc/spark,lxsmnv/spark,dbtsai/spark,joseph-torres/spark,cin/spark,bdrillard/spark,ajaysaini725/spark,srowen/spark,zuotingbing/spark,setjet/spark,chuckchen/spark,wzhfy/spark,bOOm-X/spark,ibm-research-ireland/sparkoscope,highfei2011/spark,rekhajoshm/spark,esi-mineset/spark,bOOm-X/spark,andrewor14/spark,big-pegasus/spark,saturday-shi/spark,kevinyu98/spark,szhem/spark,debugger87/spark,wangyum/spark,cloud-fan/spark,rikima/spark,apache-spark-on-k8s/spark,WeichenXu123/spark,gengliangwang/spark,shubhamchopra/spark,rekhajoshm/spark,zuotingbing/spark,big-pegasus/spark,rezasafi/spark,ConeyLiu/spark,sureshthalamati/spark,jrshust/spark,actuaryzhang/spark,kissmetrics/spark,kiszk/spark,witgo/spark,michalsenkyr/spark,ueshin/apache-spark,zzcclp/spark,maropu/spark,shubhamchopra/spark,xuanyuanking/spark,rednaxelafx/apache-spark,ahnqirage/spark,dbtsai/spark,lvdongr/spark,BryanCutler/spark,shubhamchopra/spark,ioana-delaney/spark,apache-spark-on-k8s/spark,kissmetrics/spark,sachintyagi22/spark,liyichao/spark,techaddict/spark,ueshin/apache-spark,lxsmnv/spark,mzl9039/spark,big-pegasus/spark,jlopezmalla/spark,1haodian/spark,UndeadBaneGitHub/spark,Panos-Bletsos/spark-cost-model-optimizer,UndeadBaneGitHub/spark,panfengfeng/spark,jiangxb1987/spark,apache/spark,jiangxb1987/spark,joseph-torres/spark,rednaxelafx/apache-spark,big-pegasus/spark,jrshust/spark,markhamstra/spark,someorz/spark,saturday-shi/spark,wangmiao1981/spark,BryanCutler/spark,janewangfb/spark,milliman/spark,JerryLead/spark,techaddict/spark,ptkool/spark,poffuomo/spark,WindCanDie/spark,zhouyejoe/spark,sureshthalamati/spark,icexelloss/spark,zzcclp/spark,minixalpha/spark,vinodkc/spark,nlalevee/spark,mike0sv/spark,sachintyagi22/spark,adrian-ionescu/apache-spark,ajaysaini725/spark,byakuinss/spark,cloud-fan/spark,setjet/spark,chuckchen/spark,alunarbeach/spark,dongjoon-hyun/spark,apache-spark-on-k8s/spark,guoxiaolongzte/spark,stanzhai/spark,panfengfeng/spark,debugger87/spark,apache/spark,zzcclp/spark,mahak/spark,mahak/spark,ioana-delaney/spark,ahnqirage/spark,publicRoman/spark,mdespriee/spark,jkbradley/spark,SHASHANKB/spark,caneGuy/spark,kiszk/spark,hvanhovell/spark,kiszk/spark,mahak/spark,jianran/spark,spark-test/spark,panfengfeng/spark,sachintyagi22/spark,taroplus/spark,ahnqirage/spark,byakuinss/spark,nilsgrabbert/spark,spark-test/spark,wangmiao1981/spark,szhem/spark,adrian-ionescu/apache-spark,ron8hu/spark,poffuomo/spark,xuanyuanking/spark,kissmetrics/spark,matthewfranglen/spark,joseph-torres/spark,tejasapatil/spark,debugger87/spark,wangyum/spark,kimoonkim/spark,goldmedal/spark,aray/spark,nchammas/spark,zero323/spark,zuotingbing/spark,highfei2011/spark,jlopezmalla/spark,chuckchen/spark,poffuomo/spark,gengliangwang/spark,jianran/spark,rezasafi/spark,rekhajoshm/spark,wzhfy/spark,WeichenXu123/spark,SHASHANKB/spark,setjet/spark,HyukjinKwon/spark,kiszk/spark,andrewor14/spark,kevinyu98/spark,bravo-zhang/spark,ibm-research-ireland/sparkoscope,SHASHANKB/spark,tejasapatil/spark,ericvandenbergfb/spark,ioana-delaney/spark,zzcclp/spark,SnappyDataInc/spark,MLnick/spark,nilsgrabbert/spark,janewangfb/spark,dongjoon-hyun/spark,BryanCutler/spark,Aegeaner/spark,dongjoon-hyun/spark,huang1900/spark,chuckchen/spark,stanzhai/spark,holdenk/spark,ConeyLiu/spark,hhbyyh/spark,techaddict/spark,dhruve/spark,bdrillard/spark,ConeyLiu/spark,patrick-nicholson/spark,holdenk/spark,jkbradley/spark,liyichao/spark,nilsgrabbert/spark,michalsenkyr/spark,mdespriee/spark,cin/spark,MLnick/spark,esi-mineset/spark,UndeadBaneGitHub/spark,actuaryzhang/spark,zzcclp/spark,dhruve/spark,vinodkc/spark,jrshust/spark,panfengfeng/spark,shaneknapp/spark,ddna1021/spark,dhruve/spark,gengliangwang/spark,panfengfeng/spark,BryanCutler/spark,ajaysaini725/spark,patrick-nicholson/spark,patrick-nicholson/spark,huang1900/spark,janewangfb/spark,ptkool/spark,rikima/spark,ron8hu/spark,dbtsai/spark,hhbyyh/spark,highfei2011/spark,gengliangwang/spark,WindCanDie/spark,taroplus/spark,eyalfa/spark,jiangxb1987/spark,jrshust/spark,jianran/spark,wzhfy/spark,ericvandenbergfb/spark,JoshRosen/spark,darionyaphet/spark,saturday-shi/spark,metamx/spark,goldmedal/spark,joseph-torres/spark,liyichao/spark,pgandhi999/spark,witgo/spark,icexelloss/spark,WindCanDie/spark,WindCanDie/spark,mdespriee/spark,huang1900/spark,ptkool/spark,JoshRosen/spark,bOOm-X/spark,lvdongr/spark,actuaryzhang/spark,goldmedal/spark,ericvandenbergfb/spark,pgandhi999/spark,saltstar/spark,big-pegasus/spark,aray/spark,tengpeng/spark,sahilTakiar/spark,SnappyDataInc/spark,lvdongr/spark,actuaryzhang/spark,nilsgrabbert/spark,UndeadBaneGitHub/spark,vinodkc/spark,kiszk/spark,SHASHANKB/spark,brad-kaiser/spark,aosagie/spark,holdenk/spark,akopich/spark,dbtsai/spark,akopich/spark,ptkool/spark,bdrillard/spark,wangyum/spark,michalsenkyr/spark,narahari92/spark,tengpeng/spark,brad-kaiser/spark,JerryLead/spark,kimoonkim/spark,xflin/spark,apache/spark,zhouyejoe/spark,Aegeaner/spark,LantaoJin/spark,ahnqirage/spark,huang1900/spark,ron8hu/spark,icexelloss/spark,milliman/spark,markhamstra/spark,kimoonkim/spark,pgandhi999/spark,taroplus/spark,patrick-nicholson/spark,zhouyejoe/spark,kissmetrics/spark,LantaoJin/spark,shubhamchopra/spark,rednaxelafx/apache-spark,caneGuy/spark,tengpeng/spark,bdrillard/spark,minixalpha/spark,LantaoJin/spark,cloud-fan/spark,holdenk/spark,yanboliang/spark,ericvandenbergfb/spark,ioana-delaney/spark,WindCanDie/spark,narahari92/spark,techaddict/spark,patrick-nicholson/spark,SHASHANKB/spark,minixalpha/spark,SnappyDataInc/spark,aosagie/spark,szhem/spark,Aegeaner/spark,cin/spark,joseph-torres/spark,ibm-research-ireland/sparkoscope,ConeyLiu/spark,tengpeng/spark,maropu/spark,apache-spark-on-k8s/spark,szhem/spark,metamx/spark,lvdongr/spark,srowen/spark,big-pegasus/spark,xflin/spark,janewangfb/spark,dbtsai/spark,ptkool/spark,loneknightpy/spark,mahak/spark,JerryLead/spark,SHASHANKB/spark,jiangxb1987/spark,rednaxelafx/apache-spark,dhruve/spark,sachintyagi22/spark,narahari92/spark,eyalfa/spark,xflin/spark,yanboliang/spark,ajaysaini725/spark,xuanyuanking/spark,dongjoon-hyun/spark,icexelloss/spark,spark-test/spark,brad-kaiser/spark,shaneknapp/spark,minixalpha/spark,metamx/spark,highfei2011/spark,adrian-ionescu/apache-spark,caneGuy/spark,ioana-delaney/spark,nilsgrabbert/spark,actuaryzhang/spark,mahak/spark,liyichao/spark,mike0sv/spark,liutang123/spark,joseph-torres/spark,LantaoJin/spark,shaneknapp/spark,akopich/spark,icexelloss/spark,brad-kaiser/spark,LantaoJin/spark,someorz/spark,sachintyagi22/spark,metamx/spark,someorz/spark,milliman/spark,stanzhai/spark,map222/spark,map222/spark,ueshin/apache-spark,lvdongr/spark,markhamstra/spark,eyalfa/spark,zero323/spark,aokolnychyi/spark,MLnick/spark,wangmiao1981/spark,alunarbeach/spark,skonto/spark,milliman/spark,MLnick/spark,hvanhovell/spark,publicRoman/spark,michalsenkyr/spark,mike0sv/spark,jiangxb1987/spark,zuotingbing/spark,liyichao/spark,highfei2011/spark,nlalevee/spark,SHASHANKB/spark,spark-test/spark,bOOm-X/spark,wangyum/spark,shuangshuangwang/spark,debugger87/spark,nlalevee/spark,map222/spark,narahari92/spark,BryanCutler/spark,shubhamchopra/spark,saltstar/spark,apache/spark,jlopezmalla/spark,bravo-zhang/spark,mdespriee/spark,1haodian/spark,SnappyDataInc/spark,jlopezmalla/spark,ajaysaini725/spark,jianran/spark,bravo-zhang/spark,liutang123/spark,yanboliang/spark,adrian-ionescu/apache-spark,HyukjinKwon/spark,aokolnychyi/spark,shaneknapp/spark,ajaysaini725/spark,maropu/spark,eyalfa/spark,rikima/spark,caneGuy/spark,hhbyyh/spark,milliman/spark,metamx/spark,ron8hu/spark,facaiy/spark,ddna1021/spark,skonto/spark,ericvandenbergfb/spark,narahari92/spark,nchammas/spark,srowen/spark,jiangxb1987/spark,minixalpha/spark,andrewor14/spark,caneGuy/spark,liyichao/spark,guoxiaolongzte/spark,hhbyyh/spark,publicRoman/spark,holdenk/spark,janewangfb/spark,hhbyyh/spark,setjet/spark,gengliangwang/spark,poffuomo/spark,nlalevee/spark,big-pegasus/spark,wangyum/spark,joseph-torres/spark,darionyaphet/spark,xuanyuanking/spark,cloud-fan/spark,highfei2011/spark,sachintyagi22/spark,icexelloss/spark,liutang123/spark,saturday-shi/spark,stanzhai/spark,loneknightpy/spark,rednaxelafx/apache-spark,zuotingbing/spark,metamx/spark,liutang123/spark,HyukjinKwon/spark,dhruve/spark,wzhfy/spark,UndeadBaneGitHub/spark,HyukjinKwon/spark,maropu/spark,zhouyejoe/spark,jianran/spark,maropu/spark,jkbradley/spark,esi-mineset/spark,kimoonkim/spark,aosagie/spark,kevinyu98/spark,bravo-zhang/spark,andrewor14/spark,lxsmnv/spark,wangyum/spark,goldmedal/spark,mahak/spark,pgandhi999/spark,sahilTakiar/spark,WeichenXu123/spark,shuangshuangwang/spark,cin/spark,tejasapatil/spark,loneknightpy/spark,ahnqirage/spark,milliman/spark,LantaoJin/spark,1haodian/spark,akopich/spark,Panos-Bletsos/spark-cost-model-optimizer,zero323/spark,alunarbeach/spark,shubhamchopra/spark,lxsmnv/spark,ioana-delaney/spark,tengpeng/spark,rezasafi/spark,darionyaphet/spark,hhbyyh/spark,wzhfy/spark,goldmedal/spark,ajaysaini725/spark,szhem/spark,maropu/spark,srowen/spark,mdespriee/spark,apache-spark-on-k8s/spark,zero323/spark,yanboliang/spark,ioana-delaney/spark,sahilTakiar/spark,cin/spark,jrshust/spark,alunarbeach/spark,SnappyDataInc/spark,debugger87/spark,bdrillard/spark,szhem/spark,xuanyuanking/spark,JerryLead/spark,saltstar/spark,patrick-nicholson/spark,shuangshuangwang/spark,Aegeaner/spark,nilsgrabbert/spark,srowen/spark,hvanhovell/spark,vinodkc/spark,saturday-shi/spark,rednaxelafx/apache-spark,liutang123/spark,ahnqirage/spark,1haodian/spark,SnappyDataInc/spark,kevinyu98/spark,panfengfeng/spark,loneknightpy/spark,shaneknapp/spark,MLnick/spark,guoxiaolongzte/spark,dbtsai/spark,bravo-zhang/spark,kevinyu98/spark,JoshRosen/spark,byakuinss/spark,Panos-Bletsos/spark-cost-model-optimizer,narahari92/spark,gengliangwang/spark,taroplus/spark,tejasapatil/spark,rekhajoshm/spark,jianran/spark,saturday-shi/spark,apache/spark,mdespriee/spark,ahnqirage/spark,rezasafi/spark,publicRoman/spark,spark-test/spark,facaiy/spark,jkbradley/spark,1haodian/spark,mike0sv/spark,publicRoman/spark,aosagie/spark,ron8hu/spark,jlopezmalla/spark,markhamstra/spark,xflin/spark,MLnick/spark,someorz/spark,ConeyLiu/spark,goldmedal/spark,panfengfeng/spark,zuotingbing/spark,WeichenXu123/spark,jiangxb1987/spark,huang1900/spark,darionyaphet/spark,apache/spark,pgandhi999/spark,yanboliang/spark,someorz/spark,byakuinss/spark,ericvandenbergfb/spark,wangmiao1981/spark,Panos-Bletsos/spark-cost-model-optimizer,darionyaphet/spark,wangmiao1981/spark,ibm-research-ireland/sparkoscope,gengliangwang/spark,metamx/spark,jkbradley/spark,darionyaphet/spark,rednaxelafx/apache-spark,darionyaphet/spark,kiszk/spark,ddna1021/spark,michalsenkyr/spark,aray/spark,huang1900/spark,maropu/spark,janewangfb/spark,kimoonkim/spark,mzl9039/spark,hhbyyh/spark,markhamstra/spark,bOOm-X/spark,spark-test/spark,techaddict/spark,poffuomo/spark,cloud-fan/spark,akopich/spark,aray/spark,JerryLead/spark,debugger87/spark,stanzhai/spark,hvanhovell/spark,michalsenkyr/spark,nchammas/spark,wangmiao1981/spark,wangyum/spark,JoshRosen/spark,xuanyuanking/spark,Panos-Bletsos/spark-cost-model-optimizer,brad-kaiser/spark,loneknightpy/spark,nlalevee/spark,lxsmnv/spark,ericvandenbergfb/spark,taroplus/spark,brad-kaiser/spark,mahak/spark,eyalfa/spark,patrick-nicholson/spark,jrshust/spark,alunarbeach/spark,mike0sv/spark,kimoonkim/spark,andrewor14/spark,map222/spark,HyukjinKwon/spark,lxsmnv/spark,mzl9039/spark,skonto/spark,chuckchen/spark,poffuomo/spark,mzl9039/spark,caneGuy/spark,mdespriee/spark,stanzhai/spark,witgo/spark,esi-mineset/spark,sureshthalamati/spark,skonto/spark,andrewor14/spark,aokolnychyi/spark,zhouyejoe/spark,aokolnychyi/spark,nchammas/spark,xflin/spark,facaiy/spark,actuaryzhang/spark,zhouyejoe/spark,cin/spark,rezasafi/spark,jianran/spark,stanzhai/spark,vinodkc/spark,MLnick/spark,saturday-shi/spark,JerryLead/spark,byakuinss/spark,kevinyu98/spark,michalsenkyr/spark,Panos-Bletsos/spark-cost-model-optimizer,kevinyu98/spark,liyichao/spark,ueshin/apache-spark,bOOm-X/spark,taroplus/spark,facaiy/spark,rikima/spark,skonto/spark,lvdongr/spark,setjet/spark,xflin/spark,pgandhi999/spark,aokolnychyi/spark,adrian-ionescu/apache-spark,aosagie/spark,ptkool/spark,techaddict/spark,someorz/spark,HyukjinKwon/spark,hvanhovell/spark,aokolnychyi/spark,ibm-research-ireland/sparkoscope,bdrillard/spark,aosagie/spark,witgo/spark,wangmiao1981/spark,zhouyejoe/spark,esi-mineset/spark