Convert apply('name') to a direct method invocation
ProprietaryWhen apply() on a pandas DataFrame or Series receives a string literal naming a reduction like 'sum' or 'mean', rewrite the call as a direct method invocation on the object. It only fires where the receiver's type resolves. It leaves alone any other name, which apply may resolve to a property or a numpy function, and a call holding comments.
org. openrewrite. python. cleanup. ReplaceApplyWithMethodCallmod run . --recipe= org. openrewrite. python. cleanup. ReplaceApplyWithMethodCallInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.