to_html(index_names=False) still renders a row with index names · Issue #16493 · pandas-dev/pandas (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
The index_names parameter is apparently ignored.
I tried to debug the code, and it looks like line 1291 of pandas/io/formats/format.py should contain "and self.fmt.show_index_names" in the if clause.
here is sample code:
x=DataFrame(np.random.randn(3,4),columns=list('abcd')) x.index.name='pippo' print(x.to_html(index_names=False))
which produces the following output:
a | b | c | d | |
---|---|---|---|---|
pippo | ||||
0 | 1.715511 | -1.582624 | 0.027399 | -0.276980 |
1 | -0.003603 | -1.227605 | 0.434763 | 0.039167 |
2 | 0.246343 | -0.062897 | -0.724532 | -0.352672 |
the second row of the thead should not be there...
INSTALLED VERSIONS ------------------ commit: None python: 3.6.1.final.0 python-bits: 64 OS: Darwin OS-release: 16.6.0 machine: x86_64 processor: i386 byteorder: little LC_ALL: en_US.UTF-8 LANG: en_US.UTF-8 LOCALE: en_US.UTF-8
pandas: 0.20.1
pytest: None
pip: 9.0.1
setuptools: 35.0.2
Cython: None
numpy: 1.12.1
scipy: 0.19.0
xarray: 0.9.5
IPython: 6.0.0
sphinx: None
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: None
tables: 3.4.2
numexpr: 2.6.2
feather: None
matplotlib: 2.0.2
openpyxl: 2.4.7
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: 0.9.6
lxml: None
bs4: None
html5lib: 0.999999999
sqlalchemy: 1.1.9
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: None