[IPython-dev] IPyTables - simple table construction for IPython
Thomas Kluyver
takowl at gmail.com
Wed Mar 6 07:16:34 EST 2013
Working in the Notebook recently, I've found that I often want to display
results in a table. pandas' DataFrames display nicely, but they're not
terribly convenient if your data isn't already in that form, and I found
myself assembling HTML in my code.
Enter IPyTables. It's a simple interface to build tables for display in the
notebook. At the easiest, you just pass in a series of tuples:
Table((4, 1, 8),
(9, 7, 3),
(5, 2, 6))
With a little bit more effort, you can add header cells and customise the
formatting.
Demo: http://nbviewer.ipython.org/5098827
Module: https://gist.github.com/takluyver/5098835
This is a prototype that I've thrown together quickly: feedback is very
welcome. Obvious extensions include:
- Expose more style attributes for customisation (so far it's just text and
background colour)
- Add a plain text repr(), so that tables are useable in the terminal
Thanks,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20130306/a50c1e2d/attachment.html>
More information about the IPython-dev
mailing list