Skip to content

Commit

Permalink
type Series.info (#1119)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli authored Feb 14, 2025
1 parent a5a40a7 commit 2986c87
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1225,6 +1225,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))

0 comments on commit 2986c87

Please sign in to comment.