BUG: Lambda function returns KeyError in DataFrameGroupBy.agg
- [x] closes #27519 
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

emm, not sure, could take a look, but probably will change few functions as well. This looks indeed a bit complex, but I found out there are quite few issues around it: 
1. allow lambda in `groupby.agg`
2. correctly order different lambda functions and dataset which involves different lambdas on same column, mixed lambda and aggfunc.
3. potentially could remove duplication warning, right now, if `gb.agg(a=(col, 'min'), b=(col, 'min'))` would raise an error, but `gb.agg(a=(col, 'min'), b=(col, lambda x: np.min(x)))` won't. Users might actually want to do it, so that they could use `b` column for other ops while based on `np.min` result. There is also an error test in `test_aggregate.py` which could be potentially removed.
But I will take a look tomorrow to see if I can come up with a simpler version. @TomAugspurger  Hello @charlesdong1991! 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 2019-08-26 18:03:11 UTC Hi, @TomAugspurger I simplified the code quite a lot, but still in `_normalize_keyword_aggregation` because i feel it is better than changing `_maybe_mangle_lambdas`. Right now, hopefully it wont look too complex. And I also add more complex test cases to prove the lambda works in different scenarios and order of columns is correct. It looks all good locally so feel free to take a look. ^^ wanna give a follow-up review? @TomAugspurger  Thanks!