def toDF(self, schema=None, sampleRatio=None):
    "\n        Converts current :class:`RDD` into a :class:`DataFrame`\n\n        This is a shorthand for ``spark.createDataFrame(rdd, schema, sampleRatio)``\n\n        :param schema: a :class:`pyspark.sql.types.StructType` or list of names of columns\n        :param samplingRatio: the sample ratio of rows used for inferring\n        :return: a DataFrame\n\n        >>> rdd.toDF().collect()\n        [Row(name=u'Alice', age=1)]\n        "
    return sparkSession.createDataFrame(self, schema, sampleRatio)
Converts current :class:`RDD` into a :class:`DataFrame`

This is a shorthand for ``spark.createDataFrame(rdd, schema, sampleRatio)``

:param schema: a :class:`pyspark.sql.types.StructType` or list of names of columns
:param samplingRatio: the sample ratio of rows used for inferring
:return: a DataFrame

>>> rdd.toDF().collect()
[Row(name=u'Alice', age=1)]
def toDF(self, schema=None, sampleRatio=None):
    "\n        Converts current :class:`RDD` into a :class:`DataFrame`\n\n        This is a shorthand for ``spark.createDataFrame(rdd, schema, sampleRatio)``\n\n        :param schema: a :class:`pyspark.sql.types.StructType` or list of names of columns\n        :param samplingRatio: the sample ratio of rows used for inferring\n        :return: a DataFrame\n\n        >>> rdd.toDF().collect()\n        [Row(name=u'Alice', age=1)]\n        "
    return sparkSession.createDataFrame(self, schema, sampleRatio)