Open
Description
Mutating Series.values
has been disabled for 3.0 with CoW becoming the default behavior, but Series.array
is still mutable.
In [1]: In [1]: import pandas as pd
...:
...: In [2]: s = pd.Series([1, 2, pd.NA])
...:
...: In [3]: a = s.array
In [2]: a[:2] = 3
In [3]: a
Out[3]:
<NumpyExtensionArray>
[3, 3, <NA>]
Length: 3, dtype: object
In [4]: s
Out[4]:
0 3
1 3
2 <NA>
dtype: object
There's a comment in pandas/core/internals/blocks.py
in external_values
to make backing ExtensionArrays read-only