series.replace with empty dictlike raises ValueError: not enough values to unpack #15289
Labels
Missing-data
np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Reshaping
Concat, Merge/Join, Stack/Unstack, Explode
Milestone
Problem description
DataFrame.replace
andSeries.replace
fail unceremoniously on an empty Series or dict argument; I would expect it to simply do nothing.While there is a fair bit of type-based wizardry going on in this function, I don't suppose there is any actual ambiguity in how this edge case should behave?
Code Sample, a copy-pastable example if possible
Output
Expected Output
Output of
pd.show_versions()
pandas: 0.19.2
nose: None
pip: 8.1.2
setuptools: 27.2.0
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.18.0
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: None
patsy: None
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: 1.2.0
tables: None
numexpr: 2.6.2
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: 0.7.3
lxml: None
bs4: 4.4.1
html5lib: 0.999
httplib2: 0.9.1
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: