toCollection(ofRows) {
        return ofRows
            ? Array.from(this)
            : Array.from(this).map((row) => row.toDict());
    }
Convert DataFrame into Array of dictionnaries. You can also return Rows instead of dictionnaries.
@param {Boolean} [ofRows] Return a collection of Rows instead of dictionnaries.
@returns {Array} The DataFrame converted into Array of dictionnaries (or Rows).
@example
df.toCollection()