@since(2.0)
def range(self, start, end=None, step=1, numPartitions=None):
    '\n        Create a :class:`DataFrame` with single :class:`pyspark.sql.types.LongType` column named\n        ``id``, containing elements in a range from ``start`` to ``end`` (exclusive) with\n        step value ``step``.\n\n        :param start: the start value\n        :param end: the end value (exclusive)\n        :param step: the incremental step (default: 1)\n        :param numPartitions: the number of partitions of the DataFrame\n        :return: :class:`DataFrame`\n\n        >>> spark.range(1, 7, 2).collect()\n        [Row(id=1), Row(id=3), Row(id=5)]\n\n        If only one argument is specified, it will be used as the end value.\n\n        >>> spark.range(3).collect()\n        [Row(id=0), Row(id=1), Row(id=2)]\n        '
    if (numPartitions is None):
        numPartitions = self._sc.defaultParallelism
    if (end is None):
        jdf = self._jsparkSession.range(0, int(start), int(step), int(numPartitions))
    else:
        jdf = self._jsparkSession.range(int(start), int(end), int(step), int(numPartitions))
    return DataFrame(jdf, self._wrapped)
Create a :class:`DataFrame` with single :class:`pyspark.sql.types.LongType` column named
``id``, containing elements in a range from ``start`` to ``end`` (exclusive) with
step value ``step``.

:param start: the start value
:param end: the end value (exclusive)
:param step: the incremental step (default: 1)
:param numPartitions: the number of partitions of the DataFrame
:return: :class:`DataFrame`

>>> spark.range(1, 7, 2).collect()
[Row(id=1), Row(id=3), Row(id=5)]

If only one argument is specified, it will be used as the end value.

>>> spark.range(3).collect()
[Row(id=0), Row(id=1), Row(id=2)]
@since(2.0)
def range(self, start, end=None, step=1, numPartitions=None):
    '\n        Create a :class:`DataFrame` with single :class:`pyspark.sql.types.LongType` column named\n        ``id``, containing elements in a range from ``start`` to ``end`` (exclusive) with\n        step value ``step``.\n\n        :param start: the start value\n        :param end: the end value (exclusive)\n        :param step: the incremental step (default: 1)\n        :param numPartitions: the number of partitions of the DataFrame\n        :return: :class:`DataFrame`\n\n        >>> spark.range(1, 7, 2).collect()\n        [Row(id=1), Row(id=3), Row(id=5)]\n\n        If only one argument is specified, it will be used as the end value.\n\n        >>> spark.range(3).collect()\n        [Row(id=0), Row(id=1), Row(id=2)]\n        '
    if (numPartitions is None):
        numPartitions = self._sc.defaultParallelism
    if (end is None):
        jdf = self._jsparkSession.range(0, int(start), int(step), int(numPartitions))
    else:
        jdf = self._jsparkSession.range(int(start), int(end), int(step), int(numPartitions))
    return DataFrame(jdf, self._wrapped)