-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
loffset in resample does not work with ffill, bfill, pad #20744
Comments
hmm, guess it doesn. a pull-request would be great to fix! (also doesn't work for |
johncant
added a commit
to johncant/pandas
that referenced
this issue
Apr 29, 2018
johncant
added a commit
to johncant/pandas
that referenced
this issue
Apr 29, 2018
johncant
added a commit
to johncant/pandas
that referenced
this issue
Apr 29, 2018
johncant
added a commit
to johncant/pandas
that referenced
this issue
Apr 29, 2018
4 tasks
johncant
added a commit
to johncant/pandas
that referenced
this issue
Apr 30, 2018
johncant
added a commit
to johncant/pandas
that referenced
this issue
Apr 30, 2018
4 tasks
jreback
pushed a commit
that referenced
this issue
May 1, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Minimal example
Problem description
DataFrame
andDataFrameGroupBy
both provide aresample
method, for resampling timeseries data. These methods have an optional argument,loffset
, which accepts a pandasTimedelta
instance and is used to adjust the outputDataFrame
's index, once a suitable aggregation method has been used on the resultingDatetimeIndexResampler
orDatetimeIndexResamplerGroupby
object.This works as expected for, for example,
mean
, but fails in the cases offfill
,bfill
andpad
. The resample is successful, but theloffset
argument is ignored.Expected Output
2018-04-01 00:00:00 0.246580
2018-04-01 01:00:00 0.380124
2018-04-01 02:00:00 0.227830
2018-04-01 03:00:00 0.376657
2018-04-01 04:00:00 0.139719
0
2018-04-01 12:00:00 0.434068
2018-04-02 12:00:00 0.471917
2018-04-03 12:00:00 0.395527
0
2018-04-01 12:00:00 0.246580
2018-04-02 12:00:00 0.402313
2018-04-03 12:00:00 0.395527
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.4.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.22.0
pytest: 3.0.7
pip: 9.0.3
setuptools: 39.0.1
Cython: 0.27.3
numpy: 1.14.2
scipy: 1.0.0
pyarrow: None
xarray: None
IPython: 6.3.1
sphinx: 1.7.2
patsy: 0.4.1
dateutil: 2.7.2
pytz: 2018.4
blosc: None
bottleneck: 1.2.1
tables: 3.4.2
numexpr: 2.6.2
feather: None
matplotlib: 2.1.2
openpyxl: 2.4.7
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: 0.9.6
lxml: 3.7.3
bs4: 4.6.0
html5lib: 1.0.1
sqlalchemy: 1.1.9
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: