Skip to content

Instantly share code, notes, and snippets.

@realfirst
Created April 14, 2019 01:36
Show Gist options
  • Save realfirst/9447fe66eedf3b8a2e23dfb10b8d2529 to your computer and use it in GitHub Desktop.
Save realfirst/9447fe66eedf3b8a2e23dfb10b8d2529 to your computer and use it in GitHub Desktop.
display multiple ``DataFrame``s side by side
class display(object):
"""Display HTML representation of multiple objects"""
template = """<div style="float: left; padding: 10px;">
<p style='font-family:"Courier New", Courier, monospace'>{0}</p>{1}
</div>"""
def __init__(self, *args):
self.args = args
def _repr_html_(self):
return '\n'.join(self.template.format(a, eval(a)._repr_html_())
for a in self.args)
def __repr__(self):
return '\n\n'.join(a + '\n' + repr(eval(a))
for a in self.args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment