kieferk / dfply

dplyr-style piping operations for pandas dataframes
GNU General Public License v3.0
889 stars 103 forks source link

Create `filter_by()` alias for `mask()` #37

Closed TariqAHassan closed 6 years ago

TariqAHassan commented 6 years ago

While I initially did not understand why mask() was not named filter, it soon occurred to me that this would overwrite Python's own filter() function. I think it was a good call not to do that.

This said, filter is part of the dplyr "grammer". So, I think a better name for mask would be filter_by(). This pull request simply creates an alias instead of renaming mask(), though I do think that it is a change worth considering.

Note: I also ran a linter on your (very elegant) code. If you'd prefer, I can make that a separate pull request.

kieferk commented 6 years ago

Sounds good, I have no issue with having a filter_by alias. I will merge it to the master branch now.

If you want to submit a separate formatting PR I'm happy to check it out! Thanks