PEP: pandas/core round 3 (generic, groupby, index)
yapf with manual modifications for error strings and bad yapf formatting.

No github diffs again!  

There are some pieces of code that I think can be removed but want to confirm:
[index.py](https://github.com/pydata/pandas/blob/master/pandas/core/index.py#L1029) i/j are not used anywhere.
[groupby.py](https://github.com/pydata/pandas/blob/master/pandas/core/groupby.py#L1717) how can this work?  `agg_func` is not defined.
 `index` i/j ok to remove
 yeh that looks not tested, it for a transform on a Panel or greater. I think just raise `NotImplemented` (if the ndim >= 3) & remove the 2nd clause (where you noted). If nothing breaks in the test suite then ok!
 I assume it should be `transform_func(result[:, :, i], chunk, comp_ids, accum)`
 k, I can do that.
 @rockg I would keep style changes and code clean-up (as in removal of unused code or a change of actual code) strictly separated (at least in a separate commit). Just to be sure, in case we overlooked something, then it is not burried in a gigantic commit for which you can't see the diff.
 The main goal of this exercise is to make flake8 pass and cleanup some style were necessary.  What I cleaned out were unused variables reported by flake8 and, as a result, I don't see a problem including that here.
 @rockg I've been putting `# noqa` on these lines and adding a `TODO` comment to come back and investigate
 This is especially important in unit tests where I suspect that there are some test cases that may have skipped some intended checks
 Okay, that seems reasonable.
 ok, rebasing `core/groupby.py` is going to be painful for #11841 but go ahead (my touches are mostly reorg anyhow)
 Is this good to merge?
 I'll leave this to @jreback with the pending rebase
 if u want to remove groupby.py from this would be great (I'll catch that in resample fixes)

otherwise lgtm
 thanks! we're almost there =) 
