I have a pySpark dataframe and want to make a several sub dataframes using groupBy operation. For example, I have a DF like
       subject  relation object 
DF =      s1       p       o1
          s2       p       o2
          s3       q       o3
          s4       q       o4
and want to have a sub dataframes with same relation names like
       subject  relation object 
DF1 =      s1       p       o1
           s2       p       o2
       subject  relation object 
DF2 =      s3       q       o3
           s4       q       o4
I would be appreciated if you can share your idea how to make sub dataframes using groupBy().
Thanks