listcomp -> for-loop (listcopms create a new scope in py3), bypass Attri...

...buteError on Pandas.str

Pushing https://github.com/pydata/pandas/pull/5530 upstream, so that the numpydoc version in Pandas can stay in sync.