85
85
import pandas .core .missing as missing
86
86
from pandas .core .nanops import nanpercentile
87
87
88
- from pandas .io .formats .printing import pprint_thing
89
-
90
88
91
89
class Block (PandasObject ):
92
90
"""
@@ -159,7 +157,8 @@ def _check_ndim(self, values, ndim):
159
157
160
158
@property
161
159
def _holder (self ):
162
- """The array-like that can hold the underlying values.
160
+ """
161
+ The array-like that can hold the underlying values.
163
162
164
163
None for 'Block', overridden by subclasses that don't
165
164
use an ndarray.
@@ -284,16 +283,11 @@ def __repr__(self) -> str:
284
283
# don't want to print out all of the items here
285
284
name = type (self ).__name__
286
285
if self ._is_single_block :
287
-
288
286
result = f"{ name } : { len (self )} dtype: { self .dtype } "
289
-
290
287
else :
291
288
292
- shape = " x " .join (pprint_thing (s ) for s in self .shape )
293
- result = (
294
- f"{ name } : { pprint_thing (self .mgr_locs .indexer )} , "
295
- f"{ shape } , dtype: { self .dtype } "
296
- )
289
+ shape = " x " .join (str (s ) for s in self .shape )
290
+ result = f"{ name } : { self .mgr_locs .indexer } , { shape } , dtype: { self .dtype } "
297
291
298
292
return result
299
293
@@ -319,10 +313,7 @@ def getitem_block(self, slicer, new_mgr_locs=None):
319
313
As of now, only supports slices that preserve dimensionality.
320
314
"""
321
315
if new_mgr_locs is None :
322
- if isinstance (slicer , tuple ):
323
- axis0_slicer = slicer [0 ]
324
- else :
325
- axis0_slicer = slicer
316
+ axis0_slicer = slicer [0 ] if isinstance (slicer , tuple ) else slicer
326
317
new_mgr_locs = self .mgr_locs [axis0_slicer ]
327
318
328
319
new_values = self ._slice (slicer )
0 commit comments