Description
The shapes and types of the first two are unexpected. Should they be? Just upgraded to pandas 0.24.0.
pd.Series(pd.Categorical('A', categories=['A', 'B'])).replace({'A': 1, 'B': 2})
# Out[30]:
# 0 [1]
# dtype: object
pd.Series(pd.Categorical(('A', ), categories=['A', 'B'])).replace({'A': 1, 'B': 2})
# Out[31]:
# 0 [1]
# dtype: object
pd.Series(pd.Categorical(('A', 'B'), categories=['A', 'B'])).replace({'A': 1, 'B': 2})
# Out[32]:
# 0 1
# 1 2
# dtype: int64
I expect the first to be an int64 dtype with a shape of (1,). They return a Series with shape (1, 1) and dtype object.
pandas: 0.24.0
pytest: 4.1.1
pip: 18.1
setuptools: 40.2.0
Cython: None
numpy: 1.15.4
scipy: 1.2.0
pyarrow: None
xarray: None
IPython: 7.2.0
sphinx: None
patsy: None
dateutil: 2.6.1
pytz: 2018.7
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.0.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: None
sqlalchemy: 1.2.15
pymysql: None
psycopg2: 2.7.6.1 (dt dec pq3 ext lo64)
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None