Skip to content

Commit 2986c87

Browse files
authored
type Series.info (#1119)
1 parent a5a40a7 commit 2986c87

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

pandas-stubs/core/series.pyi

+7
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,13 @@ class Series(IndexOpsMixin[S1], NDFrame):
12251225
axis: AxisIndex = ...,
12261226
fill_value: object | None = ...,
12271227
) -> Series: ...
1228+
def info(
1229+
self,
1230+
verbose: bool | None = ...,
1231+
buf: WriteBuffer[str] = ...,
1232+
memory_usage: bool | Literal["deep"] | None = ...,
1233+
show_counts: bool | None = ...,
1234+
) -> None: ...
12281235
def memory_usage(self, index: _bool = ..., deep: _bool = ...) -> int: ...
12291236
def isin(self, values: Iterable | Series[S1] | dict) -> Series[_bool]: ...
12301237
def between(

tests/test_series.py

+16
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import datetime
99
from decimal import Decimal
1010
from enum import Enum
11+
import io
1112
from pathlib import Path
1213
import platform
1314
import re
@@ -3581,3 +3582,18 @@ def test_series_reindex_like() -> None:
35813582
pd.Series,
35823583
np.integer,
35833584
)
3585+
3586+
3587+
def test_info() -> None:
3588+
s = pd.Series()
3589+
check(assert_type(s.info(verbose=True), None), type(None))
3590+
check(assert_type(s.info(verbose=False), None), type(None))
3591+
check(assert_type(s.info(verbose=None), None), type(None))
3592+
check(assert_type(s.info(buf=io.StringIO()), None), type(None))
3593+
check(assert_type(s.info(memory_usage=True), None), type(None))
3594+
check(assert_type(s.info(memory_usage=False), None), type(None))
3595+
check(assert_type(s.info(memory_usage="deep"), None), type(None))
3596+
check(assert_type(s.info(memory_usage=None), None), type(None))
3597+
check(assert_type(s.info(show_counts=True), None), type(None))
3598+
check(assert_type(s.info(show_counts=False), None), type(None))
3599+
check(assert_type(s.info(show_counts=None), None), type(None))

0 commit comments

Comments
 (0)