I'd like to rename columns with a Dictionary or a Function. @rename only allows for static assignment (easily... I still don't fully have my head around interpolation).
Would it be possible to add @rename_with(x) which passes x to DataFrames.rename, where x is interpolated automatically? One small quirk of doing this is that the position of the DataFrame is different for different methods of DataFrames.rename:
rename(df, dict)
# or
rename(f, df)
The later supports do syntax, but it would mean some type detection would need to happen to figure out which method to call with @rename_with.
Edit: As I wrote this, it might make sense to add @select_with(x) which does a similar thing (returns df[ : , x()]).
I'd like to rename columns with a
Dictionaryor aFunction.@renameonly allows for static assignment (easily... I still don't fully have my head around interpolation).Would it be possible to add
@rename_with(x)which passesxtoDataFrames.rename, wherexis interpolated automatically? One small quirk of doing this is that the position of theDataFrameis different for different methods ofDataFrames.rename:The later supports
dosyntax, but it would mean some type detection would need to happen to figure out which method to call with@rename_with.Edit: As I wrote this, it might make sense to add
@select_with(x)which does a similar thing (returnsdf[ : , x()]).