Backport PR #35633 on branch 1.1.x (BUG: DataFrame.apply with func altering row in-place)
Backport PR #35633: BUG: DataFrame.apply with func altering row in-place
doctest failure occurs on other PRs e.g. https://github.com/pandas-dev/pandas/pull/28509#issuecomment-671720219 so merging