Skip to content

Commit 8c621de

Browse files
committed
type Series.info
1 parent 4976e11 commit 8c621de

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

pandas-stubs/core/series.pyi

+8
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,14 @@ class Series(IndexOpsMixin[S1], NDFrame):
12241224
axis: AxisIndex = ...,
12251225
fill_value: object | None = ...,
12261226
) -> Series: ...
1227+
def info(
1228+
self,
1229+
verbose: bool | None = ...,
1230+
buf: WriteBuffer[str] = ...,
1231+
max_cols: int | None = ...,
1232+
memory_usage: bool | Literal["deep"] | None = ...,
1233+
show_counts: bool | None = ...,
1234+
) -> None: ...
12271235
def memory_usage(self, index: _bool = ..., deep: _bool = ...) -> int: ...
12281236
def isin(self, values: Iterable | Series[S1] | dict) -> Series[_bool]: ...
12291237
def between(

tests/test_series.py

+17
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,19 @@ 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(max_cols=None), None), type(None))
3594+
check(assert_type(s.info(memory_usage=True), None), type(None))
3595+
check(assert_type(s.info(memory_usage=False), None), type(None))
3596+
check(assert_type(s.info(memory_usage="deep"), None), type(None))
3597+
check(assert_type(s.info(memory_usage=None), None), type(None))
3598+
check(assert_type(s.info(show_counts=True), None), type(None))
3599+
check(assert_type(s.info(show_counts=False), None), type(None))
3600+
check(assert_type(s.info(show_counts=None), None), type(None))

0 commit comments

Comments
 (0)