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

ENH: Issue #2679. DataFrame.to_html() to create hyperlinks for valid URL... #9880

Closed
wants to merge 1 commit into from

Conversation

tdas14
Copy link

@tdas14 tdas14 commented Apr 13, 2015

Closes #2679

@shoyer
Copy link
Member

shoyer commented Apr 13, 2015

how does this handle the automatic HTML pretty-printing of dataframes in the ipython notebook? is the presentation of URLs affected?

@tdas14
Copy link
Author

tdas14 commented Apr 13, 2015

Aa far as I know it shouldn't. All it does is check for a valid url string and then put the value in an
tag.

@shoyer
Copy link
Member

shoyer commented Apr 13, 2015

would you mind doing a quick sanity check of the notebook output under your patch? e.g., this is what I currently see:
screen shot 2015-04-13 at 4 20 57 pm

@shoyer
Copy link
Member

shoyer commented Apr 13, 2015

For what it's worth, I don't think it would be a bad thing for the notebook output to include URLs as links, but it would definitely be annoying if they are pretty-printed as a HTML code inside the table :).

@kay1793
Copy link

kay1793 commented Apr 13, 2015

this should to be optional at the very least if not off by default for backward compatibility.
to_html is not used solely for ipnb display.

@jreback jreback added IO HTML read_html, to_html, Styler.apply, Styler.applymap Enhancement labels Apr 14, 2015
@jreback
Copy link
Contributor

jreback commented Jul 12, 2015

@tdas14 this needs to be an option when printing (e.g. passed to .to_html).

@@ -716,6 +716,35 @@ def test_to_html_multiindex_sparsify_false_multi_sparse(self):
</table>"""
self.assertEqual(result, expected)


def test_to_html_with_hyperlinks(self):
df = DataFrame([[0,'http://pandas.pydata.org/', 'pydata.org']],columns=['foo', 'bar', None], index=lrange(1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the issue number here as a comment

@jreback
Copy link
Contributor

jreback commented Oct 11, 2015

@tdas14 this needs to be an option directly to .to_html, further, you could add a global option in display.html.render_links, as a boolean (default should be False for back-compat)

@jreback jreback added the Output-Formatting __repr__ of pandas objects, to_string label Oct 11, 2015
@jreback
Copy link
Contributor

jreback commented Nov 2, 2015

closing, but if you would like to continue working on this pls reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement IO HTML read_html, to_html, Styler.apply, Styler.applymap Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improvement: DataFrame.to_html() to create hyperlinks
4 participants