Skip to content

BUG: is_string_dtype incorrectly identifies categorical data #34295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
ieaves opened this issue May 21, 2020 · 0 comments · Fixed by #34294
Closed
3 tasks done

BUG: is_string_dtype incorrectly identifies categorical data #34295

ieaves opened this issue May 21, 2020 · 0 comments · Fixed by #34294
Labels
Milestone

Comments

@ieaves
Copy link
Contributor

ieaves commented May 21, 2020

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


s = pd.Series(['a', 'b', 'c'], dtype='category')
pdt.is_string_dtype(s)
>>> True

Problem description

The current implementation of is_string_dtype incorrectly evaluates to True for categorical series.

Expected Output

s = pd.Series(['a', 'b', 'c'], dtype='category')
pdt.is_string_dtype(s)
>>> False

Output of pd.show_versions()

INSTALLED VERSIONS

commit : None
python : 3.8.0.final.0
python-bits : 64
OS : Darwin
OS-release : 19.4.0
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

pandas : 1.0.3
numpy : 1.17.3
pytz : 2019.3
dateutil : 2.8.1
pip : 19.3.1
setuptools : 44.0.0.post20200106
Cython : 0.29.14
pytest : 5.3.2
hypothesis : None
sphinx : 2.3.1
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.3
IPython : 7.11.1
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pytest : 5.3.2
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : 0.48.0

@ieaves ieaves added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels May 21, 2020
@ieaves ieaves mentioned this issue May 21, 2020
5 tasks
@jorisvandenbossche jorisvandenbossche added this to the 1.1 milestone May 21, 2020
@simonjayhawkins simonjayhawkins removed the Needs Triage Issue that has not been reviewed by a pandas team member label May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants