{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "

Tutorial 0. Setup

\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This first step to the tutorial will make sure your system is set up to do all\n", "the remaining sections, with all software installed and all data downloaded as\n", "needed. The [index](index.ipynb) covered background you might want before you\n", "start.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Getting set up\n", "\n", "**NOTE: If you are running in ohw.pilot.2i2c.cloud you can skip this notebook.**\n", "\n", "Please consult [holoviz.org](http://holoviz.org/installation.html) for the full\n", "instructions on installing the software used in these tutorials. Here is the\n", "condensed version of those instructions, assuming you have already downloaded\n", "and installed [Anaconda](https://www.anaconda.com/download) or\n", "[Miniconda](https://conda.io/miniconda.html):\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```\n", "conda create -n holoviz-tutorial python=3.7\n", "conda activate holoviz-tutorial\n", "conda install -c pyviz holoviz\n", "holoviz examples\n", "cd holoviz-examples\n", "jupyter notebook\n", "```\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "See the full instructions at [holoviz.org](http://holoviz.org/installation.html)\n", "if you don't yet have conda, if you have an old version of conda, or if you are\n", "using JupyterLab.\n", "\n", "Once everything is installed, run the following cell to test the key imports\n", "needed for this tutorial. If it completes without errors your environment should\n", "be ready to go:\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import datashader as ds, bokeh, holoviews as hv # noqa\n", "from distutils.version import LooseVersion\n", "\n", "min_versions = dict(ds=\"0.11.0\", bokeh=\"2.0.1\", hv=\"1.13.2\")\n", "\n", "for lib, ver in min_versions.items():\n", " v = globals()[lib].__version__\n", " if LooseVersion(v) < LooseVersion(ver):\n", " print(\"Error: expected {}={}, got {}\".format(lib, ver, v))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And you should see the HoloViews, Bokeh, and Matplotlib logos after running the\n", "following cell:\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "hv.extension(\"bokeh\", \"matplotlib\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Accessing sample data\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Lastly, let's make sure the datasets needed are available. First, check the\n", "dataset was downloaded correctly during installation:\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from load_data import *\n", "\n", "df = load_data()\n", "df.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you don't see any error messages above, you should be good to go! Now that\n", "you are set up, you can continue with the\n", "[rest of the tutorial sections](01_Overview.ipynb). You can also skip ahead to\n", "sections that speak to your interests more directly, such as\n", "[Building Panels](02_Building_Panels.ipynb),\n", "[Working with Large Data](07_Large_Data.ipynb), or the various\n", "[real-world examples of using a variety of tools to solve a visualization problem](https://examples.pyviz.org).\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:root] *", "language": "python", "name": "conda-root-py" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.6" } }, "nbformat": 4, "nbformat_minor": 4 }