DataFrames.jl icon indicating copy to clipboard operation
DataFrames.jl copied to clipboard

Add rename!(::DataFrame, ::Pair{Regex, SubstitutionString}) method

Open kescobo opened this issue 7 months ago • 0 comments

It is often desirable to be able to rename columns according to a simple regular expression / replacement. I'm imagining that rename[!](df, reg=> sub) would essentially be shorthand for rename[!](col-> replace(col, reg=>sub), df).

I suspect there may be a bunch of nuances with the order of operations that I'm not thinking of, and using the function form is not so bad, so perhaps this isn't worth it, but I thought I'd open the issue anyway.

kescobo avatar Nov 13 '23 18:11 kescobo