Styler class fails to render numeric columns when 0 not in columns #12125
Labels
Bug
IO HTML
read_html, to_html, Styler.apply, Styler.applymap
Output-Formatting
__repr__ of pandas objects, to_string
Milestone
The
core.style.Styler._translate
method uses__getitem__
indexing when working with numerical cell locations (https://github.com/pydata/pandas/blob/master/pandas/core/style.py#L240). When using numeric dataframe columns the location based index causes confusion with the column name index, causing an error.The expected behaviour should be to always use location based indexing. Changing line 240 to:
Fixes the error.
I do currently have a PR to fix this but wanted to file the bug report first.
Error code
INSTALLED VERSIONS
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.17.1
nose: 1.3.7
pip: 7.1.2
setuptools: 19.4
Cython: None
numpy: 1.10.4
scipy: 0.16.0
statsmodels: None
IPython: 4.0.3
sphinx: 1.3.1
patsy: None
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.4.3
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
Jinja2: 2.8
The text was updated successfully, but these errors were encountered: