BUG: Series.update() raises ValueError if dtype="string" #33980
Labels
Bug
NA - MaskedArrays
Related to pd.NA and nullable extension arrays
Strings
String extension data type and string data
Milestone
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
results in:
Problem description
The example works if I leave off the
dtype="string"
(resulting in the implicit dtypeobject
).IMO update should work for all dtypes, not only the "old" ones.
a = pd.Series([1, None, 3], dtype="Int16")
etc. also raises ValueError, while the same withdtype="float64"
works.It looks as if update doesn't work with the new nullable dtypes (the ones with
pd.NA
).Expected Output
The expected result is that
a.update(b)
updatesa
without raising an exception, not only forobject
andfloat64
, but also forstring
andInt16
etc..Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.7.final.0
python-bits : 64
OS : Windows
OS-release : 10
machine : AMD64
processor : Intel64 Family 6 ..., GenuineIntel
...
pandas : 1.0.3
numpy : 1.18.1
...
The text was updated successfully, but these errors were encountered: