Skip to content

type Series.info #1119

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

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,13 @@ class Series(IndexOpsMixin[S1], NDFrame):
axis: AxisIndex = ...,
fill_value: object | None = ...,
) -> Series: ...
def info(
self,
verbose: bool | None = ...,
buf: WriteBuffer[str] = ...,
memory_usage: bool | Literal["deep"] | None = ...,
show_counts: bool | None = ...,
) -> None: ...
def memory_usage(self, index: _bool = ..., deep: _bool = ...) -> int: ...
def isin(self, values: Iterable | Series[S1] | dict) -> Series[_bool]: ...
def between(
Expand Down
16 changes: 16 additions & 0 deletions tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import datetime
from decimal import Decimal
from enum import Enum
import io
from pathlib import Path
import platform
import re
Expand Down Expand Up @@ -3581,3 +3582,18 @@ def test_series_reindex_like() -> None:
pd.Series,
np.integer,
)


def test_info() -> None:
s = pd.Series()
check(assert_type(s.info(verbose=True), None), type(None))
check(assert_type(s.info(verbose=False), None), type(None))
check(assert_type(s.info(verbose=None), None), type(None))
check(assert_type(s.info(buf=io.StringIO()), None), type(None))
check(assert_type(s.info(memory_usage=True), None), type(None))
check(assert_type(s.info(memory_usage=False), None), type(None))
check(assert_type(s.info(memory_usage="deep"), None), type(None))
check(assert_type(s.info(memory_usage=None), None), type(None))
check(assert_type(s.info(show_counts=True), None), type(None))
check(assert_type(s.info(show_counts=False), None), type(None))
check(assert_type(s.info(show_counts=None), None), type(None))