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

BUG: Resample across multiple days #8941

Merged

Conversation

hkleynhans
Copy link
Contributor

Fixes an issue where resampling over multiple days causes a ValueError
when a number of days between the normalized first and normalized last
days is not a multiple of the frequency.

Added test TestSeries.test_resample

Closes #8683

@jorisvandenbossche
Copy link
Member


foffset = (first.value - start_day_nanos) % offset.nanos
loffset = (last.value - last_day_nanos) % offset.nanos

loffset = (last.value - start_day_nanos) % offset.nanos
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very small nitpick, but can you keep the blank line after this to keep the visual blocks

@jorisvandenbossche jorisvandenbossche added the Resample resample method label Nov 30, 2014
@jorisvandenbossche jorisvandenbossche added this to the 0.15.2 milestone Nov 30, 2014
Fixes an issue where resampling over multiple days causes a ValueError
when a number of days between the normalized first and normalized last
days is not a multiple of the frequency.

Added test TestResample.test_resample_anchored_multiday

Closes pandas-dev#8683
@hkleynhans
Copy link
Contributor Author

Thanks for the feedback. The issues have been addressed.

@jorisvandenbossche
Copy link
Member

@jreback can you have a look at this? (or is there someone with great knowledge of the resample code?) But the change seems logic, and the tests pass

@jreback
Copy link
Contributor

jreback commented Nov 30, 2014

will have a look

@jreback
Copy link
Contributor

jreback commented Nov 30, 2014

looks good.

@jorisvandenbossche merge on green.

@jreback jreback added the Bug label Nov 30, 2014
@jorisvandenbossche
Copy link
Member

@hkleynhans Thanks a lot! It was nice debugging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Resample resample method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ValueError exception with pd.resample
3 participants