Skip to content

DataFrame.to_string(index=False) alignment bug #15467

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

Closed
jzwinck opened this issue Feb 21, 2017 · 1 comment
Closed

DataFrame.to_string(index=False) alignment bug #15467

jzwinck opened this issue Feb 21, 2017 · 1 comment
Labels
Bug Duplicate Report Duplicate issue or pull request Output-Formatting __repr__ of pandas objects, to_string

Comments

@jzwinck
Copy link
Contributor

jzwinck commented Feb 21, 2017

import pandas as pd
df = pd.DataFrame()
df['a'] = ['hello world', 'hi']
df['b'] = 0
print(df.to_string(index=False))

Problem description

It fails to align the first column header:

a  b
hello world  0
         hi  0

Expected Output

          a  b
hello world  0
         hi  0

Output of pd.show_versions()

pandas: 0.19.2
python: 3.5.1
OS: Linux
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
@jreback
Copy link
Contributor

jreback commented Feb 21, 2017

dupe of #13032

PR's to fix welcome!

@jreback jreback closed this as completed Feb 21, 2017
@jreback jreback added Bug Duplicate Report Duplicate issue or pull request Output-Formatting __repr__ of pandas objects, to_string labels Feb 21, 2017
@jreback jreback added this to the Next Major Release milestone Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Duplicate Report Duplicate issue or pull request Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

No branches or pull requests

2 participants