DataFrames.jl
DataFrames.jl copied to clipboard
Add rename!(::DataFrame, ::Pair{Regex, SubstitutionString}) method
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.