Datapane has first-class Jupyter Notebook support. This includes Jupyter Lab, Jupyter Notebook, Google Colab, and Visual Studio Code with the Jupyter plugin.
Let's see how Datapane and Jupyter Notebook can build data-powered apps, all without disrupting your workflow.
Notebook to Data App? One line of code.
Data analysis often begins in a Jupyter Notebook, and once complete, we need to share our insights.
Some recipients may be comfortable with an
.ipynb file, and in those instances, you could just send your notebook over and still benefit from Datapane's enhancements.
But in most cases, you will want to turn your notebook into something presentable and accessible. With Datapane, all it takes is a single line of code.
Datapane will automatically detect your cells and convert them to Datapane blocks.
Don't forget to save your notebook before calling
Opt-in or opt-out
By default, notebook-to-app conversion will include all markdown and supported cell output. This is the easiest and quickest way to turn your notebook into an app.
In this mode, you can explicitly exclude cells with the cell tag
In some cases, it is preferable to only include cells of interest. This can be achieved by setting
In this mode, you can explicitly include supported cells with the cell tag
Display input code
You may want to display the input code for a particular cell in your app. Datapane has you covered. You can include code cells with the cell tag
Let's do this for the cell below:
Supercharge your notebook with Datapane
Datapane Blocks are powerful - and they can be embedded straight into your notebook.
The notebook journey often begins by loading in a dataset and displaying it for a quick sanity check. Something like the following:
That's not bad, but it could be much better. Let's wrap our DataFrame in Datapane's
dp.DataTable block and see what happens.
Our DataFrame is now interactive. We can explore it with filters, sorting, export options, and even run SQL queries against the data.
Better structure with Tabs
Notebooks don't have to be a flood of in/out cells that are viewed from top to bottom. We can add depth to our notebooks with tabs.
Let's create a scatter plot with our dataset from earlier...
... and bring them both together with a
/home/runner/work/datapane-hosted/datapane-hosted/public-docs/.venv/lib/python3.10/site-packages/altair/utils/core.py:317: FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead. for col_name, dtype in df.dtypes.iteritems():
Now we have an interactive plot, and we can switch to that same interactive data explorer from earlier by clicking the "Data" tab.
Check out the Blocks Catalog
Enhance your data apps with Datapane's catalog of blocks, which includes the handy