Small overview of HoloViz capability of data exploration
Small overview of HoloViz capability of data exploration#
This notebook is intended to present a small overview of HoloViz and the capability for data exploration, with interactive plots (show difference between matplotlib and bokeh). Many parts are based on or copied from the official HoloViz Tutorial (highly recommended for a more extensive overview of the possibilities of HoloViz).
Note: In June 2019 the project name changed from PyViz to HoloViz. The reason for this is explained in this blog post.
HoloViz Packages used for this notebook#
Exploring Pandas Dataframes#
If your data is in a Pandas dataframe, it’s natural to explore it using the
.plot() method (based on Matplotlib). Let’s have a look at some automatic weather station data from Langenferner:
import pandas as pd url = 'https://cluster.klima.uni-bremen.de/~oggm/tutorials/aws_data_Langenferner_UTC+2.csv' df = pd.read_csv(url, index_col=0, parse_dates=True) df.head()
.plot() won’t give anything meaningful, because of the different magnitudes of the parameters:
Of course we can have a look at one variable only:
This creates a static plot using matplotlib. With this approach we also can make some further explorations, like calculating the monthly mean temperature:
dfm = df.resample('m').mean() dfm.TEMP.plot();
We can see the course of the parameter but we can not tell what was the exact temperature at January and we also cannot zoom in.
Exploring Data with hvPlot and Bokeh#
If we are using
hvplot instead we can create interactive plots with the same plotting API:
you might need to install first hvplot via e.g. conda install -c pyviz hvplot
import hvplot.pandas df.TEMP.hvplot()