#!/usr/bin/env python # coding: utf-8 # # Welcome to an example Binder # This notebook uses a Python environment with a few libraries, including `dask`, all of which were specificied using a `conda` [environment.yml](../edit/environment.yml) file. To demo the environment, we'll show a simplified example of using `dask` to analyze time series data, adapted from Matthew Rocklin's excellent repo of [dask examples](https://github.com/blaze/dask-examples) — check out that repo for the full version (and many other examples). # ## Setup plotting # In[1]: get_ipython().run_line_magic('matplotlib', 'inline') # ## Turn on a global progress bar # In[2]: from dask.diagnostics import ProgressBar # In[3]: progress_bar = ProgressBar() progress_bar.register() # ## Generate fake data # In[4]: import dask.dataframe as dd # In[5]: df = dd.demo.make_timeseries(start='2000', end='2015', dtypes={'A': float, 'B': int}, freq='5s', partition_freq='3M', seed=1234) # ## Compute and plot a cumulative sum # In[6]: df.A.cumsum().resample('1w').mean().compute().plot();