@@ -1297,14 +1297,14 @@ def reindex_indexer(
1297
1297
raise IndexError ("Requested axis not found in manager" )
1298
1298
1299
1299
if axis == 0 :
1300
- new_blocks = self ._slice_take_blocks_ax0 (indexer , fill_tuple = ( fill_value ,) )
1300
+ new_blocks = self ._slice_take_blocks_ax0 (indexer , fill_value = fill_value )
1301
1301
else :
1302
1302
new_blocks = [
1303
1303
blk .take_nd (
1304
1304
indexer ,
1305
1305
axis = axis ,
1306
- fill_tuple = (
1307
- fill_value if fill_value is not None else blk .fill_value ,
1306
+ fill_value = (
1307
+ fill_value if fill_value is not None else blk .fill_value
1308
1308
),
1309
1309
)
1310
1310
for blk in self .blocks
@@ -1315,7 +1315,7 @@ def reindex_indexer(
1315
1315
1316
1316
return type (self ).from_blocks (new_blocks , new_axes )
1317
1317
1318
- def _slice_take_blocks_ax0 (self , slice_or_indexer , fill_tuple = None ):
1318
+ def _slice_take_blocks_ax0 (self , slice_or_indexer , fill_value = lib . no_default ):
1319
1319
"""
1320
1320
Slice/take blocks along axis=0.
1321
1321
@@ -1325,7 +1325,7 @@ def _slice_take_blocks_ax0(self, slice_or_indexer, fill_tuple=None):
1325
1325
-------
1326
1326
new_blocks : list of Block
1327
1327
"""
1328
- allow_fill = fill_tuple is not None
1328
+ allow_fill = fill_value is not lib . no_default
1329
1329
1330
1330
sl_type , slobj , sllen = _preprocess_slice_or_indexer (
1331
1331
slice_or_indexer , self .shape [0 ], allow_fill = allow_fill
@@ -1337,16 +1337,15 @@ def _slice_take_blocks_ax0(self, slice_or_indexer, fill_tuple=None):
1337
1337
if sl_type in ("slice" , "mask" ):
1338
1338
return [blk .getitem_block (slobj , new_mgr_locs = slice (0 , sllen ))]
1339
1339
elif not allow_fill or self .ndim == 1 :
1340
- if allow_fill and fill_tuple [ 0 ] is None :
1340
+ if allow_fill and fill_value is None :
1341
1341
_ , fill_value = maybe_promote (blk .dtype )
1342
- fill_tuple = (fill_value ,)
1343
1342
1344
1343
return [
1345
1344
blk .take_nd (
1346
1345
slobj ,
1347
1346
axis = 0 ,
1348
1347
new_mgr_locs = slice (0 , sllen ),
1349
- fill_tuple = fill_tuple ,
1348
+ fill_value = fill_value ,
1350
1349
)
1351
1350
]
1352
1351
@@ -1369,8 +1368,7 @@ def _slice_take_blocks_ax0(self, slice_or_indexer, fill_tuple=None):
1369
1368
blocks = []
1370
1369
for blkno , mgr_locs in libinternals .get_blkno_placements (blknos , group = True ):
1371
1370
if blkno == - 1 :
1372
- # If we've got here, fill_tuple was not None.
1373
- fill_value = fill_tuple [0 ]
1371
+ # If we've got here, fill_value was not lib.no_default
1374
1372
1375
1373
blocks .append (
1376
1374
self ._make_na_block (placement = mgr_locs , fill_value = fill_value )
@@ -1391,10 +1389,7 @@ def _slice_take_blocks_ax0(self, slice_or_indexer, fill_tuple=None):
1391
1389
else :
1392
1390
blocks .append (
1393
1391
blk .take_nd (
1394
- blklocs [mgr_locs .indexer ],
1395
- axis = 0 ,
1396
- new_mgr_locs = mgr_locs ,
1397
- fill_tuple = None ,
1392
+ blklocs [mgr_locs .indexer ], axis = 0 , new_mgr_locs = mgr_locs ,
1398
1393
)
1399
1394
)
1400
1395
0 commit comments