@@ -92,6 +92,72 @@ def values(self) -> np.ndarray:
92
92
"""
93
93
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
94
94
95
+ def info (
96
+ self ,
97
+ verbose : bool | None = None ,
98
+ buf = None ,
99
+ max_cols : int | None = None ,
100
+ memory_usage : bool | None = None ,
101
+ show_counts : bool | None = None ,
102
+ ) -> None :
103
+ """
104
+ Print a concise summary of a DataFrame.
105
+
106
+ This method prints information about a DataFrame including
107
+ the index dtypeand columns, non-null values and memory usage.
108
+
109
+ Args:
110
+ verbose (bool, optional):
111
+ Whether to print the full summary. By default, the setting in
112
+ ``pandas.options.display.max_info_columns`` is followed.
113
+ buf (writable buffer, defaults to sys.stdout):
114
+ Where to send the output. By default, the output is printed to
115
+ sys.stdout. Pass a writable buffer if you need to further process
116
+ the output.
117
+ max_cols (int, optional):
118
+ When to switch from the verbose to the truncated output. If the
119
+ DataFrame has more than `max_cols` columns, the truncated output
120
+ is used. By default, the setting in
121
+ ``pandas.options.display.max_info_columns`` is used.
122
+ memory_usage (bool, optional):
123
+ Specifies whether total memory usage of the DataFrame
124
+ elements (including the index) should be displayed. By default,
125
+ this follows the ``pandas.options.display.memory_usage`` setting.
126
+ True always show memory usage. False never shows memory usage.
127
+ Memory estimation is made based in column dtype and number of rows
128
+ assuming values consume the same memory amount for corresponding dtypes.
129
+ show_counts (bool, optional):
130
+ Whether to show the non-null counts. By default, this is shown
131
+ only if the DataFrame is smaller than
132
+ ``pandas.options.display.max_info_rows`` and
133
+ ``pandas.options.display.max_info_columns``. A value of True always
134
+ shows the counts, and False never shows the counts.
135
+
136
+ Returns:
137
+ None: This method prints a summary of a DataFrame and returns None."""
138
+ raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
139
+
140
+ def memory_usage (self , index : bool = True ):
141
+ """
142
+ Return the memory usage of each column in bytes.
143
+
144
+ The memory usage can optionally include the contribution of
145
+ the index and elements of `object` dtype.
146
+
147
+ This value is displayed in `DataFrame.info` by default. This can be
148
+ suppressed by setting ``pandas.options.display.memory_usage`` to False.
149
+
150
+ Args:
151
+ index (bool, default True):
152
+ Specifies whether to include the memory usage of the DataFrame's
153
+ index in returned Series. If ``index=True``, the memory usage of
154
+ the index is the first item in the output.
155
+
156
+ Returns:
157
+ Series: A Series whose index is the original column names and whose values is the memory usage of each column in bytes.
158
+ """
159
+ raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
160
+
95
161
# ----------------------------------------------------------------------
96
162
# IO methods (to / from other formats)
97
163
def to_numpy (self , dtype = None , copy = False , na_value = None , ** kwargs ) -> np .ndarray :
0 commit comments