Skip to content

Commit 7b9bd17

Browse files
committed
resampling fixes
1 parent 5da3722 commit 7b9bd17

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dask_groupby/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ def rechunk_for_blockwise(array, axis, labels):
236236
This only works when the groups are sequential (e.g. labels = [0,0,0,1,1,1,1,2,2]).
237237
Such patterns occur when using ``.resample``.
238238
"""
239+
labels = factorize_((labels,), axis=None)[0]
239240
chunks = array.chunks[axis]
240241
# TODO: lru_cache this?
241242
newchunks = _get_optimal_chunks_for_groups(chunks, labels)
@@ -643,7 +644,7 @@ def _npg_combine(
643644
x_chunk = [x_chunk]
644645

645646
unique_groups = np.unique(
646-
tuple(flatten(deepmap(lambda x: np.atleast_1d(x["groups"].squeeze()).tolist(), x_chunk)))
647+
tuple(flatten(deepmap(lambda x: list(np.atleast_1d(x["groups"].squeeze())), x_chunk)))
647648
)
648649

649650
def reindex_intermediates(x):

0 commit comments

Comments
 (0)