Skip to content

BUG: loffset isn't applied when using resample() with a TimedeltaIndex #13933

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
wcwagner opened this issue Aug 8, 2016 · 2 comments
Closed
Labels
Duplicate Report Duplicate issue or pull request Resample resample method Timedelta Timedelta data type

Comments

@wcwagner
Copy link
Contributor

wcwagner commented Aug 8, 2016

Code Sample, a copy-pastable example if possible

In [3]: from pandas import *
In [4]: rng = timedelta_range(start='0s', periods=10, freq='s')
In [5]: df = DataFrame({'A' : range(10)}, index=rng)
In [6]: df.resample('2S', loffset='2h').count()
Out[6]: 
          A
00:00:00  2
00:00:02  2
00:00:04  2
00:00:06  2
00:00:08  2

Expected Output

          A
02:00:00  2
02:00:02  2
02:00:04  2
02:00:06  2
02:00:08  2

output of pd.show_versions()

INSTALLED VERSIONS
------------------
commit: cff1f5595888becee0e58dedf014a12e8131b352
python: 3.5.2.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-21-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8

pandas: 0.18.1+327.gcff1f55
nose: 1.3.7
pip: 8.1.2
setuptools: 23.0.0
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.18.0
statsmodels: None
xarray: None
IPython: 4.2.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: None
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
boto: None
pandas_datareader: None

I'm working on #13218 and can't proceed with writing the tests due to this bug. I will try to see if I can fix it, but I'm not totally sure if I will be able to.

@jreback
Copy link
Contributor

jreback commented Aug 8, 2016

this is a dupe of #7687

@jreback jreback closed this as completed Aug 8, 2016
@jreback jreback added Resample resample method Timedelta Timedelta data type Duplicate Report Duplicate issue or pull request labels Aug 8, 2016
@jreback jreback added this to the No action milestone Aug 8, 2016
@jreback
Copy link
Contributor

jreback commented Aug 8, 2016

I guess this wasn't fully fixed / tested in https://github.com/pydata/pandas/pull/12757/files

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 Resample resample method Timedelta Timedelta data type
Projects
None yet
Development

No branches or pull requests

2 participants