I am having a pyspark dataframe as
DOCTOR | PATIENT
JOHN | SAM
JOHN | PETER
JOHN | ROBIN
BEN | ROSE
BEN | GRAY
and need to concatenate patient names by rows so that I get the output like:
DOCTOR | PATIENT
JOHN | SAM, PETER, ROBIN
BEN | ROSE, GRAY
Can anybody help me regarding creating this dataframe in pyspark ?
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…