Inconsistent dtype of category in empty Series between dict and list input · Issue #18515 · pandas-dev/pandas (original) (raw)
Code Sample, a copy-pastable example if possible
In [2]: pd.Series([], dtype='category') Out[2]: Series([], dtype: category Categories (0, object): [])
In [3]: pd.Series({}, dtype='category') Out[3]: Series([], dtype: category Categories (0, float64): [])
In [4]: pd.Series(dtype='category') Out[4]: Series([], dtype: category Categories (0, float64): [])
Problem description
The difference is unjustified.
Expected Output
The same. Probably Out[4]:
, which is also (implicitly) tested.
Output of pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.5.3.final.0
python-bits: 64
OS: Linux
OS-release: 4.9.0-4-amd64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: en_GB.UTF-8
pandas: 0.22.0.dev0+241.gf745e52e1
pytest: 3.0.6
pip: 9.0.1
setuptools: 33.1.1
Cython: 0.25.2
numpy: 1.12.1
scipy: 0.18.1
pyarrow: None
xarray: None
IPython: 5.2.2
sphinx: None
patsy: 0.4.1+dev
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: 1.2.0
tables: 3.3.0
numexpr: 2.6.1
feather: 0.3.1
matplotlib: 2.0.0
openpyxl: 2.3.0
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: None
lxml: 3.7.1
bs4: 4.5.3
html5lib: 0.999999999
sqlalchemy: 1.0.15
pymysql: None
psycopg2: None
jinja2: 2.8
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None