-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
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()]).
Metadata
Metadata
Assignees
Labels
No labels