@@ -111,7 +111,6 @@ def _get_mem_usage(self, deep: bool) -> int:
111
111
mem_usage : int
112
112
Object's total memory usage in bytes.
113
113
"""
114
- pass
115
114
116
115
@abstractmethod
117
116
def _get_ids_and_dtypes (self ) -> Tuple ["Index" , "Series" ]:
@@ -125,7 +124,6 @@ def _get_ids_and_dtypes(self) -> Tuple["Index", "Series"]:
125
124
dtypes : Series
126
125
Dtype of each of the DataFrame's columns.
127
126
"""
128
- pass
129
127
130
128
@abstractmethod
131
129
def _verbose_repr (
@@ -145,7 +143,6 @@ def _verbose_repr(
145
143
show_counts : bool
146
144
If True, count of non-NA cells for each column will be appended to `lines`.
147
145
"""
148
- pass
149
146
150
147
@abstractmethod
151
148
def _non_verbose_repr (self , lines : List [str ], ids : "Index" ) -> None :
@@ -159,7 +156,6 @@ def _non_verbose_repr(self, lines: List[str], ids: "Index") -> None:
159
156
ids : Index
160
157
The DataFrame's column names.
161
158
"""
162
- pass
163
159
164
160
def info (self ) -> None :
165
161
"""
@@ -296,7 +292,6 @@ def _verbose_repr(
296
292
len_id = len (pprint_thing (id_head ))
297
293
space_num = max (max_id , len_id ) + col_space
298
294
299
- header = _put_str (id_head , space_num ) + _put_str (column_head , space )
300
295
if show_counts :
301
296
counts = self .data .count ()
302
297
if col_count != len (counts ): # pragma: no cover
@@ -319,17 +314,26 @@ def _verbose_repr(
319
314
len_dtype = len (dtype_header )
320
315
max_dtypes = max (len (pprint_thing (k )) for k in dtypes )
321
316
space_dtype = max (len_dtype , max_dtypes )
322
- header += _put_str (count_header , space_count ) + _put_str (
323
- dtype_header , space_dtype
324
- )
325
317
318
+ header = "" .join (
319
+ [
320
+ _put_str (id_head , space_num ),
321
+ _put_str (column_head , space ),
322
+ _put_str (count_header , space_count ),
323
+ _put_str (dtype_header , space_dtype ),
324
+ ]
325
+ )
326
326
lines .append (header )
327
- lines .append (
328
- _put_str ("-" * len_id , space_num )
329
- + _put_str ("-" * len_column , space )
330
- + _put_str ("-" * len_count , space_count )
331
- + _put_str ("-" * len_dtype , space_dtype )
327
+
328
+ top_separator = "" .join (
329
+ [
330
+ _put_str ("-" * len_id , space_num ),
331
+ _put_str ("-" * len_column , space ),
332
+ _put_str ("-" * len_count , space_count ),
333
+ _put_str ("-" * len_dtype , space_dtype ),
334
+ ]
332
335
)
336
+ lines .append (top_separator )
333
337
334
338
for i , col in enumerate (ids ):
335
339
dtype = dtypes [i ]
0 commit comments