-
-
Notifications
You must be signed in to change notification settings - Fork 157
Description
I was looking at df.drop to make it work with pyright strict mode.
The type hints are these:
@overload
def drop(
self,
labels: Hashable | Sequence[Hashable] | Index = ...,
*,
axis: Axis = ...,
index: Hashable | Sequence[Hashable] | Index = ...,
columns: Hashable | Sequence[Hashable] | Index = ...,
level: Level | None = ...,
inplace: Literal[True],
errors: IgnoreRaise = ...,
) -> None: ...
@overload
def drop(
self,
labels: Hashable | Sequence[Hashable] | Index = ...,
*,
axis: Axis = ...,
index: Hashable | Sequence[Hashable] | Index = ...,
columns: Hashable | Sequence[Hashable] | Index = ...,
level: Level | None = ...,
inplace: Literal[False] = ...,
errors: IgnoreRaise = ...,
) -> DataFrame: ...
@overload
def drop(
self,
labels: Hashable | Sequence[Hashable] | Index = ...,
*,
axis: Axis = ...,
index: Hashable | Sequence[Hashable] | Index = ...,
columns: Hashable | Sequence[Hashable] | Index = ...,
level: Level | None = ...,
inplace: bool = ...,
errors: IgnoreRaise = ...,
) -> DataFrame | None: ...
However, if "labels" is specified, neither index, nor columns should be.
Additionally, one of "labels", "index", "columns" has to be specified.
Metadata
Metadata
Assignees
Labels
No labels