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

[feature] Implement tidyselect #27

Open
talegari opened this issue Jun 29, 2022 · 4 comments
Open

[feature] Implement tidyselect #27

talegari opened this issue Jun 29, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@talegari
Copy link
Member

Column names should also support functions along with strings:
df.select(['a', 'b', 'c']) # regular
df.select(['a', 'b', starts_with('c'), ends_with('d'), contains('some_regex')])

tidyselect should power all the methods that take column_names as the input.

@talegari talegari added the enhancement New feature or request label Jun 29, 2022
@talegari talegari self-assigned this Jun 29, 2022
@grahitr
Copy link
Member

grahitr commented Jan 25, 2023

Also, replace_na, should be changed to accept list of columns and/or column selector in the key of the dictionary being passed.

Also, is the value appropriate argument name in replace_na?

@talegari
Copy link
Member Author

IMHO, value should be a single value for simplicity. If we allow a list of values to be passed, then we implicitly already the columns to be renamed right?

my suggestion:
df.replace_na({ends_with("width"): 0}) and not df.replace_na({ends_with("width"): [0, 1]})
as in latter case, usually we might not know how many columns get selected.

@grahitr
Copy link
Member

grahitr commented Aug 6, 2023

To expand tidyselect for following methods

count
add_count
nest_by
expand
complete
Summarise -> in by
Mutate -> in by

@sardnar
Copy link

sardnar commented Nov 23, 2023

Is there is an easy way to filter using tidyselect. Like:

df.filter(starts_with("x") < 10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants