Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace col names by index or current value #49

Closed
HarlanH opened this issue Aug 8, 2012 · 3 comments
Closed

replace col names by index or current value #49

HarlanH opened this issue Aug 8, 2012 · 3 comments

Comments

@HarlanH
Copy link
Contributor

HarlanH commented Aug 8, 2012

something like:

rename!(df, quote
  x1 = "cat"
  x2 = "dog"
end)

rename!(df, {"x1"="cat", "x2"="dog"})

rename!(df, {1="cat", 2="dog"})

rename!(df, ["cat", "dog"]) # must be same length as ncol(df)

rename!(df, function) # allow functional generation of new colname from old one

Note that column name groups should be updated appropriately.

@HarlanH
Copy link
Contributor Author

HarlanH commented Aug 8, 2012

oops, didn't see that this was done already! replace_names(df, ...)

@HarlanH HarlanH closed this as completed Aug 8, 2012
@StefanKarpinski
Copy link
Member

I would comment that for rename!(df, function) at least, if the function argument goes first, then you can write this:

rename!(df) do name
 # compute new name from old name
end

I realize that in this case that's a somewhat awkward order for the arguments. Just thought I'd point it out.

@tshort
Copy link
Contributor

tshort commented Aug 8, 2012

rename! might be a better name.

nalimilan pushed a commit that referenced this issue Jul 8, 2017
ID in example output was duplicated. Make ID distinct from row number, to avoid confusion. Align examples. Parallel to #1179
nalimilan pushed a commit that referenced this issue Jul 8, 2017
ID in example output was duplicated. Make ID distinct from row number, to avoid confusion. Align examples. Parallel to #1179
nalimilan pushed a commit that referenced this issue Jul 8, 2017
ID in example output was duplicated. Make ID distinct from row number, to avoid confusion. Align examples. Parallel to #1179
nalimilan pushed a commit that referenced this issue Jul 8, 2017
ID in example output was duplicated. Make ID distinct from row number, to avoid confusion. Align examples. Parallel to #1179
nalimilan pushed a commit that referenced this issue Jul 8, 2017
ID in example output was duplicated. Make ID distinct from row number, to avoid confusion. Align examples. Parallel to #1179
nalimilan pushed a commit that referenced this issue Jul 8, 2017
ID in example output was duplicated. Make ID distinct from row number, to avoid confusion. Align examples. Parallel to #1179
rofinn pushed a commit that referenced this issue Aug 17, 2017
ID in example output was duplicated. Make ID distinct from row number, to avoid confusion. Align examples. Parallel to #1179
nalimilan pushed a commit that referenced this issue Aug 25, 2017
ID in example output was duplicated. Make ID distinct from row number, to avoid confusion. Align examples. Parallel to #1179
quinnj pushed a commit that referenced this issue Sep 2, 2017
ID in example output was duplicated. Make ID distinct from row number, to avoid confusion. Align examples. Parallel to #1179
quinnj pushed a commit that referenced this issue Sep 2, 2017
ID in example output was duplicated. Make ID distinct from row number, to avoid confusion. Align examples. Parallel to #1179
nalimilan pushed a commit that referenced this issue May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants