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

Can resampling support pandas DateOffsets? #13

Open
Flix6x opened this issue Jul 12, 2020 · 0 comments
Open

Can resampling support pandas DateOffsets? #13

Flix6x opened this issue Jul 12, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request Resampling Dealing with downsampling and/or upsampling

Comments

@Flix6x
Copy link
Collaborator

Flix6x commented Jul 12, 2020

Resampling to a different event_resolution currently only supports datetime.timedelta resolutions. Resampling to days or months is ambiguous. Anything less than 24 hours should behave as expected.

Pandas' DateOffsets seem to be a viable alternative or extension to datetime timedeltas, as they are interpreted more precisely within pandas. See for example pandas-dev/pandas#35248.

However, using DateOffsets to resample is also not entirely without issues. See pandas-dev/pandas#35219 [RESOLVED].

I've investigated how to support DateOffsets, and 1 problem we currently face is a decision whether to upsample or downsample, based on a comparison between input_resolution and output_resolution, which isn't a valid operation for DateOffsets. One idea to resolve this is to find the greatest common denominator, upsample to that resolution and then downsample to the new resolution. Another idea is to write our own comparison method for common DateOffsets.

Note that in pandas, the decision whether to upsample or downsample seems to be taken by the user by piping either a method that expands (pad, ffill) or reduces dimensions (mean, sum).

@Flix6x Flix6x added enhancement New feature or request Resampling Dealing with downsampling and/or upsampling labels Jul 12, 2020
@Flix6x Flix6x self-assigned this Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Resampling Dealing with downsampling and/or upsampling
Projects
None yet
Development

No branches or pull requests

1 participant