Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Styler class fails to render numeric columns when 0 not in columns #12125
Comments
HHammond
referenced
this issue
Jan 24, 2016
Closed
Fix Styler._translate failing on numeric columns #12126
jreback
added Output-Formatting IO HTML Bug
labels
Jan 24, 2016
jreback
added this to the
0.18.0
milestone
Jan 24, 2016
TomAugspurger
added a commit
to TomAugspurger/pandas
that referenced
this issue
Feb 7, 2016
|
|
TomAugspurger |
aee0d90
|
TomAugspurger
added a commit
to TomAugspurger/pandas
that referenced
this issue
Feb 12, 2016
|
|
TomAugspurger |
a3c38fe
|
jreback
closed this
in cf8b7f8
Feb 12, 2016
HHammond
added a commit
to HHammond/pandas
that referenced
this issue
Feb 13, 2016
|
|
TomAugspurger + HHammond |
a15248a
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HHammond commentedJan 24, 2016
The
core.style.Styler._translatemethod 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