Skip to content

Commit 01fd802

Browse files
author
Marco Gorelli
committed
wip
1 parent c7bfb94 commit 01fd802

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

pandas/core/frame.py

+12
Original file line numberDiff line numberDiff line change
@@ -2223,6 +2223,18 @@ def to_html(
22232223
encoding=encoding,
22242224
)
22252225

2226+
@Substitution(
2227+
klass="DataFrame",
2228+
type_sub=" and columns",
2229+
max_cols_sub="""
2230+
max_cols : int, optional
2231+
When to switch from the verbose to the truncated output. If the
2232+
DataFrame has more than `max_cols` columns, the truncated output
2233+
is used. By default, the setting in
2234+
``pandas.options.display.max_info_columns`` is used.
2235+
""",
2236+
)
2237+
@Appender(NDFrame.info.__doc__)
22262238
def info(
22272239
self, verbose=None, buf=None, max_cols=None, memory_usage=None, null_counts=None
22282240
):

pandas/core/generic.py

+5-13
Original file line numberDiff line numberDiff line change
@@ -1721,23 +1721,14 @@ def keys(self):
17211721
"""
17221722
return self._info_axis
17231723

1724-
# @Substitution(klass=self.__name__, type_sub=" and column dtypes"*(self._typ
1725-
# =='dataframe'),
1726-
# max_cols_sub="""
1727-
# max_cols : int, optional
1728-
# When to switch from the verbose to the truncated output. If the
1729-
# DataFrame has more than `max_cols` columns, the truncated output
1730-
# is used. By default, the setting in
1731-
# ``pandas.options.display.max_info_columns`` is used.
1732-
# """*(self._typ=='dataframe'), )
17331724
def info(
17341725
self, verbose=None, buf=None, max_cols=None, memory_usage=None, null_counts=None
17351726
) -> None:
17361727
"""
17371728
Print a concise summary of a %(klass)s.
17381729
17391730
This method prints information about a %(klass)s including
1740-
the index dtype%(type_sub), non-null values and memory usage.
1731+
the index dtype%(type_sub)s, non-null values and memory usage.
17411732
17421733
Parameters
17431734
----------
@@ -1747,7 +1738,8 @@ def info(
17471738
buf : writable buffer, defaults to sys.stdout
17481739
Where to send the output. By default, the output is printed to
17491740
sys.stdout. Pass a writable buffer if you need to further process
1750-
the output.%(max_cols_sub)s
1741+
the output.
1742+
%(max_cols_sub)s
17511743
memory_usage : bool, str, optional
17521744
Specifies whether total memory usage of the %(klass)s
17531745
elements (including the index) should be displayed. By default,
@@ -1775,9 +1767,9 @@ def info(
17751767
17761768
See Also
17771769
--------
1778-
DataFrame.describe: Generate descriptive statistics of %(klass)s
1770+
DataFrame.describe: Generate descriptive statistics of DataFrame
17791771
columns.
1780-
%(klass)s.memory_usage: Memory usage of %(klass)s%(memory_sub)s.
1772+
DataFrame.memory_usage: Memory usage of DataFrame columns.
17811773
17821774
Examples
17831775
--------

pandas/core/series.py

+2
Original file line numberDiff line numberDiff line change
@@ -4137,6 +4137,8 @@ def replace(
41374137
method=method,
41384138
)
41394139

4140+
@Substitution(klass="Series", type_sub="", max_cols_sub="")
4141+
@Appender(NDFrame.info.__doc__)
41404142
def info(
41414143
self, verbose=None, buf=None, max_cols=None, memory_usage=None, null_counts=None
41424144
):

0 commit comments

Comments
 (0)