Closed markfairbanks closed 2 years ago
@mjkarlsen What if we built it to work for all 3 of these? 🤔
df = tp.Tibble(x = range(3), y = range(3))
# Option A: dplyr-like
df.rename(new_x = 'x',
new_y = 'y')
# Option B: dplyr-like with strings
df.rename('new_x', 'x',
'new_y', 'y')
# Option C: pandas-like
df.rename({'x': 'new_x',
'y': 'new_y'})
That way we wouldn't need to choose an API 😂
Love it
Or should we just do options 1 & 3?
Should the syntax be the same as
pl.DataFrame.rename
? Currently polars mimics pandas syntax. Or should it be something that attempts to mimic tidyverse syntax?Note: polars also has a .rename_col() with syntax df.rename_col('old', 'new').