code: def _prep_spark_sql_groupby(self):
          
          # Strip the index info
          non_index_columns = filter(lambda x: x not in self._prdd._index_names,
                                     self._prdd._column_names())
          self._grouped_spark_sql = (self._prdd.to_spark_sql()
                                     .select(non_index_columns)
                                     .groupBy(self._by))
          self._columns = filter(lambda x: x != self._by,
                                 non_index_columns)
docs: Used Spark SQL group approach