Skip to content

PeriodIndex becomes DatetimeIndex on multiple BDay resampling #15500

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
erbian opened this issue Feb 24, 2017 · 1 comment
Closed

PeriodIndex becomes DatetimeIndex on multiple BDay resampling #15500

erbian opened this issue Feb 24, 2017 · 1 comment
Labels
Duplicate Report Duplicate issue or pull request Period Period data type Resample resample method

Comments

@erbian
Copy link
Contributor

erbian commented Feb 24, 2017

Code Sample, a copy-pastable example if possible

import pandas as pd

series = pd.Series(1., pd.period_range('2015', '2016', freq='B'))
resampled = series.resample('3B').sum()

print type(series.index)
print type(resampled.index)

Problem description

A PeriodIndex when resampled by a multiple of BusinessDays becomes a DatetimeIndex.

Expected Output

I would expect it to be a 3B PeriodIndex

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 2.7.12.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-36-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: None.None

pandas: 0.19.2
nose: 1.3.7
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.24
numpy: 1.12.0
scipy: 0.18.1
statsmodels: 0.6.1
xarray: 0.8.2
IPython: 4.1.1
sphinx: None
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: 1.2.0
tables: None
numexpr: 2.5
matplotlib: 1.5.1
openpyxl: 2.3.3
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: None
lxml: 3.5.0
bs4: 4.5.1
html5lib: None
httplib2: 0.9.2
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.45.0
pandas_datareader: None

@chris-b1
Copy link
Contributor

Thanks for the report - this is the same issue as #12884, xref #12871 for the master tracker on Period re-sampling. PRs welcome!

@chris-b1 chris-b1 added Duplicate Report Duplicate issue or pull request Period Period data type Resample resample method labels Feb 24, 2017
@chris-b1 chris-b1 added this to the No action milestone Feb 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request Period Period data type Resample resample method
Projects
None yet
Development

No branches or pull requests

2 participants