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

functional interface for deleting columns #1378

Closed
tpapp opened this issue Mar 7, 2018 · 3 comments
Closed

functional interface for deleting columns #1378

tpapp opened this issue Mar 7, 2018 · 3 comments

Comments

@tpapp
Copy link

tpapp commented Mar 7, 2018

We have delete!, but DataFrame is particularly nice for a functional style when subsetting/transforming columns, so it would make sense to have something like

dropcols(df::AbstractDataFrame, cols) = df[setdiff(names(df), cols)]
@nalimilan
Copy link
Member

I guess we could support this via negated indexing instead of adding a new function?

@tbeason
Copy link
Contributor

tbeason commented Mar 21, 2018

I define this function at the top of literally any script where I am using DataFrames (although I'll probably switch to your version because it is was more compact).

dropcol(d,args...) = @select(d, filter(x -> !(x in args),names(d)))

@bkamins bkamins mentioned this issue Jan 15, 2019
31 tasks
@bkamins
Copy link
Member

bkamins commented Jul 25, 2019

We now support Not.

@bkamins bkamins closed this as completed Jul 25, 2019
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

4 participants