Series.replace cannot use dict-value and non-None to_replace
Package:
pandas
30911

Exception Class:
ValueError
Raise code
else:
# dest iterable dict-like
if is_dict_like(value): # NA -> {'A' : 0, 'B' : -1}
# Operate column-wise
if self.ndim == 1:
raise ValueError(
"Series.replace cannot use dict-value and "
"non-None to_replace"
)
mapping = {col: (to_replace, val) for col, val in value.items()}
return self._replace_columnwise(mapping, inplace, regex)
elif not is_list_like(value): # NA -> 0
new_
Links to the raise (1)
https://github.com/pandas-dev/pandas/blob/b3e335254f46a526ee3ce9bb757eac4011d9d1fe/pandas/core/generic.py#L6682NO FIXES YET
Just press the button and we will add solution
to this exception as soon as possible
* As many users press the button, the faster we create a fix
Add a possible fix
Please authorize to post fix