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

"approximate" datetime reindexing #841

Closed
adamklein opened this issue Feb 29, 2012 · 1 comment
Closed

"approximate" datetime reindexing #841

adamklein opened this issue Feb 29, 2012 · 1 comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Datetime Datetime data dtype Enhancement

Comments

@adamklein
Copy link
Contributor

From the mailing list:

It would be nice to have a general, useful algorithm for doing
"approximate" reindexing like you describe. I'm thinking:

def approx_resample(obj, base, multiple, tolerance, offset=0, mode='nearest'):
...

then you would do:

result = approx_resample(df, 'min', 15, 5)

obviously

'min' <=> Minute()

offset would enable you to do like 1, 16, 31, 46 (offset=1) instead of
0, 15, 30, 45

mode parameter would allow you to do other things-- nearest, first,
last, mean of values, or some kind of interpolation method, etc.

to reflect the fact that you don't have some times you would just
dropna in the result-- could make the algo a bit smarter and only
generate dates that are within the tolerance of observed dates
(according to the frequency multiple)

@jreback jreback modified the milestones: Someday, 0.14.0 Feb 14, 2014
@jreback
Copy link
Contributor

jreback commented May 23, 2014

closing in favor of #3004

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Algos Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff Datetime Datetime data dtype Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants