def explode(self, column: Name) -> 'DataFrame':
    "\n        Transform each element of a list-like to a row, replicating index values.\n\n        Parameters\n        ----------\n        column : str or tuple\n            Column to explode.\n\n        Returns\n        -------\n        DataFrame\n            Exploded lists to rows of the subset columns;\n            index will be duplicated for these rows.\n\n        See Also\n        --------\n        DataFrame.unstack : Pivot a level of the (necessarily hierarchical)\n            index labels.\n        DataFrame.melt : Unpivot a DataFrame from wide format to long format.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'A': [[1, 2, 3], [], [3, 4]], 'B': 1})\n        >>> df\n                   A  B\n        0  [1, 2, 3]  1\n        1         []  1\n        2     [3, 4]  1\n\n        >>> df.explode('A')\n             A  B\n        0  1.0  1\n        0  2.0  1\n        0  3.0  1\n        1  NaN  1\n        2  3.0  1\n        2  4.0  1\n        "
    from pyspark.pandas.series import Series
    if (not is_name_like_value(column)):
        raise TypeError('column must be a scalar')
    psdf: DataFrame = DataFrame(self._internal.resolved_copy)
    psser = psdf[column]
    if (not isinstance(psser, Series)):
        raise ValueError(('The column %s is not unique. For a multi-index, the label must be a tuple with elements corresponding to each level.' % name_like_string(column)))
    if (not isinstance(psser.spark.data_type, ArrayType)):
        return self.copy()
    sdf = psdf._internal.spark_frame.withColumn(psser._internal.data_spark_column_names[0], F.explode_outer(psser.spark.column))
    data_fields = psdf._internal.data_fields.copy()
    idx = psdf._internal.column_labels.index(psser._column_label)
    field = data_fields[idx]
    spark_type = cast(ArrayType, field.spark_type).elementType
    dtype = spark_type_to_pandas_dtype(spark_type)
    data_fields[idx] = field.copy(dtype=dtype, spark_type=spark_type, nullable=True)
    internal = psdf._internal.with_new_sdf(sdf, data_fields=data_fields)
    return DataFrame(internal)
Transform each element of a list-like to a row, replicating index values.

Parameters
----------
column : str or tuple
    Column to explode.

Returns
-------
DataFrame
    Exploded lists to rows of the subset columns;
    index will be duplicated for these rows.

See Also
--------
DataFrame.unstack : Pivot a level of the (necessarily hierarchical)
    index labels.
DataFrame.melt : Unpivot a DataFrame from wide format to long format.

Examples
--------
>>> df = ps.DataFrame({'A': [[1, 2, 3], [], [3, 4]], 'B': 1})
>>> df
           A  B
0  [1, 2, 3]  1
1         []  1
2     [3, 4]  1

>>> df.explode('A')
     A  B
0  1.0  1
0  2.0  1
0  3.0  1
1  NaN  1
2  3.0  1
2  4.0  1
def explode(self, column: Name) -> 'DataFrame':
    "\n        Transform each element of a list-like to a row, replicating index values.\n\n        Parameters\n        ----------\n        column : str or tuple\n            Column to explode.\n\n        Returns\n        -------\n        DataFrame\n            Exploded lists to rows of the subset columns;\n            index will be duplicated for these rows.\n\n        See Also\n        --------\n        DataFrame.unstack : Pivot a level of the (necessarily hierarchical)\n            index labels.\n        DataFrame.melt : Unpivot a DataFrame from wide format to long format.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'A': [[1, 2, 3], [], [3, 4]], 'B': 1})\n        >>> df\n                   A  B\n        0  [1, 2, 3]  1\n        1         []  1\n        2     [3, 4]  1\n\n        >>> df.explode('A')\n             A  B\n        0  1.0  1\n        0  2.0  1\n        0  3.0  1\n        1  NaN  1\n        2  3.0  1\n        2  4.0  1\n        "
    from pyspark.pandas.series import Series
    if (not is_name_like_value(column)):
        raise TypeError('column must be a scalar')
    psdf: DataFrame = DataFrame(self._internal.resolved_copy)
    psser = psdf[column]
    if (not isinstance(psser, Series)):
        raise ValueError(('The column %s is not unique. For a multi-index, the label must be a tuple with elements corresponding to each level.' % name_like_string(column)))
    if (not isinstance(psser.spark.data_type, ArrayType)):
        return self.copy()
    sdf = psdf._internal.spark_frame.withColumn(psser._internal.data_spark_column_names[0], F.explode_outer(psser.spark.column))
    data_fields = psdf._internal.data_fields.copy()
    idx = psdf._internal.column_labels.index(psser._column_label)
    field = data_fields[idx]
    spark_type = cast(ArrayType, field.spark_type).elementType
    dtype = spark_type_to_pandas_dtype(spark_type)
    data_fields[idx] = field.copy(dtype=dtype, spark_type=spark_type, nullable=True)
    internal = psdf._internal.with_new_sdf(sdf, data_fields=data_fields)
    return DataFrame(internal)