ipy_table is a supporting module for IP[y]:Notebook which makes it easy to create richly formatted data tables.
The home page for ipy_table is at epmoyer.github.com/ipy_table/
ipy_table is maintained at github.com/epmoyer/ipy_table
To create a table in interactive mode, import ipy_table and call make_table() on an array.
Notes:
numpy.ndarray.str() on those objects.from ipy_table import *
planets = [
['Planet', 'Mass (kg)', 'Diameter (km)'],
['Mercury', 3.3022E23, 4879],
['Venus', 4.896E24, 12104],
['Earth', 5.972E24, 12735],
['Mars', 6.4191E23, 6772]];
make_table(planets)
The make_table() interface is interactive, so after calling make_table() we can call style formatting commands to modify the current table format. Here we'll apply the "basic" table theme.
Note: Use "basic_left" for tables with row headers. Use "basic_both" for tables with row and coulmn headers.
apply_theme('basic')
The Mass values are being fully expanded. By default ipy_table formats floating point numbers using the Python formatting string "%0.4f". We can override that by setting the float_format parameter.
set_global_style(float_format='%0.3E')
All cell formatting is dynamic. Custom formatting can be applied by calling set_<global, row, column, cell>_style().
set_row_style(3,color='yellow')
For documentation on all ipy_table commands, see the ipy_table reference notebook (ipy_table-Reference.ipynb)