You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jreback
added
Indexing
Related to indexing on series/frames, not to indexes themselves
and removed
Needs Triage
Issue that has not been reviewed by a pandas team member
labels
Dec 4, 2020
[ X ] I have checked that this issue has not already been reported. BUG: assignment with .at or .loc modifies dataframe when it fails #15490 looks kind of similar, but seems like it was fixed. DataFrame.set_value() fails with numpy types #17256 is also similar but it uses deprecated methods.
[ X ] I have confirmed this bug exists on the latest version of pandas.
Code Sample, a copy-pastable example
Problem description
The current behaviour raises a ValueError, even though the assignment happened. Stack trace:
Expected Output
As the
dtype
isobject
, I would have expected this assignment to happen without raising a ValueError. If the dataframe has more than one row:Then the exception is not thrown.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : db08276
python : 3.6.9.final.0
python-bits : 64
OS : Linux
OS-release : 4.19.112+
Version : #1 SMP Thu Jul 23 08:00:38 PDT 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.3
numpy : 1.18.5
pytz : 2018.9
dateutil : 2.8.1
pip : 19.3.1
setuptools : 50.3.0
Cython : 0.29.21
pytest : 3.6.4
hypothesis : None
sphinx : 1.8.5
blosc : None
feather : 0.4.1
xlsxwriter : None
lxml.etree : 4.2.6
html5lib : 1.0.1
pymysql : None
psycopg2 : 2.7.6.1 (dt dec pq3 ext lo64)
jinja2 : 2.11.2
IPython : 5.5.0
pandas_datareader: 0.9.0
bs4 : 4.6.3
bottleneck : 1.3.2
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.2.2
numexpr : 2.7.1
odfpy : None
openpyxl : 2.5.9
pandas_gbq : 0.13.3
pyarrow : 0.14.1
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : 1.3.20
tables : 3.4.4
tabulate : 0.8.7
xarray : 0.15.1
xlrd : 1.1.0
xlwt : 1.3.0
numba : 0.48.0
The text was updated successfully, but these errors were encountered: