Skip to content

datetimeindex resample issue #12348

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

Closed
JohnSmizz opened this issue Feb 16, 2016 · 1 comment
Closed

datetimeindex resample issue #12348

JohnSmizz opened this issue Feb 16, 2016 · 1 comment
Labels
Bug Duplicate Report Duplicate issue or pull request Resample resample method
Milestone

Comments

@JohnSmizz
Copy link

Hi- I am observing odd behavior when trying to use resample on an uneven datetimeindex. See the below code to reproduce:

import pandas as pd
import numpy as np

bug_datetimeindex = pd.date_range('2013-12-30', '2014-01-07')
bug_datetimeindex = bug_datetimeindex.drop([ \
pd.Timestamp('2014-01-01'), \
pd.Timestamp('2013-12-31'), \
pd.Timestamp('2014-01-04'), \
pd.Timestamp('2014-01-05')
])
temp_df = pd.DataFrame(index=bug_datetimeindex, data=np.random.randn(len(bug_datetimeindex), 2))
temp_df.resample('B')

throws up a ValueError: Length mismatch: Expected axis has 5 elements, new values have 7 elements

Using asfreq() does not throw up this error on my machine.

I am running pd 0.17.1 on Python 3.4.4. off Anaconda for Windows.

@jreback jreback added Bug Resample resample method Duplicate Report Duplicate issue or pull request labels Feb 16, 2016
@jreback
Copy link
Contributor

jreback commented Feb 16, 2016

this was just fixed in master (it broke 0.18.0rc1 as well), see the issue here.

so 0.18.0 will release soon

@jreback jreback closed this as completed Feb 16, 2016
jreback added a commit to jreback/pandas that referenced this issue Feb 16, 2016
@jreback jreback added this to the 0.18.0 milestone Feb 16, 2016
jreback added a commit that referenced this issue Feb 16, 2016
xref #12348

Author: Jeff Reback <[email protected]>

Closes #12349 from jreback/resample_tests and squashes the following commits:

545da27 [Jeff Reback] TST: confirming tests for #12348
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Duplicate Report Duplicate issue or pull request Resample resample method
Projects
None yet
Development

No branches or pull requests

2 participants