Skip to content

Loffset doesn't work when resampling with count() #12725

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
emmawillemsma opened this issue Mar 28, 2016 · 1 comment
Closed

Loffset doesn't work when resampling with count() #12725

emmawillemsma opened this issue Mar 28, 2016 · 1 comment
Labels
Regression Functionality that used to work in a prior pandas version Resample resample method
Milestone

Comments

@emmawillemsma
Copy link

The label offset loffset has no effect when resampling a Series using .count():

>>> import pandas as pd
>>> import numpy as np
>>> rng = pd.date_range('1/1/2012', periods=100, freq='S')
>>> ts = pd.Series(np.ones(len(rng)), index=rng)
>>> ts.resample('10S', loffset='1s').mean()   #Works as expected, labels are offset by 1s
2012-01-01 00:00:01    1.0
2012-01-01 00:00:11    1.0
2012-01-01 00:00:21    1.0
2012-01-01 00:00:31    1.0
2012-01-01 00:00:41    1.0
2012-01-01 00:00:51    1.0
2012-01-01 00:01:01    1.0
2012-01-01 00:01:11    1.0
2012-01-01 00:01:21    1.0
2012-01-01 00:01:31    1.0
Freq: 10S, dtype: float64
>>> ts.resample('10S', loffset='1s').count()   #loffset has no effect
2012-01-01 00:00:00    10
2012-01-01 00:00:10    10
2012-01-01 00:00:20    10
2012-01-01 00:00:30    10
2012-01-01 00:00:40    10
2012-01-01 00:00:50    10
2012-01-01 00:01:00    10
2012-01-01 00:01:10    10
2012-01-01 00:01:20    10
2012-01-01 00:01:30    10
Freq: 10S, dtype: int64
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.3
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.0.1
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 2.5.1
pytz: 2016.2
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.4
matplotlib: 1.5.0
openpyxl: 2.2.6
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.7.7
lxml: 3.4.4
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.9
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.38.0
@jreback
Copy link
Contributor

jreback commented Mar 28, 2016

prob a bug in the transfer of the impl and not being fully tested - pull requests to fix welcome! (should be easy fix)

@jreback jreback added Difficulty Novice Regression Functionality that used to work in a prior pandas version Resample resample method labels Mar 29, 2016
@jreback jreback added this to the 0.18.1 milestone Mar 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Functionality that used to work in a prior pandas version Resample resample method
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants