141
141
142
142
from pandas .io .common import get_filepath_or_buffer
143
143
from pandas .io .formats import console , format as fmt
144
- from pandas .io .formats .info import info
144
+ from pandas .io .formats .info import DataFrameInfo
145
145
import pandas .plotting
146
146
147
147
if TYPE_CHECKING :
@@ -2462,11 +2462,11 @@ def to_html(
2462
2462
<class 'pandas.core.frame.DataFrame'>
2463
2463
RangeIndex: 5 entries, 0 to 4
2464
2464
Data columns (total 3 columns):
2465
- # Column Non-Null Count Dtype
2465
+ # Column Non-Null Count Dtype
2466
2466
--- ------ -------------- -----
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
2470
2470
dtypes: float64(1), int64(1), object(1)
2471
2471
memory usage: 248.0+ bytes
2472
2472
@@ -2505,23 +2505,23 @@ def to_html(
2505
2505
<class 'pandas.core.frame.DataFrame'>
2506
2506
RangeIndex: 1000000 entries, 0 to 999999
2507
2507
Data columns (total 3 columns):
2508
- # Column Non-Null Count Dtype
2508
+ # Column Non-Null Count Dtype
2509
2509
--- ------ -------------- -----
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
2513
2513
dtypes: object(3)
2514
2514
memory usage: 22.9+ MB
2515
2515
2516
2516
>>> df.info(memory_usage='deep')
2517
2517
<class 'pandas.core.frame.DataFrame'>
2518
2518
RangeIndex: 1000000 entries, 0 to 999999
2519
2519
Data columns (total 3 columns):
2520
- # Column Non-Null Count Dtype
2520
+ # Column Non-Null Count Dtype
2521
2521
--- ------ -------------- -----
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
2525
2525
dtypes: object(3)
2526
2526
memory usage: 188.8 MB"""
2527
2527
),
@@ -2532,7 +2532,7 @@ def to_html(
2532
2532
DataFrame.memory_usage: Memory usage of DataFrame columns."""
2533
2533
),
2534
2534
)
2535
- @doc (info )
2535
+ @doc (DataFrameInfo . info )
2536
2536
def info (
2537
2537
self ,
2538
2538
verbose : Optional [bool ] = None ,
@@ -2541,7 +2541,9 @@ def info(
2541
2541
memory_usage : Optional [Union [bool , str ]] = None ,
2542
2542
null_counts : Optional [bool ] = None ,
2543
2543
) -> 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 ()
2545
2547
2546
2548
def memory_usage (self , index = True , deep = False ) -> Series :
2547
2549
"""
0 commit comments