Skip to content

Commit d326198

Browse files
committed
Move INFO_DOCSTRING back to BaseInfo and fix reference
1 parent 7e21334 commit d326198

File tree

1 file changed

+48
-53
lines changed

1 file changed

+48
-53
lines changed

pandas/io/formats/info.py

+48-53
Original file line numberDiff line numberDiff line change
@@ -166,57 +166,6 @@
166166
}
167167

168168

169-
INFO_DOCSTRING = dedent(
170-
"""\
171-
Print a concise summary of a {klass}.
172-
173-
This method prints information about a {klass} including
174-
the index dtype{type_sub}, non-null values and memory usage.
175-
{version_added_sub}\
176-
177-
Parameters
178-
----------
179-
data : {klass}
180-
{klass} to print information about.
181-
verbose : bool, optional
182-
Whether to print the full summary. By default, the setting in
183-
``pandas.options.display.max_info_columns`` is followed.
184-
buf : writable buffer, defaults to sys.stdout
185-
Where to send the output. By default, the output is printed to
186-
sys.stdout. Pass a writable buffer if you need to further process
187-
the output.
188-
{max_cols_sub}
189-
memory_usage : bool, str, optional
190-
Specifies whether total memory usage of the {klass}
191-
elements (including the index) should be displayed. By default,
192-
this follows the ``pandas.options.display.memory_usage`` setting.
193-
194-
True always show memory usage. False never shows memory usage.
195-
A value of 'deep' is equivalent to "True with deep introspection".
196-
Memory usage is shown in human-readable units (base-2
197-
representation). Without deep introspection a memory estimation is
198-
made based in column dtype and number of rows assuming values
199-
consume the same memory amount for corresponding dtypes. With deep
200-
memory introspection, a real memory usage calculation is performed
201-
at the cost of computational resources.
202-
{show_counts_sub}s
203-
204-
Returns
205-
-------
206-
None
207-
This method prints a summary of a {klass} and returns None.
208-
209-
See Also
210-
--------
211-
{see_also_sub}
212-
213-
Examples
214-
--------
215-
{examples_sub}
216-
"""
217-
)
218-
219-
220169
def _put_str(s: str | Dtype, space: int) -> str:
221170
"""
222171
Make string of specified length, padding to the right if necessary.
@@ -363,7 +312,53 @@ def render(
363312
verbose: bool | None,
364313
show_counts: bool | None,
365314
) -> None:
366-
pass
315+
"""
316+
Print a concise summary of a {klass}.
317+
318+
This method prints information about a {klass} including
319+
the index dtype{type_sub}, non-null values and memory usage.
320+
{version_added_sub}\
321+
322+
Parameters
323+
----------
324+
data : {klass}
325+
{klass} to print information about.
326+
verbose : bool, optional
327+
Whether to print the full summary. By default, the setting in
328+
``pandas.options.display.max_info_columns`` is followed.
329+
buf : writable buffer, defaults to sys.stdout
330+
Where to send the output. By default, the output is printed to
331+
sys.stdout. Pass a writable buffer if you need to further process
332+
the output.
333+
{max_cols_sub}
334+
memory_usage : bool, str, optional
335+
Specifies whether total memory usage of the {klass}
336+
elements (including the index) should be displayed. By default,
337+
this follows the ``pandas.options.display.memory_usage`` setting.
338+
339+
True always show memory usage. False never shows memory usage.
340+
A value of 'deep' is equivalent to "True with deep introspection".
341+
Memory usage is shown in human-readable units (base-2
342+
representation). Without deep introspection a memory estimation is
343+
made based in column dtype and number of rows assuming values
344+
consume the same memory amount for corresponding dtypes. With deep
345+
memory introspection, a real memory usage calculation is performed
346+
at the cost of computational resources.
347+
{show_counts_sub}s
348+
349+
Returns
350+
-------
351+
None
352+
This method prints a summary of a {klass} and returns None.
353+
354+
See Also
355+
--------
356+
{see_also_sub}
357+
358+
Examples
359+
--------
360+
{examples_sub}
361+
"""
367362

368363

369364
class DataFrameInfo(BaseInfo):
@@ -426,7 +421,7 @@ def memory_usage_bytes(self) -> int:
426421
return self.data.memory_usage(index=True, deep=deep).sum()
427422

428423
@doc(
429-
INFO_DOCSTRING,
424+
BaseInfo.render.__doc__,
430425
klass="DataFrame",
431426
type_sub=" and columns",
432427
max_cols_sub=frame_max_cols_sub,

0 commit comments

Comments
 (0)