BUG: loc/iloc insertion inserts array, scalar expected #19590
Labels
Bug
Duplicate Report
Duplicate issue or pull request
Indexing
Related to indexing on series/frames, not to indexes themselves
Notice that an array was inserted, where a scalar was expected. The issue is present in both 0.22 and master.
The same issue is if we use
loc
instead ofiloc
. However, if we insert a numeric series instead of a string series, everything is ok:EDIT: the issue can be simplified further:
So it seems like a very specific bug, concerning insertion into the last column of a dataframe.
Expected Output
Expected is that a scalar value is inserted into the data frame, and not an array.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: 49714e8
python: 3.6.3.final.0
python-bits: 32
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None
pandas: 0.22.0.dev0+669.g49714e8
pytest: 3.3.1
pip: 9.0.1
setuptools: 38.2.5
Cython: 0.26.1
numpy: 1.13.3
scipy: 1.0.0
pyarrow: None
xarray: None
IPython: 6.2.1
sphinx: 1.6.3
patsy: 0.4.1
dateutil: 2.6.1
pytz: 2017.3
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.1.0
openpyxl: 2.4.9
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: None
lxml: None
bs4: None
html5lib: 1.0b10
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: