We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5df4a75 commit 1c21660Copy full SHA for 1c21660
flox/core.py
@@ -554,7 +554,7 @@ def factorize_(
554
else:
555
if expect is not None and reindex:
556
sorter = np.argsort(expect)
557
- groups = expect[(sorter,)] if sort else expect
+ groups = np.array(expect[(sorter,)]) if sort else expect
558
idx = np.searchsorted(expect, flat, sorter=sorter)
559
mask = ~np.isin(flat, expect) | isnull(flat) | (idx == len(expect))
560
if not sort:
@@ -566,6 +566,7 @@ def factorize_(
566
567
if isinstance(flat, np.ndarray):
568
idx, groups = pd.factorize(flat, sort=sort)
569
+ groups = np.array(groups)
570
571
assert sort
572
groups, idx = np.unique(flat, return_inverse=True)
0 commit comments