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

API: Would it be useful for everyone if DataFrame.to_html (and to_string) had an argument to specify justify settings for each column? #4315

Closed
numpand opened this issue Jul 22, 2013 · 11 comments · Fixed by #10250
Labels
API Design Enhancement IO Data IO issues that don't fit into a more specific label IO HTML read_html, to_html, Styler.apply, Styler.applymap
Milestone

Comments

@numpand
Copy link

numpand commented Jul 22, 2013

related #3190

Currently it is only possible to specify justify settings for column headers. This would extremely useful when used in conjunction with IPython Notebook.

@cpcloud
Copy link
Member

cpcloud commented Jul 22, 2013

i like this idea. want to submit a pr?

@jreback
Copy link
Contributor

jreback commented Jul 22, 2013

is there a standard way of doing this, e.g.

justify = [('foo','left'),('bar','right')]

or

justify_left = ['foo'], justify_right = ['bar']

or

style = dict(justify_left = ['foo'], justify_right = ['bar'])

?

@cpcloud
Copy link
Member

cpcloud commented Jul 22, 2013

@jreback i don't know. u don't think this is output-formatting tag material?

@jreback
Copy link
Contributor

jreback commented Jul 22, 2013

yes...but how to you specify to the function that you want to do this? there are other options in html as well (color e.g., that we may want to support in the future). Looking for a general API to pass output-formatting options. Which might be as simple as allowing column_label_formatter, row_label_formatter, cell_formatter as passed functions?

@cpcloud
Copy link
Member

cpcloud commented Jul 22, 2013

related #3190

@cpcloud
Copy link
Member

cpcloud commented Jul 22, 2013

but #3190 is long term and would require a significant time investment

@jreback
Copy link
Contributor

jreback commented Jul 22, 2013

It think pretty easy to pass a style=Formatter() where formatter is class that we define as a base class and advanced could sub-class. the engines then call out to format rows,columns,cells....

but agreed prob a bit of work to do correctly

@cpcloud
Copy link
Member

cpcloud commented Jul 22, 2013

someone could write a package and call it framer or framed to do this....

@cpcloud
Copy link
Member

cpcloud commented Jul 22, 2013

Formatter would work tho, while we don't have framed

@jreback
Copy link
Contributor

jreback commented Jul 22, 2013

or maybe Style

@jreback
Copy link
Contributor

jreback commented Jul 22, 2013

and HTMLStyle, TextStyle.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Enhancement IO Data IO issues that don't fit into a more specific label IO HTML read_html, to_html, Styler.apply, Styler.applymap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants