This first step to the tutorial will make sure your system is set up to do all the remaining sections, with all software installed and all data downloaded as needed. The index provided some links you might want to examine before you start.
Please consult holoviz.org for the full instructions on installing the software used in these tutorials. Here is the condensed version of those instructions, assuming you have already downloaded and installed Anaconda or Miniconda and have opened a command prompt in a Conda environment:
conda install anaconda-project
anaconda-project download pyviz/holoviz_tutorial
cd holoviz_tutorial # You may need to delete this directory if you've run the command above before
anaconda-project run jupyter notebook
If you prefer JupyterLab to the default (classic) notebook interface, you can replace "notebook" with "lab".
Once your chosen environment is running, navigate to tutorial/00_Setup.ipynb
(i.e. this notebook) and run the following cell to test the key imports needed for this tutorial. If it completes without errors your environment should be ready to go:
import datashader as ds, bokeh, holoviews as hv # noqa
from distutils.version import LooseVersion
min_versions = dict(ds='0.13.0', bokeh='2.3.2', hv='1.14.4')
for lib, ver in min_versions.items():
v = globals()[lib].__version__
if LooseVersion(v) < LooseVersion(ver):
print("Error: expected {}={}, got {}".format(lib,ver,v))
And you should see the HoloViews, Bokeh, and Matplotlib logos after running the following cell:
hv.extension('bokeh', 'matplotlib')
Lastly, let's make sure the datasets needed are available. First, check that the large earthquake dataset was downloaded correctly during the anaconda-project run
command:
import os
from pyct import cmd
if not os.path.isfile('../data/earthquakes-projected.parq'):
cmd.fetch_data(name='holoviz', path='..') # Alternative way to fetch the data
Make sure that you have the SNAPPY dependency required to read these data:
try:
import pandas as pd
columns = ['depth', 'id', 'latitude', 'longitude', 'mag', 'place', 'time', 'type']
data = pd.read_parquet('../data/earthquakes-projected.parq', columns=columns, engine='fastparquet')
data.head()
except RuntimeError as e:
print('The data cannot be read: %s' % e)
If you don't see any error messages above, you should be good to go! Now that you are set up, you can continue with the rest of the tutorial sections.