-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Labels
Description
Is your feature request related to a problem?
I was wondering why a groupby("foo").first() call was going so slowly — I think we run a python loop for this, rather than calling into flox:
Lines 1218 to 1231 in b9780e7
| def _first_or_last(self, op, skipna, keep_attrs): | |
| if all( | |
| isinstance(maybe_slice, slice) | |
| and (maybe_slice.stop == maybe_slice.start + 1) | |
| for maybe_slice in self.encoded.group_indices | |
| ): | |
| # NB. this is currently only used for reductions along an existing | |
| # dimension | |
| return self._obj | |
| if keep_attrs is None: | |
| keep_attrs = _get_keep_attrs(default=True) | |
| return self.reduce( | |
| op, dim=[self._group_dim], skipna=skipna, keep_attrs=keep_attrs | |
| ) |
Describe the solution you'd like
Could we call into flox? Numbagg has the routines...
Describe alternatives you've considered
No response
Additional context
No response