[BUG]: Groupy and Resample miscalculated aggregation
- [x] closes #27343
- [x] closes #33548
- [x] closes #35275
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

I think I found a solution for this issue. We used `obj.index` to get the Index values. In case of resample `obj.index` had the original index. This index was not necessarily a RangeIndex of course -> resulted in a IndexError. In case of a RangeIndex the object `self._grouper` may have been resorted -> Wrong elements were selected. The object `self.obj` stored the original DataFrame, but already sorted in the first go around (is overwritten later). I stored the mapping from original index to a new synthetic RangeIndex (sorted after the grouping column). This allows us to replace the Index of obj in a way, that the take function works.

Hello @phofl! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:







There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2020-09-09 07:42:50 UTC @jreback  would you mind looking over my changes?

I passed the indices of the single groups through now. This information is lost otherwise. If there is a better way piping this through to this function please let me know.

We could sort self._grouper immediately after storing it. Did not know, which would be preferred.

The issue is matching a Series without the date column with the corresponding DatetimeIndex, which was resorted (probably).
 the .grouper property holds a subclass of a Grouper (BinGrouper in this case) which has all of the info

TimeGrouper is just a simple class that is used to create the others 

pls step thru and look at object at each stage  self.grouper or self._grouper respectively is a DateTimeIndex not a grouper in this case. This does not contain any indices. 

I look through tomorrow anyway, but I already looked into self.grouper, I could not find the necessary information. This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. closing in favor of https://github.com/pandas-dev/pandas/pull/37905