Skip to content

Commit 0f6e2c3

Browse files
Marco GorelliMarcoGorelli
Marco Gorelli
authored andcommitted
wip
1 parent ac86a1b commit 0f6e2c3

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

pandas/core/frame.py

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

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

pandas/core/generic.py

+5-13
Original file line numberDiff line numberDiff line change
@@ -1740,23 +1740,14 @@ def keys(self):
17401740
"""
17411741
return self._info_axis
17421742

1743-
# @Substitution(klass=self.__name__, type_sub=" and column dtypes"*(self._typ
1744-
# =='dataframe'),
1745-
# max_cols_sub="""
1746-
# max_cols : int, optional
1747-
# When to switch from the verbose to the truncated output. If the
1748-
# DataFrame has more than `max_cols` columns, the truncated output
1749-
# is used. By default, the setting in
1750-
# ``pandas.options.display.max_info_columns`` is used.
1751-
# """*(self._typ=='dataframe'), )
17521743
def info(
17531744
self, verbose=None, buf=None, max_cols=None, memory_usage=None, null_counts=None
17541745
) -> None:
17551746
"""
17561747
Print a concise summary of a %(klass)s.
17571748
17581749
This method prints information about a %(klass)s including
1759-
the index dtype%(type_sub), non-null values and memory usage.
1750+
the index dtype%(type_sub)s, non-null values and memory usage.
17601751
17611752
Parameters
17621753
----------
@@ -1766,7 +1757,8 @@ def info(
17661757
buf : writable buffer, defaults to sys.stdout
17671758
Where to send the output. By default, the output is printed to
17681759
sys.stdout. Pass a writable buffer if you need to further process
1769-
the output.%(max_cols_sub)s
1760+
the output.
1761+
%(max_cols_sub)s
17701762
memory_usage : bool, str, optional
17711763
Specifies whether total memory usage of the %(klass)s
17721764
elements (including the index) should be displayed. By default,
@@ -1794,9 +1786,9 @@ def info(
17941786
17951787
See Also
17961788
--------
1797-
DataFrame.describe: Generate descriptive statistics of %(klass)s
1789+
DataFrame.describe: Generate descriptive statistics of DataFrame
17981790
columns.
1799-
%(klass)s.memory_usage: Memory usage of %(klass)s%(memory_sub)s.
1791+
DataFrame.memory_usage: Memory usage of DataFrame columns.
18001792
18011793
Examples
18021794
--------

pandas/core/series.py

+3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
is_empty_data,
7474
sanitize_array,
7575
)
76+
from pandas.core.generic import NDFrame
7677
from pandas.core.indexers import maybe_convert_indices
7778
from pandas.core.indexes.accessors import CombinedDatetimelikeProperties
7879
from pandas.core.indexes.api import (
@@ -4181,6 +4182,8 @@ def replace(
41814182
method=method,
41824183
)
41834184

4185+
@Substitution(klass="Series", type_sub="", max_cols_sub="")
4186+
@Appender(NDFrame.info.__doc__)
41844187
def info(
41854188
self, verbose=None, buf=None, max_cols=None, memory_usage=None, null_counts=None
41864189
):

0 commit comments

Comments
 (0)