We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
code sample from DataFrame.select_dtypes docstring
>>> import pandas as pd >>> >>> pd.__version__ '0.26.0.dev0+767.gb3490cbd9' >>> >>> df = pd.DataFrame({"a": [1, 2] * 3, "b": [True, False] * 3, "c": [1.0, 2.0] * 3}) >>> df a b c 0 1 True 1.0 1 2 False 2.0 2 1 True 1.0 3 2 False 2.0 4 1 True 1.0 5 2 False 2.0 >>> >>> df.select_dtypes(exclude=["int"]) a b c 0 1 True 1.0 1 2 False 2.0 2 1 True 1.0 3 2 False 2.0 4 1 True 1.0 5 2 False 2.0 >>>
seen locally on master and 0.25.1
The docstring implies "int" is a valid dtype to exclude. Only "int64" produces the expected output shown in the docstring.
"int"
"int64"
The same applies to the include argument.
include
>>> df.select_dtypes(exclude=["int64"]) b c 0 True 1.0 1 False 2.0 2 True 1.0 3 False 2.0 4 True 1.0 5 False 2.0 >>>
pd.show_versions()
commit : b3490cb python : 3.7.5.final.0 python-bits : 64 OS : Windows OS-release : 10 machine : AMD64 processor : Intel64 Family 6 Model 58 Stepping 9, GenuineIntel byteorder : little LC_ALL : None LANG : en_GB.UTF-8 LOCALE : None.None
pandas : 0.26.0.dev0+767.gb3490cbd9 numpy : 1.17.2 pytz : 2019.3 dateutil : 2.8.0 pip : 19.3.1 setuptools : 41.6.0.post20191030 Cython : 0.29.13 pytest : 5.2.2 hypothesis : 4.36.2 sphinx : 2.2.1 blosc : None feather : None xlsxwriter : 1.2.2 lxml.etree : 4.4.1 html5lib : 1.0.1 pymysql : None psycopg2 : None jinja2 : 2.10.3 IPython : 7.9.0 pandas_datareader: None bs4 : 4.8.1 bottleneck : 1.2.1 fastparquet : 0.3.2 gcsfs : None lxml.etree : 4.4.1 matplotlib : 3.1.1 numexpr : 2.7.0 odfpy : None openpyxl : 3.0.0 pandas_gbq : None pyarrow : 0.15.1 pytables : None s3fs : 0.3.4 scipy : 1.3.1 sqlalchemy : 1.3.10 tables : 3.5.1 xarray : 0.13.0 xlrd : 1.2.0 xlwt : 1.3.0 xlsxwriter : 1.2.2
The text was updated successfully, but these errors were encountered:
I'll take a look
Sorry, something went wrong.
Thanks @pambot. as well as 'int64', the string 'integer' also works. The code sample is the last example in the docstring. https://dev.pandas.io/docs/reference/api/pandas.DataFrame.select_dtypes.html
'int64'
'integer'
closing as superseded by #36596
No branches or pull requests
Code Sample, a copy-pastable example if possible
code sample from DataFrame.select_dtypes docstring
Problem description
seen locally on master and 0.25.1
The docstring implies
"int"
is a valid dtype to exclude. Only"int64"
produces the expected output shown in the docstring.The same applies to the
include
argument.Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : b3490cb
python : 3.7.5.final.0
python-bits : 64
OS : Windows
OS-release : 10
machine : AMD64
processor : Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : None.None
pandas : 0.26.0.dev0+767.gb3490cbd9
numpy : 1.17.2
pytz : 2019.3
dateutil : 2.8.0
pip : 19.3.1
setuptools : 41.6.0.post20191030
Cython : 0.29.13
pytest : 5.2.2
hypothesis : 4.36.2
sphinx : 2.2.1
blosc : None
feather : None
xlsxwriter : 1.2.2
lxml.etree : 4.4.1
html5lib : 1.0.1
pymysql : None
psycopg2 : None
jinja2 : 2.10.3
IPython : 7.9.0
pandas_datareader: None
bs4 : 4.8.1
bottleneck : 1.2.1
fastparquet : 0.3.2
gcsfs : None
lxml.etree : 4.4.1
matplotlib : 3.1.1
numexpr : 2.7.0
odfpy : None
openpyxl : 3.0.0
pandas_gbq : None
pyarrow : 0.15.1
pytables : None
s3fs : 0.3.4
scipy : 1.3.1
sqlalchemy : 1.3.10
tables : 3.5.1
xarray : 0.13.0
xlrd : 1.2.0
xlwt : 1.3.0
xlsxwriter : 1.2.2
The text was updated successfully, but these errors were encountered: