REF: consolidate casting in groupby agg_series
- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry

These tests are for the low-level cython func, and this PR makes the
casting from object take place after the cython call instead of within it.
Nothing user facing.

On Mon, May 3, 2021 at 8:17 AM Jeff Reback ***@***.***> wrote:

> ***@***.**** requested changes on this pull request.
> ------------------------------
>
> In pandas/tests/groupby/test_bin_groupby.py
> <https://github.com/pandas-dev/pandas/pull/41273#discussion_r625159891>:
>
> > @@ -20,7 +20,7 @@ def test_series_grouper():
>      grouper = libreduction.SeriesGrouper(obj, np.mean, labels, 2)
>      result, counts = grouper.get_result()
>
> -    expected = np.array([obj[3:6].mean(), obj[6:].mean()])
> +    expected = np.array([obj[3:6].mean(), obj[6:].mean()], dtype=object)
>
> these look like internal tests, but is anything user facing changed? (no
> looks like)?
>
> why are these now returning object? (e.g. can you just remove the
> cast_back above)?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/pandas-dev/pandas/pull/41273#pullrequestreview-650449427>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AB5UM6EBWNTRNKVI3MBDDBLTL25AHANCNFSM437ZXAQA>
> .
>
