Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TYP: Fix typing of frame.explode #43834

Merged
merged 2 commits into from
Oct 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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
Expand Down Expand Up @@ -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(
Expand Down