datetimeindex resample issue #12348

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

Comments

Projects
None yet
2 participants

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.

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 closed this Feb 16, 2016

@jreback jreback added a commit to jreback/pandas that referenced this issue Feb 16, 2016

@jreback jreback TST: confirming tests for #12348 545da27

jreback added this to the 0.18.0 milestone Feb 16, 2016

@jreback jreback added a commit that referenced this issue Feb 16, 2016

@jreback jreback TST: confirming tests for #12348
xref #12348

Author: Jeff Reback <jeff@reback.net>

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

545da27 [Jeff Reback] TST: confirming tests for #12348
2e9a774

@rinoc rinoc added a commit to rinoc/pandas that referenced this issue Feb 17, 2016

@rinoc rinoc Merge remote-tracking branch 'pydata/master'
* pydata/master: (290 commits)
  BUG: resample with nunique
  CLN: change getargspec -> signature
  COMPAT: invalid casting to nan
  TST: skip blosc tests on msgpacks if not installed
  API: consistency in aggregate groupby results
  docs: add hyperlinks to str.get_dummies
  TST: confirming tests for #12348
  DEPR: GH10623 remove items from msgpack.encode for blocks
  ENH: gbq docs update
  COMPAT: dateutil=2.2 compat
  NaT.isoformat() returns 'NaT'.
  BUG: addtl fix for compat summary of groupby/resample with dicts
  DOC: add addtl docs for FloatIndexing changes in 0.18.0
  TST: skip some unreliable io/data.py tests
  BUG: Prevent abuse of kwargs in stat functions
  DOC/DEPR: remove remaining occurences of mpl_style from docs (GH12190)
  DOC: move extractall ref point
  DOC: whatsnew link v0.18.0 for float_indexers
  DOC: some rewording of highlights
  DOC: missing colon
  ...
d1c52ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment