Download this notebook from GitHub (right-click to download).

Table Element
import holoviews as hv

A table is more general than an ItemTable, as it allows multi-dimensional keys and multidimensional values. Let’s say we have the following data:

gender = ['M','M', 'M','F']
age = [10,16,13,12]
weight = [15,18,16,10]
height = [0.8,0.6,0.7,0.8]

We can construct a Table using a dictionary format (identical in format as that accepted by the pandas DataFrame):

hv.Table({'Gender':gender, 'Age':age, 'Weight':weight, 'Height':height},
         ['Gender', 'Age'],  ['Weight', 'Height'])

Or we can declare the same table by dimension position, with key dimensions followed by value dimensions:

table = hv.Table((gender, age, weight, height), ['Gender', 'Age'], ['Weight', 'Height'])

Note that you can use the select method using tables by the key dimensions:'M') +'M', Age=10)

The Table is used as a common data structure that may be converted to any other HoloViews data structure via the to utility available on the object. Here we use this utility to show the weight of the males in our dataset by age:'M').to.curve(kdims=["Age"], vdims=["Weight"])

For more extended usage of table conversion see the Tabular Datasets user guide.

For full documentation and the available style and plot options, use

This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.

Download this notebook from GitHub (right-click to download).