@final
def _cython_op_ndim_compat(self, values: np.ndarray, *, min_count: int, ngroups: int, comp_ids: np.ndarray, mask: (np.ndarray | None)=None, result_mask: (np.ndarray | None)=None, **kwargs) -> np.ndarray:
    if (values.ndim == 1):
        values2d = values[None, :]
        if (mask is not None):
            mask = mask[None, :]
        if (result_mask is not None):
            result_mask = result_mask[None, :]
        res = self._call_cython_op(values2d, min_count=min_count, ngroups=ngroups, comp_ids=comp_ids, mask=mask, result_mask=result_mask, **kwargs)
        if (res.shape[0] == 1):
            return res[0]
        return res.T
    return self._call_cython_op(values, min_count=min_count, ngroups=ngroups, comp_ids=comp_ids, mask=mask, result_mask=result_mask, **kwargs)
@final
def _cython_op_ndim_compat(self, values: np.ndarray, *, min_count: int, ngroups: int, comp_ids: np.ndarray, mask: (np.ndarray | None)=None, result_mask: (np.ndarray | None)=None, **kwargs) -> np.ndarray:
    if (values.ndim == 1):
        values2d = values[None, :]
        if (mask is not None):
            mask = mask[None, :]
        if (result_mask is not None):
            result_mask = result_mask[None, :]
        res = self._call_cython_op(values2d, min_count=min_count, ngroups=ngroups, comp_ids=comp_ids, mask=mask, result_mask=result_mask, **kwargs)
        if (res.shape[0] == 1):
            return res[0]
        return res.T
    return self._call_cython_op(values, min_count=min_count, ngroups=ngroups, comp_ids=comp_ids, mask=mask, result_mask=result_mask, **kwargs)