diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 613a4cc829514..5f4207d0985ef 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8201,7 +8201,7 @@ def stack(self, level: Level = -1, dropna: bool = True): def explode( self, - column: Scalar | tuple | list[Scalar | tuple], + column: IndexLabel, ignore_index: bool = False, ) -> DataFrame: """ @@ -8211,7 +8211,7 @@ def explode( Parameters ---------- - column : Scalar or tuple or list thereof + column : IndexLabel Column(s) to explode. For multiple columns, specify a non-empty list with each element be str or tuple, and all specified columns their list-like data @@ -8293,7 +8293,7 @@ def explode( if not self.columns.is_unique: raise ValueError("columns must be unique") - columns: list[Scalar | tuple] + columns: list[Hashable] if is_scalar(column) or isinstance(column, tuple): columns = [column] elif isinstance(column, list) and all(