JuliaData / DataAPI.jl

A data-focused namespace for packages to share functions
Other
33 stars 13 forks source link

Define `rename` and `rename!` for modifying column names? #57

Open junyuan-chen opened 2 years ago

junyuan-chen commented 2 years ago

I thought it would be useful to define rename and rename! in DataAPI.jl for functions that achieve purposes similar to what they do for DataFrames.jl.

bkamins commented 2 years ago

What other package wants to use these names? Note that DataAPI.jl in general just defines function names, mostly without providing implementations. The purpose of this package is to avoid function name clashes. Maybe you also want to propose adding these to https://github.com/JuliaData/TableOperations.jl?

junyuan-chen commented 2 years ago

I am considering having such functions for ReadStatTables.jl. At this moment, renaming column names is not immediately needed. However, with future implementation of writing support for the Stata/SAS/SPSS data files, modifying column names in-place should be useful. For example, one may load data from a file and rename the columns before saving them somewhere else. Directly changing the column names avoid the need of moving metadata carried with the columns around for a simple task like this.

I just realized that there was some discussion here.

bkamins commented 2 years ago

OK - if you want to add them in ReadStatTables.jl then it makes sense to add them to DataAPI.jl.

@nalimilan - do you see any issues with this?