Open
Description
Hi,
I've been using method chaining to write most of my data wrangling processes and one of the things that bother me a bit is to modify column names as part of the chain.
With a static list of column names, df.set_axis
can do the work. But in the following cases, I have to use df.columns=xxx
to modify the names.
- Header comes from a row
- Combine multi-indexed header into a single-index (e.g. concatenate levels)
- Expand single-indexed header to multi-indexed (e.g. split via some delimiter)
I wonder if these could be achieved by allowing df.set_axis
to take callables, something similar to df.assign
.