-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Styler renders booleans True/False as digits since 1.4.0 #46384
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
Comments
I do not see this problem on Master. Running the following on Master: >>> df1 = DataFrame({"A": [True, False]})
>>> print(df1.style.to_html())
<style type="text/css">
</style>
<table id="T_f4541">
<thead>
<tr>
<th class="blank level0" > </th>
<th id="T_f4541_level0_col0" class="col_heading level0 col0" >A</th>
</tr>
</thead>
<tbody>
<tr>
<th id="T_f4541_level0_row0" class="row_heading level0 row0" >0</th>
<td id="T_f4541_row0_col0" class="data row0 col0" >True</td>
</tr>
<tr>
<th id="T_f4541_level0_row1" class="row_heading level0 row1" >1</th>
<td id="T_f4541_row1_col0" class="data row1 col0" >False</td>
</tr>
</tbody>
</table> |
Ok, sorry looks like I have this in the released version of pandas 1.4.1 but checking out master and using the docker container 1.5.0.dev it's fixed I should have read the check box release and master more carefully. INSTALLED VERSIONScommit : e7a0cf3 pandas : 1.5.0.dev0+543.ge7a0cf3ba0 |
I believe it is #46119. Looks like |
Reopened to at least add a test before closing. Milestoned 1.4.2 for now to track pending discussion in #46500 |
can confirm, reverting #46119 results in code sample in #46384 (comment) giving same result as 1.4.1 |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Datatype boolean in dataframe is now rendered as digits when passed to styler since version 1.4.0
species extinct

0 parrot False
1 dodo True
2 moa True
3 whale False
species object
extinct bool
dtype: object
Expected Behavior
species extinct

0 parrot False
1 dodo True
2 moa True
3 whale False
species object
extinct bool
dtype: object
Installed Versions
INSTALLED VERSIONS
commit : 06d2301
python : 3.9.5.final.0
python-bits : 64
OS : Darwin
OS-release : 19.6.0
Version : Darwin Kernel Version 19.6.0: Thu Jan 13 01:26:33 PST 2022; root:xnu-6153.141.51~3/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 1.4.1
numpy : 1.20.3
pytz : 2021.1
dateutil : 2.8.1
pip : 22.0.4
setuptools : 56.0.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.1
IPython : 7.24.1
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.4.2
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.6.3
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None
None
The text was updated successfully, but these errors were encountered: