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
Either Categorical Series should act the same as other Series, or this special behavior for Categoricals should be mentioned in the documentation for Series.map.
A limitation of the current behavior for Categoricals is that the function is never called for any nulls (codes equal to -1).
It's like mentioned by @jreback: Categorical.map is designed to work on the categories, so will not necessarily work on each value in the array. This is mentioned in the doc string "Maps the categories to new categories.", but could maybe be written clearer.
So IMO everything works as intended and this issue can be.closed.
Code Sample
Problem description
Either Categorical Series should act the same as other Series, or this special behavior for Categoricals should be mentioned in the documentation for
Series.map
.A limitation of the current behavior for Categoricals is that the function is never called for any nulls (codes equal to -1).
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.0.final.0
python-bits: 64
OS: Linux
OS-release: 4.8.0-37-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.19.2
nose: None
pip: 9.0.1
setuptools: 28.8.0
Cython: None
numpy: 1.12.0
scipy: 0.18.1
statsmodels: 0.8.0
xarray: None
IPython: None
sphinx: None
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 2.0.0
openpyxl: None
xlrd: 1.0.0
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
boto: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: