141141
142142from pandas .io .common import get_filepath_or_buffer
143143from pandas .io .formats import console , format as fmt
144- from pandas .io .formats .info import info
144+ from pandas .io .formats .info import DataFrameInfo
145145import pandas .plotting
146146
147147if TYPE_CHECKING :
@@ -2462,11 +2462,11 @@ def to_html(
24622462 <class 'pandas.core.frame.DataFrame'>
24632463 RangeIndex: 5 entries, 0 to 4
24642464 Data columns (total 3 columns):
2465- # Column Non-Null Count Dtype
2465+ # Column Non-Null Count Dtype
24662466 --- ------ -------------- -----
2467- 0 int_col 5 non-null int64
2468- 1 text_col 5 non-null object
2469- 2 float_col 5 non-null float64
2467+ 0 int_col 5 non-null int64
2468+ 1 text_col 5 non-null object
2469+ 2 float_col 5 non-null float64
24702470 dtypes: float64(1), int64(1), object(1)
24712471 memory usage: 248.0+ bytes
24722472
@@ -2505,23 +2505,23 @@ def to_html(
25052505 <class 'pandas.core.frame.DataFrame'>
25062506 RangeIndex: 1000000 entries, 0 to 999999
25072507 Data columns (total 3 columns):
2508- # Column Non-Null Count Dtype
2508+ # Column Non-Null Count Dtype
25092509 --- ------ -------------- -----
2510- 0 column_1 1000000 non-null object
2511- 1 column_2 1000000 non-null object
2512- 2 column_3 1000000 non-null object
2510+ 0 column_1 1000000 non-null object
2511+ 1 column_2 1000000 non-null object
2512+ 2 column_3 1000000 non-null object
25132513 dtypes: object(3)
25142514 memory usage: 22.9+ MB
25152515
25162516 >>> df.info(memory_usage='deep')
25172517 <class 'pandas.core.frame.DataFrame'>
25182518 RangeIndex: 1000000 entries, 0 to 999999
25192519 Data columns (total 3 columns):
2520- # Column Non-Null Count Dtype
2520+ # Column Non-Null Count Dtype
25212521 --- ------ -------------- -----
2522- 0 column_1 1000000 non-null object
2523- 1 column_2 1000000 non-null object
2524- 2 column_3 1000000 non-null object
2522+ 0 column_1 1000000 non-null object
2523+ 1 column_2 1000000 non-null object
2524+ 2 column_3 1000000 non-null object
25252525 dtypes: object(3)
25262526 memory usage: 188.8 MB"""
25272527 ),
@@ -2532,7 +2532,7 @@ def to_html(
25322532 DataFrame.memory_usage: Memory usage of DataFrame columns."""
25332533 ),
25342534 )
2535- @doc (info )
2535+ @doc (DataFrameInfo . info )
25362536 def info (
25372537 self ,
25382538 verbose : Optional [bool ] = None ,
@@ -2541,7 +2541,9 @@ def info(
25412541 memory_usage : Optional [Union [bool , str ]] = None ,
25422542 null_counts : Optional [bool ] = None ,
25432543 ) -> None :
2544- return info (self , verbose , buf , max_cols , memory_usage , null_counts )
2544+ return DataFrameInfo (
2545+ self , verbose , buf , max_cols , memory_usage , null_counts
2546+ ).info ()
25452547
25462548 def memory_usage (self , index = True , deep = False ) -> Series :
25472549 """
0 commit comments