Skip to content
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

to_latex truncates string names #6491

Closed
jseabold opened this issue Feb 27, 2014 · 2 comments · Fixed by #40422
Closed

to_latex truncates string names #6491

jseabold opened this issue Feb 27, 2014 · 2 comments · Fixed by #40422
Labels
Milestone

Comments

@jseabold
Copy link
Contributor

Tried to use to_latex to make a table containing long string names. It truncated them and inserted .... Drive-by bug issue report. Will update with MWE later.

@jreback jreback added this to the 0.15.0 milestone Feb 28, 2014
@jseabold
Copy link
Contributor Author

Looking at the source on this. to_latex comes from DataFrameFormatter, so it respects the options. Great.

df = pd.DataFrame([['a'*65, 'b'*65]], columns=['acol', 'bcol'])
print df.to_latex()

with pd.option_context("max_colwidth", 1000):
    print df.to_latex()

I'm thinking this is a docs issue more than a bug, though it'd be nice not to have to worry about this. Should to_latex introspect the object columns and find a max-length, then use the context manager or something?

@moorepants
Copy link

Yes, introspection sounds like a better default. If the user wants to truncate they can then set the width to something smaller.

@jreback jreback modified the milestones: 0.16.0, Next Major Release Mar 6, 2015
@jorisvandenbossche jorisvandenbossche added IO LaTeX to_latex and removed Output-Formatting __repr__ of pandas objects, to_string labels Aug 22, 2015
@datapythonista datapythonista modified the milestones: Contributions Welcome, Someday Jul 8, 2018
@mroeschke mroeschke added Docs and removed Bug labels Oct 22, 2019
@jreback jreback modified the milestones: Someday, 1.3 May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants