diff --git a/pandas-stubs/core/series.pyi b/pandas-stubs/core/series.pyi index 70df87ab4..99b2fadcd 100644 --- a/pandas-stubs/core/series.pyi +++ b/pandas-stubs/core/series.pyi @@ -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( diff --git a/tests/test_series.py b/tests/test_series.py index dd7d360f4..4cb19d494 100644 --- a/tests/test_series.py +++ b/tests/test_series.py @@ -8,6 +8,7 @@ import datetime from decimal import Decimal from enum import Enum +import io from pathlib import Path import platform import re @@ -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))