Description
cats = pandas.api.types.CategoricalDtype(['a', 'b', 'c', 'd'])
# cats = None
s1 = pandas.Series(['a', 'b', 'c'], index=[1, 2, 3], dtype=cats)
s2 = pandas.Series(['b', 'a'], index=[1, 2], dtype=cats)
s1.update(s2)
With the dtype=None, the s1
series is updated to be ['b', 'a', 'c']
but with the dtype=cats
, the update fails with error "ValueError: NumPy boolean array indexing assignment cannot assign 3 input values to the 2 output values where the mask is true"
pandas: 0.24.2
pytest: 3.3.2
pip: 18.0
setuptools: 40.5.0
Cython: 0.27.3
numpy: 1.15.4
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: 7.2.0
sphinx: 1.6.6
patsy: 0.5.1
dateutil: 2.7.2
pytz: 2018.4
blosc: None
bottleneck: 1.2.1
tables: None
numexpr: 2.6.4
feather: None
matplotlib: 3.0.1
openpyxl: 2.4.10
xlrd: 1.1.0
xlwt: 1.3.0
xlsxwriter: 1.0.2
lxml.etree: 4.1.1
bs4: 4.6.0
html5lib: 1.0.1
sqlalchemy: 1.2.1
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None