-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
limit_area and limit_direction do not have an effect when interpolation method is 'pad' #26796
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
Comments
cc @WBare (haven't looked at the issue, not sure what the expected behavior is here). |
i would recommend having those changes in a separate PR. (as a precursor) |
Okay. A separate PR makes sense. My problem is that I do not fully understand why the distinction between I see that
I do, however, not understand why the 2d-component is required here because interpolation and padding is only meant to be done along a certain axis in pandas, isn't it. Hence, I would say that the methods 'pad' and 'bfill' could also be integrated in If somebody could clarify on that, I could start thinking about a solution. |
One note on Since #25141 will handle that and throw an error in these cases. |
This test currently only test `limit_area`. For `limit_direction` the implementation should later raise an error, because `pad` and `bfill` both already define a direction. But let's now first do the implementation of the `limit_area` for `pad` and `bfill`.
Code Sample, a copy-pastable example if possible
Problem description
The kwargs
limit_area
andlimit_direction
forinterpolate()
, introduce in #16513 do not seem to have an effect when using the methodpad
. They work with other interpolation methods, e.g.linear
.There are two different pathways for interpolate depending on the selected method.
pandas/pandas/core/internals/blocks.py
Lines 1096 to 1116 in b8ad9da
For pad, ffill and bfill
_interpolate_with_fill()
is used which callsmissing.interpolate_2d
which does not seem to recognize the keywords limit_direction and limit_area. They are silently ignored.I might be able to fix that during #25141, but maybe a fix needs more fundamental changes.
Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: eaacefd
python: 3.7.2.final.0
python-bits: 64
OS: Darwin
OS-release: 16.7.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: None
LOCALE: de_DE.UTF-8
pandas: 0.25.0.dev0+725.geaacefd09
pytest: 4.1.1
pip: 18.1
setuptools: 40.6.3
Cython: 0.29.2
numpy: 1.15.4
scipy: 1.2.0
pyarrow: 0.11.1
xarray: 0.11.0
IPython: 7.2.0
sphinx: 1.8.2
patsy: 0.5.1
dateutil: 2.7.5
pytz: 2018.9
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.9
feather: None
matplotlib: 3.0.2
openpyxl: 2.5.12
xlrd: 1.2.0
xlwt: 1.3.0
xlsxwriter: 1.1.2
lxml.etree: 4.3.0
bs4: 4.7.1
html5lib: 1.0.1
sqlalchemy: 1.2.16
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: 0.2.0
fastparquet: 0.2.1
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: