go-gota / gota

Gota: DataFrames and data wrangling in Go (Golang)
Other
2.98k stars 277 forks source link

Delete/Drop Function #34

Closed benjmarshall closed 6 years ago

benjmarshall commented 6 years ago

Have you considered the addition of a delete/remove/drop type function? I've started to use your library and have come across a use case where it would be advantageous to be able to explicitly identify a column to be removed. Currently I would have to get all of the column names, find which index I want to remove, and then generate a series of indexes excluding that one to perform a Select operation.

I am happy to have a first pass at adding this type of function if there is a consensus it would be helpful.

kniren commented 6 years ago

Hello!

This was easy enough to implement and I think is a nice utility function to have.

You can find the implementation on the dev branch, please test it to see if it suits your use cases and let me know.

I called the method Deselect, although probably Drop is a better name. If all is good, you can send a PR with the name change and I will merge it, I'm a bit starved for time lately.

Best, Alex

benjmarshall commented 6 years ago

Thanks, that seems to do the trick! I'll update the function name at submit a PR shortly.

benjmarshall commented 6 years ago

Have submitted PR #35 to change the function to Drop.

kniren commented 6 years ago

PR merged, thank you!