Tables and Data

Datapane has various blocks for adding datasets to your reports, from simple tables to interactive drilldowns.

Table

The Table component takes a pandas DataFrame and renders an HTML table in your report.

import datapane as dp
import pandas as pd
import numpy as np
df = pd.DataFrame({
'A': np.random.normal(-1, 1, 5),
'B': np.random.normal(1, 2, 5),
})
table = dp.Table(df)
report = dp.Report(table)
report.publish(name='sample_table')

If your DataFrame includes DataFrame Styles, these will be included in your report. DataFrame styles allows you create custom formatted tables; for instance, to show trends, highlight cells, add bar charts, or display correlations.

Table is the best option for displaying multidimensional DataFrames, as DataTable will flatten your data.

DataTable

The DataTable block takes a pandas DataFrame and renders an interactive, sortable, searchable table in your report. By default it displays 10 rows per page, with multiple pages which allows for arbitrarily large datasets. Viewers can also download the table from the website as a CSV file.

import datapane as dp
import pandas as pd
import numpy as np
df = pd.DataFrame({
'A': np.random.normal(-1, 1, 5000),
'B': np.random.normal(1, 2, 5000),
})
table = dp.DataTable(df)
report = dp.Report(table)
report.publish(name='sample_table')

Python Dictionary & JSON

To include Python objects and JSON, we recommend using the File block.

Big Number

A single number or change can often be the most important thing in a report. The BigNumbercomponent allows you to present KPIs, changes, and statistics in a friendly way to your viewers. You can optionally set intent, and pass in numbers or text.

For full reference on styling your number, see the API Documentation.

import datapane as dp
dp.Report(
dp.Group(columns=2,
dp.BigNumber(
heading="Number of percentage points",
value="84%",
change="2%",
is_upward_change=True
),
dp.BigNumber(
heading="Simple Statistic",
value=100
)
)
)