Skip to content

BUG: No keyword arguments passed to numpy.interp #55144

@kmuehlbauer

Description

@kmuehlbauer

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
import numpy as np
df = pd.DataFrame([np.nan, 0, 1, 2, np.nan, 3, 4, 5, np.nan])
out = df.interpolate(method="linear", left=10, right=20)
print(out)
     0
0  NaN
1  0.0
2  1.0
3  2.0
4  2.5
5  3.0
6  4.0
7  5.0
8  5.0

Issue Description

This bug is connected to #31949, at least with respect to numpy.interp.

The ideal user solution would be to translate fill_value here to numpy.interp left/right kwargs.

Expected Behavior

     0
0  10.0
1   0.0
2   1.0
3   2.0
4   2.5
5   3.0
6   4.0
7   5.0
8  20.0

Installed Versions

INSTALLED VERSIONS

commit : ba1cccd
python : 3.11.0.final.0
python-bits : 64
OS : Linux
OS-release : 5.14.21-150500.55.19-default
Version : #1 SMP PREEMPT_DYNAMIC Tue Aug 8 22:15:01 UTC 2023 (9908c29)
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : de_DE.UTF-8
LOCALE : de_DE.UTF-8

pandas : 2.1.0
numpy : 1.24.2
pytz : 2022.7.1
dateutil : 2.8.2
setuptools : 67.6.0
pip : 23.0.1
Cython : None
pytest : 7.2.2
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.11.0
pandas_datareader : None
bs4 : 4.12.0
bottleneck : 1.3.7
dataframe-api-compat: None
fastparquet : None
fsspec : 2023.3.0
gcsfs : None
matplotlib : 3.7.1
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 11.0.0
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.10.1
sqlalchemy : None
tables : None
tabulate : None
xarray : 2023.8.1.dev8+g1809b913.d20230831
xlrd : None
zstandard : None
tzdata : 2023.3
qtpy : None
pyqt5 : None

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TriageIssue that has not been reviewed by a pandas team memberufuncs__array_ufunc__ and __array_function__

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions