Skip to content

Resample with OHLC sometimes results in series on pandas release 0.18.0.rc1 #12332

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
jcrist opened this issue Feb 15, 2016 · 4 comments
Closed
Labels
Bug Resample resample method
Milestone

Comments

@jcrist
Copy link
Contributor

jcrist commented Feb 15, 2016

In [1]: import pandas as pd

In [2]: index = pd.date_range('1-1-2000', '2-15-2000', freq='h')

In [3]: index = index.union(pd.date_range('4-15-2000', '5-15-2000', freq='h'))

In [4]: s = pd.Series(range(len(index)), index=index)

In [5]: a = s.loc[:'4-15-2000'].resample('30T').ohlc()

In [6]: b = s.loc[:'4-14-2000'].resample('30T').ohlc()

In [7]: a.head()
Out[7]:
                     open  high  low  close
2000-01-01 00:00:00   0.0   0.0  0.0    0.0
2000-01-01 00:30:00   NaN   NaN  NaN    NaN
2000-01-01 01:00:00   1.0   1.0  1.0    1.0
2000-01-01 01:30:00   NaN   NaN  NaN    NaN
2000-01-01 02:00:00   2.0   2.0  2.0    2.0

In [8]: b.head()
Out[8]:
2000-01-01 00:00:00    0.0
2000-01-01 00:30:00    NaN
2000-01-01 01:00:00    1.0
2000-01-01 01:30:00    NaN
2000-01-01 02:00:00    2.0
Freq: 30T, dtype: float64

In [9]: pd.__version__
Out[9]: u'0.18.0rc1'
@jreback jreback changed the title Resample with OHLC sometimes results in series on pandas release 0.8.0.rc1 Resample with OHLC sometimes results in series on pandas release 0.18.0.rc1 Feb 15, 2016
@jreback jreback added Bug Resample resample method labels Feb 15, 2016
@jreback jreback added this to the 0.18.0 milestone Feb 15, 2016
@jreback
Copy link
Contributor

jreback commented Feb 15, 2016

@jcrist fixed by #12329

@jreback
Copy link
Contributor

jreback commented Feb 15, 2016

this was incorrectly taking an .asfreq() path

jreback added a commit to jreback/pandas that referenced this issue Feb 15, 2016
@jcrist
Copy link
Contributor Author

jcrist commented Feb 15, 2016

Tested, that PR, fixes all issues for dask test suite. Thanks!

@jreback
Copy link
Contributor

jreback commented Feb 15, 2016

@jcrist thanks!

merged to master

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 a pull request may close this issue.

2 participants