Skip to content

Commit

Permalink
simplify the groupby
Browse files Browse the repository at this point in the history
  • Loading branch information
briangu committed Jan 5, 2024
1 parent 794a5d1 commit 4c73131
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions klongpy/monads.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ def eval_monad_groupby(a):
if len(q) == 0:
return q
a = q.argsort()
u = np.unique(q[a], return_index=True)
r = np.split(a, u[1][1:])
r = np.split(a, np.where(q[a][1:] != q[a][:-1])[0] + 1)
return np.asarray(r, dtype=object)


Expand Down

0 comments on commit 4c73131

Please sign in to comment.