Skip to content

Commit 1b5b813

Browse files
jbrockmendeljreback
authored andcommitted
separate out concat, managers (#22028)
1 parent b975455 commit 1b5b813

File tree

4 files changed

+2577
-2544
lines changed

4 files changed

+2577
-2544
lines changed

pandas/_libs/internals.pyx

+26
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ cdef extern from "compat_helper.h":
1919
Py_ssize_t *slicelength) except -1
2020

2121

22+
from algos import ensure_int64
23+
24+
2225
cdef class BlockPlacement:
2326
# __slots__ = '_as_slice', '_as_array', '_len'
2427
cdef slice _as_slice
@@ -436,3 +439,26 @@ def get_blkno_indexers(int64_t[:] blknos, bint group=True):
436439
i += 1
437440

438441
yield blkno, result
442+
443+
444+
def get_blkno_placements(blknos, blk_count, group=True):
445+
"""
446+
447+
Parameters
448+
----------
449+
blknos : array of int64
450+
blk_count : int
451+
group : bool
452+
453+
Returns
454+
-------
455+
iterator
456+
yield (BlockPlacement, blkno)
457+
458+
"""
459+
460+
blknos = ensure_int64(blknos)
461+
462+
# FIXME: blk_count is unused, but it may avoid the use of dicts in cython
463+
for blkno, indexer in get_blkno_indexers(blknos, group):
464+
yield blkno, BlockPlacement(indexer)

0 commit comments

Comments
 (0)