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
import pandas df = pandas.DataFrame({'c': 1, 'd': 2.3}, index=[0], ) formats = {'c': '{: 10d}', 'd': '{: 2.5f}'} formatters = {k: v.format for k, v in formats.items()} print(df.to_string(formatters=formatters, index=False, header=True)) print(df.to_string(formatters=formatters, index=False, header=False))
I expect the spaces in the beginning, but they don't appear when header=False.
header=False
u'c d\n 1 2.30000'
'1 2.30000'
' 1 2.30000'
pd.show_versions()
pandas: 0.20.2 pytest: 3.1.2 pip: 9.0.1 setuptools: 36.0.1 Cython: None numpy: 1.13.0 scipy: None xarray: None IPython: 5.4.1 sphinx: None patsy: None dateutil: 2.6.0 pytz: 2017.2 blosc: None bottleneck: None tables: None numexpr: None feather: None matplotlib: None openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: None bs4: None html5lib: 0.999999999 sqlalchemy: None pymysql: None psycopg2: None jinja2: 2.9.6 s3fs: None pandas_gbq: None pandas_datareader: None
The text was updated successfully, but these errors were encountered:
looks realted to #13032 ? can you have a look.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Code Sample, a copy-pastable example if possible
Problem description
I expect the spaces in the beginning, but they don't appear when
header=False
.Expected Output
Output of
pd.show_versions()
pandas: 0.20.2
pytest: 3.1.2
pip: 9.0.1
setuptools: 36.0.1
Cython: None
numpy: 1.13.0
scipy: None
xarray: None
IPython: 5.4.1
sphinx: None
patsy: None
dateutil: 2.6.0
pytz: 2017.2
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.999999999
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.9.6
s3fs: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: