BUG: Groupby with as_index=True causes incorrect summarization
- [x] closes #26321 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Given that this is my first commit to pandas, I'm not quite sure whether what I'm doing is what is expected. I just added the example from the bugreport as a test, is that ok? Should additional things be tested? Tested differently? Please, let me know. I addressed the comments, could you please have a look again? I don't know why there suddenly are test failures, the particular test that failed (pandas/tests/base/test_unique.py::test_unique_bad_unicode), passes on my setup and is nowhere near the test that I added. @vivikelapoutre can you try merging master & repushing to see if that fixes it? > 
> 
> @vivikelapoutre can you try merging master & repushing to see if that fixes it?

Thank you, that worked indeed. Thanks @vivikelapoutre!