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

Add filter_date function #105

Closed
szuckerman opened this issue Jan 10, 2019 · 1 comment
Closed

Add filter_date function #105

szuckerman opened this issue Jan 10, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@szuckerman
Copy link
Collaborator

This issue is to track creating a filter_date function, or whatever else you might want to call it.

The main idea is that even though there are already filter functions, date filtering is a bit more complex. For example, when filtering strings you can just write a string, but for dates it usually needs to be a date or datetime object, and not all of them play together nicely.

More important than the above is that when filtering a range, the lines can get really long, like so:

start_date = date(2017, 1, 1)
end_date = date(2018, 1, 1)
df = df[(df.date_column >= start_date) & (df.date_column <= end_date)]

I think something like the following is nicer:

df = df.filter_date('date_column', start='2018-01-01', end='2018-01-01')

It could also include arguments for year, years, etc.

@ericmjl
Copy link
Member

ericmjl commented Jan 10, 2019

@szuckerman yes, I think this would be a great contribution! Looking forward to seeing it!

@ericmjl ericmjl added the enhancement New feature or request label Jan 24, 2019
@szuckerman szuckerman mentioned this issue Jan 30, 2019
9 tasks
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

2 participants