{
"cells": [
{
"cell_type": "code",
"execution_count": 125,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T18:23:27.913617Z",
"start_time": "2018-04-23T18:23:27.907494Z"
},
"nbpresent": {
"id": "50c87bfd-5eea-4a72-b9b7-41882062a25a"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"data": {
"text/html": [
" "
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%HTML\n",
" "
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpresent": {
"id": "1fd0e61d-57b0-4843-9673-a3b5d9d55bc3"
},
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# HODL-AI: Live Coding RNN on the Blockchain\n",
"\n",
"_Machine Learning Mega Bash_ \n",
"\n",
"2018/04/23 - Blackbox, Belfast\n",
"\n",
"_This presentation and associated files are available at [present.bolster.online](http://present.bolster.online)_\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpresent": {
"id": "4ae5529d-5aaa-423e-967b-fa79455c0231"
},
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"## Who are ya?\n",
"* Andrew Bolster (@bolster)\n",
"* MEng Elec. & SW Eng. QUB\n",
"* PhD Autonomous Systems UoL\n",
"* Data Scientist at Alert Logic\n",
"* Director at Farset Labs"
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpresent": {
"id": "13d20d4d-c608-445c-a49f-394619c393f2"
},
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"## Whats the craic?\n",
"* Garth got me in a moment of weakness and I spouted a load of BS clickbait buzzwords at him. Seemed like a good idea at the time. \n",
"* AI / ML is a load of FUD, but sometimes it's worth going through with a bad idea to get an understanding of why the decisions we make in ML pipelines massively change the outcomes."
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpresent": {
"id": "fc2973da-a545-4c30-a9a8-3a3a39039597"
},
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"## Caveats\n",
"\n",
"* Bitcoin Valuations are BS and are the definition of an irrational market; the idea that a simple one notebook ML model would in any way accurately predict future variations is similarly BS.\n",
"* The purpose of this talk is to explore timeseries analysis using a Python/ScikitLearn/Keras stack, not to make you (or me) rich.\n",
"* I guarantee I will mess up at some point(s).\n",
"* **Spoilers**: This method does not work because of the simplicity of the networks used, instead I want to show the 'beginning' of a model search, not the answers."
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"## Background Info\n",
"\n",
"### What is Blockchain?\n",
"* A consensus based distributed ledger with (mostly) guaranteed proof of work.\n",
"* A fantastic solution in search of a problem."
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"### What are Neural Networks\n",
"* Simple cells connected together in particular ways to enable learning of abstract input/output mappings\n",
"![](nn.png)"
]
},
{
"cell_type": "markdown",
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T08:04:40.714100Z",
"start_time": "2018-04-23T08:04:40.589141Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"### What are Recurrent Neural Networks\n",
"* Separated dimensionality of input/output (usually time)\n",
"* Changes process from 'state analysis' to 'sequence analysis'\n",
"* Can be 1-1/1-*/*-1/*-*\n",
"![](rnn.png)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"### What are Long Short-Term Memory cells?\n",
"* They so fancy!\n",
"* Input-Output-Forget\n",
"* Corrects for vanishing gradient problems\n",
"![](lstm.jpg)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"### What is Keras?\n",
"\n",
"> Keras is a high-level neural networks API, written in Python and capable of running on top of TensorFlow, CNTK, or Theano. It was developed with a focus on enabling fast experimentation. Being able to go from idea to result with the least possible delay is key to doing good research."
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpresent": {
"id": "1be69ffe-1dc3-41bf-a3d9-bb131202eae7"
},
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"## Requirements"
]
},
{
"cell_type": "code",
"execution_count": 126,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T18:48:15.541953Z",
"start_time": "2018-04-23T18:48:14.895162Z"
},
"nbpresent": {
"id": "e4d1c9be-9927-4846-b48a-5121af3665c2"
},
"slideshow": {
"slide_type": "-"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirements satisfied\n"
]
}
],
"source": [
"requirements=\"autopep8 gdax pandas numpy cufflinks sklearn keras keras-tqdm\"\n",
"# autopep8 is to make the jupyter notebook pretty\n",
"# gdax does bitcoin\n",
"# pandas numpy sklearn keras for data and machine learning\n",
"# See https://andrewbolster.info/2017/10/my-basic-python-data-science-setup\n",
"import pip\n",
"if 0== pip.main(f'install -q {requirements}'.split()):\n",
" print(\"Requirements satisfied\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"## Zee Plan\n",
"\n",
"### Part The First - It's The Data, Stupid\n",
"* Data Extraction (Collection/Acquisition/Ingestion)\n",
"* Data Transformation (Cleaning/Sanitising)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"### Part The Second - Prepare to Fail, Fail to Prepare\n",
"* Problem Transformation to a Supervised Learning Problem\n",
"* Scaling and Activation\n",
"* Basic Single Layer Univariate LSTM\n",
"* Performance Review"
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpresent": {
"id": "efd34c2e-a8ee-476f-b2a7-6cc258b80fec"
},
"slideshow": {
"slide_type": "notes"
}
},
"source": [
"## Notes\n",
"* https://machinelearningmastery.com/time-series-forecasting-long-short-term-memory-network-python/"
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpresent": {
"id": "0b80d536-1bd9-44bc-a3b2-83c3abeaf1d2"
},
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# It's the data, stupid\n",
"Where does it come from? \n",
"What format is it in?\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"nbpresent": {
"id": "04cdbbf0-c28c-418a-a490-251b44fe0c65"
},
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Chasing the blockchain\n",
"* [`gdax-python`](https://github.com/danpaquin/gdax-python) is awesome\n",
"* [Great Hackernoon Writeup](https://hackernoon.com/beginners-guide-to-gdax-an-exchange-of-coinbase-to-trade-btc-eth-and-ltc-e418fd1acd1b)\n",
"* Allows programmatic trading.\n",
"* But we're not doing that today; KISS"
]
},
{
"cell_type": "code",
"execution_count": 129,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T18:52:42.638269Z",
"start_time": "2018-04-23T18:52:42.305158Z"
},
"nbpresent": {
"id": "bdd4abcb-d36f-4561-a4df-908178fc2483"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/plain": [
"[{'id': 'BCH-BTC',\n",
" 'base_currency': 'BCH',\n",
" 'quote_currency': 'BTC',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '200',\n",
" 'quote_increment': '0.00001',\n",
" 'display_name': 'BCH/BTC',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '0.001',\n",
" 'max_market_funds': '30',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'BCH-USD',\n",
" 'base_currency': 'BCH',\n",
" 'quote_currency': 'USD',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '350',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'BCH/USD',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '1000000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'BTC-EUR',\n",
" 'base_currency': 'BTC',\n",
" 'quote_currency': 'EUR',\n",
" 'base_min_size': '0.001',\n",
" 'base_max_size': '50',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'BTC/EUR',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '600000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'BTC-GBP',\n",
" 'base_currency': 'BTC',\n",
" 'quote_currency': 'GBP',\n",
" 'base_min_size': '0.001',\n",
" 'base_max_size': '20',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'BTC/GBP',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '200000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'BTC-USD',\n",
" 'base_currency': 'BTC',\n",
" 'quote_currency': 'USD',\n",
" 'base_min_size': '0.001',\n",
" 'base_max_size': '70',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'BTC/USD',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '1000000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'ETH-BTC',\n",
" 'base_currency': 'ETH',\n",
" 'quote_currency': 'BTC',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '600',\n",
" 'quote_increment': '0.00001',\n",
" 'display_name': 'ETH/BTC',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '0.001',\n",
" 'max_market_funds': '50',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'ETH-EUR',\n",
" 'base_currency': 'ETH',\n",
" 'quote_currency': 'EUR',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '400',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'ETH/EUR',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '400000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'ETH-USD',\n",
" 'base_currency': 'ETH',\n",
" 'quote_currency': 'USD',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '700',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'ETH/USD',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '1000000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'LTC-BTC',\n",
" 'base_currency': 'LTC',\n",
" 'quote_currency': 'BTC',\n",
" 'base_min_size': '0.1',\n",
" 'base_max_size': '2000',\n",
" 'quote_increment': '0.00001',\n",
" 'display_name': 'LTC/BTC',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '0.001',\n",
" 'max_market_funds': '30',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'LTC-EUR',\n",
" 'base_currency': 'LTC',\n",
" 'quote_currency': 'EUR',\n",
" 'base_min_size': '0.1',\n",
" 'base_max_size': '1000',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'LTC/EUR',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '200000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'LTC-USD',\n",
" 'base_currency': 'LTC',\n",
" 'quote_currency': 'USD',\n",
" 'base_min_size': '0.1',\n",
" 'base_max_size': '4000',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'LTC/USD',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '1000000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'BCH-EUR',\n",
" 'base_currency': 'BCH',\n",
" 'quote_currency': 'EUR',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '120',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'BCH/EUR',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '200000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False}]"
]
},
"execution_count": 129,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Get products list from gdax public client\n",
"import gdax\n",
"public_client = gdax.PublicClient()\n",
"public_client.get_products()"
]
},
{
"cell_type": "code",
"execution_count": 76,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:22:47.751499Z",
"start_time": "2018-04-23T17:22:47.125525Z"
},
"nbpresent": {
"id": "c4b2a703-2ca3-4094-97d7-85e72d9c2c79"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"data": {
"text/plain": [
"[{'id': 'BCH-BTC',\n",
" 'base_currency': 'BCH',\n",
" 'quote_currency': 'BTC',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '200',\n",
" 'quote_increment': '0.00001',\n",
" 'display_name': 'BCH/BTC',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '0.001',\n",
" 'max_market_funds': '30',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'BCH-USD',\n",
" 'base_currency': 'BCH',\n",
" 'quote_currency': 'USD',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '350',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'BCH/USD',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '1000000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'BTC-EUR',\n",
" 'base_currency': 'BTC',\n",
" 'quote_currency': 'EUR',\n",
" 'base_min_size': '0.001',\n",
" 'base_max_size': '50',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'BTC/EUR',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '600000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'BTC-GBP',\n",
" 'base_currency': 'BTC',\n",
" 'quote_currency': 'GBP',\n",
" 'base_min_size': '0.001',\n",
" 'base_max_size': '20',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'BTC/GBP',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '200000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'BTC-USD',\n",
" 'base_currency': 'BTC',\n",
" 'quote_currency': 'USD',\n",
" 'base_min_size': '0.001',\n",
" 'base_max_size': '70',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'BTC/USD',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '1000000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'ETH-BTC',\n",
" 'base_currency': 'ETH',\n",
" 'quote_currency': 'BTC',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '600',\n",
" 'quote_increment': '0.00001',\n",
" 'display_name': 'ETH/BTC',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '0.001',\n",
" 'max_market_funds': '50',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'ETH-EUR',\n",
" 'base_currency': 'ETH',\n",
" 'quote_currency': 'EUR',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '400',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'ETH/EUR',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '400000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'ETH-USD',\n",
" 'base_currency': 'ETH',\n",
" 'quote_currency': 'USD',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '700',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'ETH/USD',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '1000000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'LTC-BTC',\n",
" 'base_currency': 'LTC',\n",
" 'quote_currency': 'BTC',\n",
" 'base_min_size': '0.1',\n",
" 'base_max_size': '2000',\n",
" 'quote_increment': '0.00001',\n",
" 'display_name': 'LTC/BTC',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '0.001',\n",
" 'max_market_funds': '30',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'LTC-EUR',\n",
" 'base_currency': 'LTC',\n",
" 'quote_currency': 'EUR',\n",
" 'base_min_size': '0.1',\n",
" 'base_max_size': '1000',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'LTC/EUR',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '200000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'LTC-USD',\n",
" 'base_currency': 'LTC',\n",
" 'quote_currency': 'USD',\n",
" 'base_min_size': '0.1',\n",
" 'base_max_size': '4000',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'LTC/USD',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '1000000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False},\n",
" {'id': 'BCH-EUR',\n",
" 'base_currency': 'BCH',\n",
" 'quote_currency': 'EUR',\n",
" 'base_min_size': '0.01',\n",
" 'base_max_size': '120',\n",
" 'quote_increment': '0.01',\n",
" 'display_name': 'BCH/EUR',\n",
" 'status': 'online',\n",
" 'margin_enabled': False,\n",
" 'status_message': None,\n",
" 'min_market_funds': '10',\n",
" 'max_market_funds': '200000',\n",
" 'post_only': False,\n",
" 'limit_only': False,\n",
" 'cancel_only': False}]"
]
},
"execution_count": 76,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import gdax\n",
"public_client = gdax.PublicClient()\n",
"public_client.get_products()"
]
},
{
"cell_type": "code",
"execution_count": 130,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T18:53:25.908270Z",
"start_time": "2018-04-23T18:53:25.021685Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" base_currency | \n",
" base_max_size | \n",
" base_min_size | \n",
" cancel_only | \n",
" display_name | \n",
" id | \n",
" limit_only | \n",
" margin_enabled | \n",
" max_market_funds | \n",
" min_market_funds | \n",
" post_only | \n",
" quote_currency | \n",
" quote_increment | \n",
" status | \n",
" status_message | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" BCH | \n",
" 200 | \n",
" 0.01 | \n",
" False | \n",
" BCH/BTC | \n",
" BCH-BTC | \n",
" False | \n",
" False | \n",
" 30 | \n",
" 0.001 | \n",
" False | \n",
" BTC | \n",
" 0.00001 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 1 | \n",
" BCH | \n",
" 350 | \n",
" 0.01 | \n",
" False | \n",
" BCH/USD | \n",
" BCH-USD | \n",
" False | \n",
" False | \n",
" 1000000 | \n",
" 10 | \n",
" False | \n",
" USD | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 2 | \n",
" BTC | \n",
" 50 | \n",
" 0.001 | \n",
" False | \n",
" BTC/EUR | \n",
" BTC-EUR | \n",
" False | \n",
" False | \n",
" 600000 | \n",
" 10 | \n",
" False | \n",
" EUR | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 3 | \n",
" BTC | \n",
" 20 | \n",
" 0.001 | \n",
" False | \n",
" BTC/GBP | \n",
" BTC-GBP | \n",
" False | \n",
" False | \n",
" 200000 | \n",
" 10 | \n",
" False | \n",
" GBP | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 4 | \n",
" BTC | \n",
" 70 | \n",
" 0.001 | \n",
" False | \n",
" BTC/USD | \n",
" BTC-USD | \n",
" False | \n",
" False | \n",
" 1000000 | \n",
" 10 | \n",
" False | \n",
" USD | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 5 | \n",
" ETH | \n",
" 600 | \n",
" 0.01 | \n",
" False | \n",
" ETH/BTC | \n",
" ETH-BTC | \n",
" False | \n",
" False | \n",
" 50 | \n",
" 0.001 | \n",
" False | \n",
" BTC | \n",
" 0.00001 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 6 | \n",
" ETH | \n",
" 400 | \n",
" 0.01 | \n",
" False | \n",
" ETH/EUR | \n",
" ETH-EUR | \n",
" False | \n",
" False | \n",
" 400000 | \n",
" 10 | \n",
" False | \n",
" EUR | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 7 | \n",
" ETH | \n",
" 700 | \n",
" 0.01 | \n",
" False | \n",
" ETH/USD | \n",
" ETH-USD | \n",
" False | \n",
" False | \n",
" 1000000 | \n",
" 10 | \n",
" False | \n",
" USD | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 8 | \n",
" LTC | \n",
" 2000 | \n",
" 0.1 | \n",
" False | \n",
" LTC/BTC | \n",
" LTC-BTC | \n",
" False | \n",
" False | \n",
" 30 | \n",
" 0.001 | \n",
" False | \n",
" BTC | \n",
" 0.00001 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 9 | \n",
" LTC | \n",
" 1000 | \n",
" 0.1 | \n",
" False | \n",
" LTC/EUR | \n",
" LTC-EUR | \n",
" False | \n",
" False | \n",
" 200000 | \n",
" 10 | \n",
" False | \n",
" EUR | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 10 | \n",
" LTC | \n",
" 4000 | \n",
" 0.1 | \n",
" False | \n",
" LTC/USD | \n",
" LTC-USD | \n",
" False | \n",
" False | \n",
" 1000000 | \n",
" 10 | \n",
" False | \n",
" USD | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 11 | \n",
" BCH | \n",
" 120 | \n",
" 0.01 | \n",
" False | \n",
" BCH/EUR | \n",
" BCH-EUR | \n",
" False | \n",
" False | \n",
" 200000 | \n",
" 10 | \n",
" False | \n",
" EUR | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" base_currency base_max_size base_min_size cancel_only display_name \\\n",
"0 BCH 200 0.01 False BCH/BTC \n",
"1 BCH 350 0.01 False BCH/USD \n",
"2 BTC 50 0.001 False BTC/EUR \n",
"3 BTC 20 0.001 False BTC/GBP \n",
"4 BTC 70 0.001 False BTC/USD \n",
"5 ETH 600 0.01 False ETH/BTC \n",
"6 ETH 400 0.01 False ETH/EUR \n",
"7 ETH 700 0.01 False ETH/USD \n",
"8 LTC 2000 0.1 False LTC/BTC \n",
"9 LTC 1000 0.1 False LTC/EUR \n",
"10 LTC 4000 0.1 False LTC/USD \n",
"11 BCH 120 0.01 False BCH/EUR \n",
"\n",
" id limit_only margin_enabled max_market_funds min_market_funds \\\n",
"0 BCH-BTC False False 30 0.001 \n",
"1 BCH-USD False False 1000000 10 \n",
"2 BTC-EUR False False 600000 10 \n",
"3 BTC-GBP False False 200000 10 \n",
"4 BTC-USD False False 1000000 10 \n",
"5 ETH-BTC False False 50 0.001 \n",
"6 ETH-EUR False False 400000 10 \n",
"7 ETH-USD False False 1000000 10 \n",
"8 LTC-BTC False False 30 0.001 \n",
"9 LTC-EUR False False 200000 10 \n",
"10 LTC-USD False False 1000000 10 \n",
"11 BCH-EUR False False 200000 10 \n",
"\n",
" post_only quote_currency quote_increment status status_message \n",
"0 False BTC 0.00001 online None \n",
"1 False USD 0.01 online None \n",
"2 False EUR 0.01 online None \n",
"3 False GBP 0.01 online None \n",
"4 False USD 0.01 online None \n",
"5 False BTC 0.00001 online None \n",
"6 False EUR 0.01 online None \n",
"7 False USD 0.01 online None \n",
"8 False BTC 0.00001 online None \n",
"9 False EUR 0.01 online None \n",
"10 False USD 0.01 online None \n",
"11 False EUR 0.01 online None "
]
},
"execution_count": 130,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# use pandas to format then products list to be a bit prettier\n",
"import pandas as pd\n",
"pd.DataFrame(public_client.get_products())"
]
},
{
"cell_type": "code",
"execution_count": 78,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:22:48.378005Z",
"start_time": "2018-04-23T17:22:47.758974Z"
},
"nbpresent": {
"id": "57b28eda-cbd5-4139-9521-814d446d0b40"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" base_currency | \n",
" base_max_size | \n",
" base_min_size | \n",
" cancel_only | \n",
" display_name | \n",
" id | \n",
" limit_only | \n",
" margin_enabled | \n",
" max_market_funds | \n",
" min_market_funds | \n",
" post_only | \n",
" quote_currency | \n",
" quote_increment | \n",
" status | \n",
" status_message | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" BCH | \n",
" 200 | \n",
" 0.01 | \n",
" False | \n",
" BCH/BTC | \n",
" BCH-BTC | \n",
" False | \n",
" False | \n",
" 30 | \n",
" 0.001 | \n",
" False | \n",
" BTC | \n",
" 0.00001 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 1 | \n",
" BCH | \n",
" 350 | \n",
" 0.01 | \n",
" False | \n",
" BCH/USD | \n",
" BCH-USD | \n",
" False | \n",
" False | \n",
" 1000000 | \n",
" 10 | \n",
" False | \n",
" USD | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 2 | \n",
" BTC | \n",
" 50 | \n",
" 0.001 | \n",
" False | \n",
" BTC/EUR | \n",
" BTC-EUR | \n",
" False | \n",
" False | \n",
" 600000 | \n",
" 10 | \n",
" False | \n",
" EUR | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 3 | \n",
" BTC | \n",
" 20 | \n",
" 0.001 | \n",
" False | \n",
" BTC/GBP | \n",
" BTC-GBP | \n",
" False | \n",
" False | \n",
" 200000 | \n",
" 10 | \n",
" False | \n",
" GBP | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 4 | \n",
" BTC | \n",
" 70 | \n",
" 0.001 | \n",
" False | \n",
" BTC/USD | \n",
" BTC-USD | \n",
" False | \n",
" False | \n",
" 1000000 | \n",
" 10 | \n",
" False | \n",
" USD | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 5 | \n",
" ETH | \n",
" 600 | \n",
" 0.01 | \n",
" False | \n",
" ETH/BTC | \n",
" ETH-BTC | \n",
" False | \n",
" False | \n",
" 50 | \n",
" 0.001 | \n",
" False | \n",
" BTC | \n",
" 0.00001 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 6 | \n",
" ETH | \n",
" 400 | \n",
" 0.01 | \n",
" False | \n",
" ETH/EUR | \n",
" ETH-EUR | \n",
" False | \n",
" False | \n",
" 400000 | \n",
" 10 | \n",
" False | \n",
" EUR | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 7 | \n",
" ETH | \n",
" 700 | \n",
" 0.01 | \n",
" False | \n",
" ETH/USD | \n",
" ETH-USD | \n",
" False | \n",
" False | \n",
" 1000000 | \n",
" 10 | \n",
" False | \n",
" USD | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 8 | \n",
" LTC | \n",
" 2000 | \n",
" 0.1 | \n",
" False | \n",
" LTC/BTC | \n",
" LTC-BTC | \n",
" False | \n",
" False | \n",
" 30 | \n",
" 0.001 | \n",
" False | \n",
" BTC | \n",
" 0.00001 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 9 | \n",
" LTC | \n",
" 1000 | \n",
" 0.1 | \n",
" False | \n",
" LTC/EUR | \n",
" LTC-EUR | \n",
" False | \n",
" False | \n",
" 200000 | \n",
" 10 | \n",
" False | \n",
" EUR | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 10 | \n",
" LTC | \n",
" 4000 | \n",
" 0.1 | \n",
" False | \n",
" LTC/USD | \n",
" LTC-USD | \n",
" False | \n",
" False | \n",
" 1000000 | \n",
" 10 | \n",
" False | \n",
" USD | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
" 11 | \n",
" BCH | \n",
" 120 | \n",
" 0.01 | \n",
" False | \n",
" BCH/EUR | \n",
" BCH-EUR | \n",
" False | \n",
" False | \n",
" 200000 | \n",
" 10 | \n",
" False | \n",
" EUR | \n",
" 0.01 | \n",
" online | \n",
" None | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" base_currency base_max_size base_min_size cancel_only display_name \\\n",
"0 BCH 200 0.01 False BCH/BTC \n",
"1 BCH 350 0.01 False BCH/USD \n",
"2 BTC 50 0.001 False BTC/EUR \n",
"3 BTC 20 0.001 False BTC/GBP \n",
"4 BTC 70 0.001 False BTC/USD \n",
"5 ETH 600 0.01 False ETH/BTC \n",
"6 ETH 400 0.01 False ETH/EUR \n",
"7 ETH 700 0.01 False ETH/USD \n",
"8 LTC 2000 0.1 False LTC/BTC \n",
"9 LTC 1000 0.1 False LTC/EUR \n",
"10 LTC 4000 0.1 False LTC/USD \n",
"11 BCH 120 0.01 False BCH/EUR \n",
"\n",
" id limit_only margin_enabled max_market_funds min_market_funds \\\n",
"0 BCH-BTC False False 30 0.001 \n",
"1 BCH-USD False False 1000000 10 \n",
"2 BTC-EUR False False 600000 10 \n",
"3 BTC-GBP False False 200000 10 \n",
"4 BTC-USD False False 1000000 10 \n",
"5 ETH-BTC False False 50 0.001 \n",
"6 ETH-EUR False False 400000 10 \n",
"7 ETH-USD False False 1000000 10 \n",
"8 LTC-BTC False False 30 0.001 \n",
"9 LTC-EUR False False 200000 10 \n",
"10 LTC-USD False False 1000000 10 \n",
"11 BCH-EUR False False 200000 10 \n",
"\n",
" post_only quote_currency quote_increment status status_message \n",
"0 False BTC 0.00001 online None \n",
"1 False USD 0.01 online None \n",
"2 False EUR 0.01 online None \n",
"3 False GBP 0.01 online None \n",
"4 False USD 0.01 online None \n",
"5 False BTC 0.00001 online None \n",
"6 False EUR 0.01 online None \n",
"7 False USD 0.01 online None \n",
"8 False BTC 0.00001 online None \n",
"9 False EUR 0.01 online None \n",
"10 False USD 0.01 online None \n",
"11 False EUR 0.01 online None "
]
},
"execution_count": 78,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pandas as pd\n",
"pd.DataFrame(public_client.get_products())"
]
},
{
"cell_type": "code",
"execution_count": 134,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T18:55:38.370161Z",
"start_time": "2018-04-23T18:55:37.401024Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" time | \n",
" low | \n",
" high | \n",
" open | \n",
" close | \n",
" volume | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 1524509700 | \n",
" 8907.00 | \n",
" 8907.00 | \n",
" 8907.00 | \n",
" 8907.00 | \n",
" 0.286700 | \n",
"
\n",
" \n",
" 1 | \n",
" 1524509640 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 0.509510 | \n",
"
\n",
" \n",
" 2 | \n",
" 1524509580 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8907.00 | \n",
" 8907.00 | \n",
" 0.192700 | \n",
"
\n",
" \n",
" 3 | \n",
" 1524509520 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8906.99 | \n",
" 8906.99 | \n",
" 1.943114 | \n",
"
\n",
" \n",
" 4 | \n",
" 1524509460 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 3.656145 | \n",
"
\n",
" \n",
" 5 | \n",
" 1524509400 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 2.251107 | \n",
"
\n",
" \n",
" 6 | \n",
" 1524509340 | \n",
" 8905.99 | \n",
" 8907.00 | \n",
" 8905.99 | \n",
" 8906.99 | \n",
" 6.483964 | \n",
"
\n",
" \n",
" 7 | \n",
" 1524509280 | \n",
" 8904.99 | \n",
" 8905.00 | \n",
" 8904.99 | \n",
" 8905.00 | \n",
" 6.437750 | \n",
"
\n",
" \n",
" 8 | \n",
" 1524509220 | \n",
" 8904.00 | \n",
" 8905.00 | \n",
" 8904.00 | \n",
" 8904.99 | \n",
" 12.768002 | \n",
"
\n",
" \n",
" 9 | \n",
" 1524509160 | \n",
" 8901.00 | \n",
" 8904.00 | \n",
" 8901.00 | \n",
" 8904.00 | \n",
" 4.724637 | \n",
"
\n",
" \n",
" 10 | \n",
" 1524509100 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 4.016008 | \n",
"
\n",
" \n",
" 11 | \n",
" 1524509040 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.01 | \n",
" 8901.01 | \n",
" 1.759232 | \n",
"
\n",
" \n",
" 12 | \n",
" 1524508980 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 8901.00 | \n",
" 1.378653 | \n",
"
\n",
" \n",
" 13 | \n",
" 1524508920 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 8901.00 | \n",
" 1.026541 | \n",
"
\n",
" \n",
" 14 | \n",
" 1524508860 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 5.311800 | \n",
"
\n",
" \n",
" 15 | \n",
" 1524508800 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 1.550333 | \n",
"
\n",
" \n",
" 16 | \n",
" 1524508740 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 8901.00 | \n",
" 2.352722 | \n",
"
\n",
" \n",
" 17 | \n",
" 1524508680 | \n",
" 8901.00 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 8901.00 | \n",
" 77.299596 | \n",
"
\n",
" \n",
" 18 | \n",
" 1524508620 | \n",
" 8908.99 | \n",
" 8909.00 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 4.704938 | \n",
"
\n",
" \n",
" 19 | \n",
" 1524508560 | \n",
" 8908.99 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 8908.99 | \n",
" 3.016413 | \n",
"
\n",
" \n",
" 20 | \n",
" 1524508500 | \n",
" 8908.99 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 8909.00 | \n",
" 0.406579 | \n",
"
\n",
" \n",
" 21 | \n",
" 1524508440 | \n",
" 8908.99 | \n",
" 8909.00 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 3.709299 | \n",
"
\n",
" \n",
" 22 | \n",
" 1524508380 | \n",
" 8908.99 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 8908.99 | \n",
" 2.497345 | \n",
"
\n",
" \n",
" 23 | \n",
" 1524508320 | \n",
" 8906.47 | \n",
" 8909.00 | \n",
" 8906.47 | \n",
" 8908.99 | \n",
" 3.575502 | \n",
"
\n",
" \n",
" 24 | \n",
" 1524508260 | \n",
" 8899.98 | \n",
" 8906.45 | \n",
" 8899.99 | \n",
" 8906.45 | \n",
" 15.627276 | \n",
"
\n",
" \n",
" 25 | \n",
" 1524508200 | \n",
" 8899.98 | \n",
" 8899.99 | \n",
" 8899.98 | \n",
" 8899.99 | \n",
" 14.527836 | \n",
"
\n",
" \n",
" 26 | \n",
" 1524508140 | \n",
" 8899.98 | \n",
" 8899.99 | \n",
" 8899.98 | \n",
" 8899.99 | \n",
" 7.258738 | \n",
"
\n",
" \n",
" 27 | \n",
" 1524508080 | \n",
" 8899.98 | \n",
" 8899.99 | \n",
" 8899.98 | \n",
" 8899.98 | \n",
" 2.922756 | \n",
"
\n",
" \n",
" 28 | \n",
" 1524508020 | \n",
" 8888.99 | \n",
" 8899.99 | \n",
" 8889.00 | \n",
" 8899.98 | \n",
" 35.912812 | \n",
"
\n",
" \n",
" 29 | \n",
" 1524507960 | \n",
" 8888.99 | \n",
" 8889.00 | \n",
" 8889.00 | \n",
" 8888.99 | \n",
" 2.412108 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 270 | \n",
" 1524493500 | \n",
" 8905.00 | \n",
" 8905.01 | \n",
" 8905.00 | \n",
" 8905.01 | \n",
" 4.561419 | \n",
"
\n",
" \n",
" 271 | \n",
" 1524493440 | \n",
" 8905.00 | \n",
" 8908.15 | \n",
" 8905.71 | \n",
" 8905.00 | \n",
" 5.256459 | \n",
"
\n",
" \n",
" 272 | \n",
" 1524493380 | \n",
" 8905.00 | \n",
" 8905.66 | \n",
" 8905.01 | \n",
" 8905.66 | \n",
" 1.816654 | \n",
"
\n",
" \n",
" 273 | \n",
" 1524493320 | \n",
" 8905.00 | \n",
" 8911.69 | \n",
" 8911.69 | \n",
" 8905.00 | \n",
" 11.729551 | \n",
"
\n",
" \n",
" 274 | \n",
" 1524493260 | \n",
" 8895.46 | \n",
" 8911.70 | \n",
" 8895.47 | \n",
" 8911.69 | \n",
" 18.928392 | \n",
"
\n",
" \n",
" 275 | \n",
" 1524493200 | \n",
" 8895.46 | \n",
" 8895.47 | \n",
" 8895.47 | \n",
" 8895.46 | \n",
" 2.191248 | \n",
"
\n",
" \n",
" 276 | \n",
" 1524493140 | \n",
" 8895.46 | \n",
" 8895.47 | \n",
" 8895.46 | \n",
" 8895.46 | \n",
" 1.846582 | \n",
"
\n",
" \n",
" 277 | \n",
" 1524493080 | \n",
" 8895.46 | \n",
" 8895.47 | \n",
" 8895.46 | \n",
" 8895.47 | \n",
" 15.159551 | \n",
"
\n",
" \n",
" 278 | \n",
" 1524493020 | \n",
" 8895.00 | \n",
" 8903.00 | \n",
" 8903.00 | \n",
" 8895.34 | \n",
" 19.115037 | \n",
"
\n",
" \n",
" 279 | \n",
" 1524492960 | \n",
" 8903.15 | \n",
" 8915.00 | \n",
" 8909.00 | \n",
" 8903.15 | \n",
" 4.357070 | \n",
"
\n",
" \n",
" 280 | \n",
" 1524492900 | \n",
" 8900.00 | \n",
" 8908.00 | \n",
" 8904.02 | \n",
" 8908.00 | \n",
" 29.639656 | \n",
"
\n",
" \n",
" 281 | \n",
" 1524492840 | \n",
" 8904.11 | \n",
" 8921.00 | \n",
" 8920.99 | \n",
" 8904.11 | \n",
" 42.594683 | \n",
"
\n",
" \n",
" 282 | \n",
" 1524492780 | \n",
" 8920.99 | \n",
" 8921.00 | \n",
" 8920.99 | \n",
" 8920.99 | \n",
" 1.679960 | \n",
"
\n",
" \n",
" 283 | \n",
" 1524492720 | \n",
" 8920.99 | \n",
" 8921.00 | \n",
" 8920.99 | \n",
" 8920.99 | \n",
" 3.590269 | \n",
"
\n",
" \n",
" 284 | \n",
" 1524492660 | \n",
" 8920.99 | \n",
" 8925.99 | \n",
" 8925.99 | \n",
" 8921.00 | \n",
" 11.038059 | \n",
"
\n",
" \n",
" 285 | \n",
" 1524492600 | \n",
" 8925.99 | \n",
" 8930.01 | \n",
" 8930.01 | \n",
" 8926.00 | \n",
" 3.653250 | \n",
"
\n",
" \n",
" 286 | \n",
" 1524492540 | \n",
" 8930.00 | \n",
" 8930.09 | \n",
" 8930.09 | \n",
" 8930.01 | \n",
" 1.590277 | \n",
"
\n",
" \n",
" 287 | \n",
" 1524492480 | \n",
" 8930.09 | \n",
" 8930.10 | \n",
" 8930.09 | \n",
" 8930.09 | \n",
" 1.763368 | \n",
"
\n",
" \n",
" 288 | \n",
" 1524492420 | \n",
" 8930.16 | \n",
" 8931.40 | \n",
" 8931.39 | \n",
" 8930.16 | \n",
" 4.535851 | \n",
"
\n",
" \n",
" 289 | \n",
" 1524492360 | \n",
" 8925.99 | \n",
" 8931.40 | \n",
" 8926.00 | \n",
" 8931.40 | \n",
" 8.161563 | \n",
"
\n",
" \n",
" 290 | \n",
" 1524492300 | \n",
" 8917.00 | \n",
" 8926.00 | \n",
" 8917.00 | \n",
" 8925.99 | \n",
" 2.849100 | \n",
"
\n",
" \n",
" 291 | \n",
" 1524492240 | \n",
" 8916.99 | \n",
" 8917.00 | \n",
" 8917.00 | \n",
" 8917.00 | \n",
" 5.369532 | \n",
"
\n",
" \n",
" 292 | \n",
" 1524492180 | \n",
" 8916.99 | \n",
" 8917.00 | \n",
" 8916.99 | \n",
" 8917.00 | \n",
" 10.412870 | \n",
"
\n",
" \n",
" 293 | \n",
" 1524492120 | \n",
" 8916.99 | \n",
" 8917.00 | \n",
" 8917.00 | \n",
" 8917.00 | \n",
" 7.625496 | \n",
"
\n",
" \n",
" 294 | \n",
" 1524492060 | \n",
" 8910.02 | \n",
" 8917.01 | \n",
" 8917.01 | \n",
" 8917.00 | \n",
" 7.587861 | \n",
"
\n",
" \n",
" 295 | \n",
" 1524492000 | \n",
" 8917.00 | \n",
" 8920.11 | \n",
" 8920.11 | \n",
" 8917.00 | \n",
" 15.114747 | \n",
"
\n",
" \n",
" 296 | \n",
" 1524491940 | \n",
" 8920.10 | \n",
" 8920.11 | \n",
" 8920.10 | \n",
" 8920.10 | \n",
" 1.588945 | \n",
"
\n",
" \n",
" 297 | \n",
" 1524491880 | \n",
" 8920.10 | \n",
" 8936.20 | \n",
" 8936.20 | \n",
" 8920.11 | \n",
" 6.452501 | \n",
"
\n",
" \n",
" 298 | \n",
" 1524491820 | \n",
" 8936.20 | \n",
" 8936.21 | \n",
" 8936.20 | \n",
" 8936.21 | \n",
" 4.502257 | \n",
"
\n",
" \n",
" 299 | \n",
" 1524491760 | \n",
" 8936.20 | \n",
" 8936.21 | \n",
" 8936.20 | \n",
" 8936.21 | \n",
" 4.393606 | \n",
"
\n",
" \n",
"
\n",
"
300 rows × 6 columns
\n",
"
"
],
"text/plain": [
" time low high open close volume\n",
"0 1524509700 8907.00 8907.00 8907.00 8907.00 0.286700\n",
"1 1524509640 8906.99 8907.00 8906.99 8907.00 0.509510\n",
"2 1524509580 8906.99 8907.00 8907.00 8907.00 0.192700\n",
"3 1524509520 8906.99 8907.00 8906.99 8906.99 1.943114\n",
"4 1524509460 8906.99 8907.00 8906.99 8907.00 3.656145\n",
"5 1524509400 8906.99 8907.00 8906.99 8907.00 2.251107\n",
"6 1524509340 8905.99 8907.00 8905.99 8906.99 6.483964\n",
"7 1524509280 8904.99 8905.00 8904.99 8905.00 6.437750\n",
"8 1524509220 8904.00 8905.00 8904.00 8904.99 12.768002\n",
"9 1524509160 8901.00 8904.00 8901.00 8904.00 4.724637\n",
"10 1524509100 8901.00 8901.01 8901.00 8901.01 4.016008\n",
"11 1524509040 8901.00 8901.01 8901.01 8901.01 1.759232\n",
"12 1524508980 8901.00 8901.01 8901.00 8901.00 1.378653\n",
"13 1524508920 8901.00 8901.01 8901.00 8901.00 1.026541\n",
"14 1524508860 8901.00 8901.01 8901.01 8901.00 5.311800\n",
"15 1524508800 8901.00 8901.01 8901.01 8901.00 1.550333\n",
"16 1524508740 8901.00 8901.01 8901.00 8901.00 2.352722\n",
"17 1524508680 8901.00 8909.00 8908.99 8901.00 77.299596\n",
"18 1524508620 8908.99 8909.00 8909.00 8908.99 4.704938\n",
"19 1524508560 8908.99 8909.00 8908.99 8908.99 3.016413\n",
"20 1524508500 8908.99 8909.00 8908.99 8909.00 0.406579\n",
"21 1524508440 8908.99 8909.00 8909.00 8908.99 3.709299\n",
"22 1524508380 8908.99 8909.00 8908.99 8908.99 2.497345\n",
"23 1524508320 8906.47 8909.00 8906.47 8908.99 3.575502\n",
"24 1524508260 8899.98 8906.45 8899.99 8906.45 15.627276\n",
"25 1524508200 8899.98 8899.99 8899.98 8899.99 14.527836\n",
"26 1524508140 8899.98 8899.99 8899.98 8899.99 7.258738\n",
"27 1524508080 8899.98 8899.99 8899.98 8899.98 2.922756\n",
"28 1524508020 8888.99 8899.99 8889.00 8899.98 35.912812\n",
"29 1524507960 8888.99 8889.00 8889.00 8888.99 2.412108\n",
".. ... ... ... ... ... ...\n",
"270 1524493500 8905.00 8905.01 8905.00 8905.01 4.561419\n",
"271 1524493440 8905.00 8908.15 8905.71 8905.00 5.256459\n",
"272 1524493380 8905.00 8905.66 8905.01 8905.66 1.816654\n",
"273 1524493320 8905.00 8911.69 8911.69 8905.00 11.729551\n",
"274 1524493260 8895.46 8911.70 8895.47 8911.69 18.928392\n",
"275 1524493200 8895.46 8895.47 8895.47 8895.46 2.191248\n",
"276 1524493140 8895.46 8895.47 8895.46 8895.46 1.846582\n",
"277 1524493080 8895.46 8895.47 8895.46 8895.47 15.159551\n",
"278 1524493020 8895.00 8903.00 8903.00 8895.34 19.115037\n",
"279 1524492960 8903.15 8915.00 8909.00 8903.15 4.357070\n",
"280 1524492900 8900.00 8908.00 8904.02 8908.00 29.639656\n",
"281 1524492840 8904.11 8921.00 8920.99 8904.11 42.594683\n",
"282 1524492780 8920.99 8921.00 8920.99 8920.99 1.679960\n",
"283 1524492720 8920.99 8921.00 8920.99 8920.99 3.590269\n",
"284 1524492660 8920.99 8925.99 8925.99 8921.00 11.038059\n",
"285 1524492600 8925.99 8930.01 8930.01 8926.00 3.653250\n",
"286 1524492540 8930.00 8930.09 8930.09 8930.01 1.590277\n",
"287 1524492480 8930.09 8930.10 8930.09 8930.09 1.763368\n",
"288 1524492420 8930.16 8931.40 8931.39 8930.16 4.535851\n",
"289 1524492360 8925.99 8931.40 8926.00 8931.40 8.161563\n",
"290 1524492300 8917.00 8926.00 8917.00 8925.99 2.849100\n",
"291 1524492240 8916.99 8917.00 8917.00 8917.00 5.369532\n",
"292 1524492180 8916.99 8917.00 8916.99 8917.00 10.412870\n",
"293 1524492120 8916.99 8917.00 8917.00 8917.00 7.625496\n",
"294 1524492060 8910.02 8917.01 8917.01 8917.00 7.587861\n",
"295 1524492000 8917.00 8920.11 8920.11 8917.00 15.114747\n",
"296 1524491940 8920.10 8920.11 8920.10 8920.10 1.588945\n",
"297 1524491880 8920.10 8936.20 8936.20 8920.11 6.452501\n",
"298 1524491820 8936.20 8936.21 8936.20 8936.21 4.502257\n",
"299 1524491760 8936.20 8936.21 8936.20 8936.21 4.393606\n",
"\n",
"[300 rows x 6 columns]"
]
},
"execution_count": 134,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# get historic rates for 'BTC-USD', and give it to pandas\n",
"# (remember column order; TLHOCV)\n",
"pd.DataFrame(\n",
" public_client.get_product_historic_rates('BTC-USD'), \n",
" columns=['time','low','high','open','close','volume'])"
]
},
{
"cell_type": "code",
"execution_count": 80,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:22:48.988944Z",
"start_time": "2018-04-23T17:22:48.385138Z"
},
"nbpresent": {
"id": "16d60f0f-e11c-444a-9478-8998d435cc2f"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" time | \n",
" low | \n",
" high | \n",
" open | \n",
" close | \n",
" volume | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 1524504120 | \n",
" 8893.47 | \n",
" 8893.48 | \n",
" 8893.48 | \n",
" 8893.48 | \n",
" 1.544871 | \n",
"
\n",
" \n",
" 1 | \n",
" 1524504060 | \n",
" 8893.47 | \n",
" 8893.48 | \n",
" 8893.48 | \n",
" 8893.47 | \n",
" 4.297853 | \n",
"
\n",
" \n",
" 2 | \n",
" 1524504000 | \n",
" 8893.47 | \n",
" 8893.48 | \n",
" 8893.48 | \n",
" 8893.48 | \n",
" 13.887844 | \n",
"
\n",
" \n",
" 3 | \n",
" 1524503940 | \n",
" 8893.47 | \n",
" 8893.48 | \n",
" 8893.47 | \n",
" 8893.47 | \n",
" 6.147527 | \n",
"
\n",
" \n",
" 4 | \n",
" 1524503880 | \n",
" 8887.56 | \n",
" 8893.48 | \n",
" 8887.57 | \n",
" 8893.47 | \n",
" 6.008097 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" time low high open close volume\n",
"0 1524504120 8893.47 8893.48 8893.48 8893.48 1.544871\n",
"1 1524504060 8893.47 8893.48 8893.48 8893.47 4.297853\n",
"2 1524504000 8893.47 8893.48 8893.48 8893.48 13.887844\n",
"3 1524503940 8893.47 8893.48 8893.47 8893.47 6.147527\n",
"4 1524503880 8887.56 8893.48 8887.57 8893.47 6.008097"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"df = pd.DataFrame(\n",
" public_client.get_product_historic_rates(product_id='BTC-USD'),\n",
" columns=['time','low','high','open','close','volume']\n",
")\n",
"display(df.head())"
]
},
{
"cell_type": "code",
"execution_count": 137,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T18:56:56.056943Z",
"start_time": "2018-04-23T18:56:55.485264Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" time | \n",
" low | \n",
" high | \n",
" open | \n",
" close | \n",
" volume | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 2018-04-23 18:56:00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 0.637195 | \n",
"
\n",
" \n",
" 1 | \n",
" 2018-04-23 18:55:00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8907.00 | \n",
" 8906.99 | \n",
" 1.507100 | \n",
"
\n",
" \n",
" 2 | \n",
" 2018-04-23 18:54:00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 0.509510 | \n",
"
\n",
" \n",
" 3 | \n",
" 2018-04-23 18:53:00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8907.00 | \n",
" 8907.00 | \n",
" 0.192700 | \n",
"
\n",
" \n",
" 4 | \n",
" 2018-04-23 18:52:00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8906.99 | \n",
" 8906.99 | \n",
" 1.943114 | \n",
"
\n",
" \n",
" 5 | \n",
" 2018-04-23 18:51:00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 3.656145 | \n",
"
\n",
" \n",
" 6 | \n",
" 2018-04-23 18:50:00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 8906.99 | \n",
" 8907.00 | \n",
" 2.251107 | \n",
"
\n",
" \n",
" 7 | \n",
" 2018-04-23 18:49:00 | \n",
" 8905.99 | \n",
" 8907.00 | \n",
" 8905.99 | \n",
" 8906.99 | \n",
" 6.483964 | \n",
"
\n",
" \n",
" 8 | \n",
" 2018-04-23 18:48:00 | \n",
" 8904.99 | \n",
" 8905.00 | \n",
" 8904.99 | \n",
" 8905.00 | \n",
" 6.437750 | \n",
"
\n",
" \n",
" 9 | \n",
" 2018-04-23 18:47:00 | \n",
" 8904.00 | \n",
" 8905.00 | \n",
" 8904.00 | \n",
" 8904.99 | \n",
" 12.768002 | \n",
"
\n",
" \n",
" 10 | \n",
" 2018-04-23 18:46:00 | \n",
" 8901.00 | \n",
" 8904.00 | \n",
" 8901.00 | \n",
" 8904.00 | \n",
" 4.724637 | \n",
"
\n",
" \n",
" 11 | \n",
" 2018-04-23 18:45:00 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 4.016008 | \n",
"
\n",
" \n",
" 12 | \n",
" 2018-04-23 18:44:00 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.01 | \n",
" 8901.01 | \n",
" 1.759232 | \n",
"
\n",
" \n",
" 13 | \n",
" 2018-04-23 18:43:00 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 8901.00 | \n",
" 1.378653 | \n",
"
\n",
" \n",
" 14 | \n",
" 2018-04-23 18:42:00 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 8901.00 | \n",
" 1.026541 | \n",
"
\n",
" \n",
" 15 | \n",
" 2018-04-23 18:41:00 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 5.311800 | \n",
"
\n",
" \n",
" 16 | \n",
" 2018-04-23 18:40:00 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 1.550333 | \n",
"
\n",
" \n",
" 17 | \n",
" 2018-04-23 18:39:00 | \n",
" 8901.00 | \n",
" 8901.01 | \n",
" 8901.00 | \n",
" 8901.00 | \n",
" 2.352722 | \n",
"
\n",
" \n",
" 18 | \n",
" 2018-04-23 18:38:00 | \n",
" 8901.00 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 8901.00 | \n",
" 77.299596 | \n",
"
\n",
" \n",
" 19 | \n",
" 2018-04-23 18:37:00 | \n",
" 8908.99 | \n",
" 8909.00 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 76.701947 | \n",
"
\n",
" \n",
" 20 | \n",
" 2018-04-23 18:36:00 | \n",
" 8908.99 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 8908.99 | \n",
" 3.016413 | \n",
"
\n",
" \n",
" 21 | \n",
" 2018-04-23 18:35:00 | \n",
" 8908.99 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 8908.99 | \n",
" 0.496679 | \n",
"
\n",
" \n",
" 22 | \n",
" 2018-04-23 18:34:00 | \n",
" 8908.99 | \n",
" 8909.00 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 3.709299 | \n",
"
\n",
" \n",
" 23 | \n",
" 2018-04-23 18:33:00 | \n",
" 8908.99 | \n",
" 8909.00 | \n",
" 8908.99 | \n",
" 8908.99 | \n",
" 2.497345 | \n",
"
\n",
" \n",
" 24 | \n",
" 2018-04-23 18:32:00 | \n",
" 8906.47 | \n",
" 8909.00 | \n",
" 8906.47 | \n",
" 8908.99 | \n",
" 4.148702 | \n",
"
\n",
" \n",
" 25 | \n",
" 2018-04-23 18:31:00 | \n",
" 8899.98 | \n",
" 8906.48 | \n",
" 8899.99 | \n",
" 8906.48 | \n",
" 16.156576 | \n",
"
\n",
" \n",
" 26 | \n",
" 2018-04-23 18:30:00 | \n",
" 8899.98 | \n",
" 8899.99 | \n",
" 8899.98 | \n",
" 8899.99 | \n",
" 14.527836 | \n",
"
\n",
" \n",
" 27 | \n",
" 2018-04-23 18:29:00 | \n",
" 8899.98 | \n",
" 8899.99 | \n",
" 8899.98 | \n",
" 8899.99 | \n",
" 7.258738 | \n",
"
\n",
" \n",
" 28 | \n",
" 2018-04-23 18:28:00 | \n",
" 8899.98 | \n",
" 8899.99 | \n",
" 8899.98 | \n",
" 8899.98 | \n",
" 2.922756 | \n",
"
\n",
" \n",
" 29 | \n",
" 2018-04-23 18:27:00 | \n",
" 8888.99 | \n",
" 8899.99 | \n",
" 8889.00 | \n",
" 8899.99 | \n",
" 37.816936 | \n",
"
\n",
" \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
" ... | \n",
"
\n",
" \n",
" 270 | \n",
" 2018-04-23 14:26:00 | \n",
" 8905.00 | \n",
" 8905.01 | \n",
" 8905.00 | \n",
" 8905.00 | \n",
" 8.249743 | \n",
"
\n",
" \n",
" 271 | \n",
" 2018-04-23 14:25:00 | \n",
" 8905.00 | \n",
" 8905.01 | \n",
" 8905.00 | \n",
" 8905.01 | \n",
" 4.561419 | \n",
"
\n",
" \n",
" 272 | \n",
" 2018-04-23 14:24:00 | \n",
" 8905.00 | \n",
" 8908.15 | \n",
" 8905.71 | \n",
" 8905.00 | \n",
" 5.256459 | \n",
"
\n",
" \n",
" 273 | \n",
" 2018-04-23 14:23:00 | \n",
" 8905.00 | \n",
" 8905.66 | \n",
" 8905.01 | \n",
" 8905.66 | \n",
" 1.816654 | \n",
"
\n",
" \n",
" 274 | \n",
" 2018-04-23 14:22:00 | \n",
" 8905.00 | \n",
" 8911.69 | \n",
" 8911.69 | \n",
" 8905.00 | \n",
" 11.729551 | \n",
"
\n",
" \n",
" 275 | \n",
" 2018-04-23 14:21:00 | \n",
" 8895.46 | \n",
" 8911.70 | \n",
" 8895.47 | \n",
" 8911.69 | \n",
" 18.928392 | \n",
"
\n",
" \n",
" 276 | \n",
" 2018-04-23 14:20:00 | \n",
" 8895.46 | \n",
" 8895.47 | \n",
" 8895.47 | \n",
" 8895.47 | \n",
" 2.908838 | \n",
"
\n",
" \n",
" 277 | \n",
" 2018-04-23 14:19:00 | \n",
" 8895.46 | \n",
" 8895.47 | \n",
" 8895.46 | \n",
" 8895.46 | \n",
" 1.846582 | \n",
"
\n",
" \n",
" 278 | \n",
" 2018-04-23 14:18:00 | \n",
" 8895.46 | \n",
" 8895.47 | \n",
" 8895.46 | \n",
" 8895.47 | \n",
" 15.159551 | \n",
"
\n",
" \n",
" 279 | \n",
" 2018-04-23 14:17:00 | \n",
" 8895.00 | \n",
" 8903.00 | \n",
" 8903.00 | \n",
" 8895.34 | \n",
" 19.115037 | \n",
"
\n",
" \n",
" 280 | \n",
" 2018-04-23 14:16:00 | \n",
" 8903.15 | \n",
" 8915.00 | \n",
" 8909.00 | \n",
" 8903.15 | \n",
" 4.357070 | \n",
"
\n",
" \n",
" 281 | \n",
" 2018-04-23 14:15:00 | \n",
" 8900.00 | \n",
" 8908.00 | \n",
" 8904.02 | \n",
" 8908.00 | \n",
" 29.639656 | \n",
"
\n",
" \n",
" 282 | \n",
" 2018-04-23 14:14:00 | \n",
" 8904.11 | \n",
" 8921.00 | \n",
" 8920.99 | \n",
" 8904.11 | \n",
" 42.594683 | \n",
"
\n",
" \n",
" 283 | \n",
" 2018-04-23 14:13:00 | \n",
" 8920.99 | \n",
" 8921.00 | \n",
" 8920.99 | \n",
" 8920.99 | \n",
" 1.679960 | \n",
"
\n",
" \n",
" 284 | \n",
" 2018-04-23 14:12:00 | \n",
" 8920.99 | \n",
" 8921.00 | \n",
" 8920.99 | \n",
" 8920.99 | \n",
" 3.590269 | \n",
"
\n",
" \n",
" 285 | \n",
" 2018-04-23 14:11:00 | \n",
" 8920.99 | \n",
" 8925.99 | \n",
" 8925.99 | \n",
" 8921.00 | \n",
" 11.038059 | \n",
"
\n",
" \n",
" 286 | \n",
" 2018-04-23 14:10:00 | \n",
" 8925.99 | \n",
" 8930.01 | \n",
" 8930.01 | \n",
" 8926.00 | \n",
" 3.653250 | \n",
"
\n",
" \n",
" 287 | \n",
" 2018-04-23 14:09:00 | \n",
" 8930.00 | \n",
" 8930.09 | \n",
" 8930.09 | \n",
" 8930.01 | \n",
" 1.615010 | \n",
"
\n",
" \n",
" 288 | \n",
" 2018-04-23 14:08:00 | \n",
" 8930.09 | \n",
" 8930.10 | \n",
" 8930.09 | \n",
" 8930.09 | \n",
" 1.763368 | \n",
"
\n",
" \n",
" 289 | \n",
" 2018-04-23 14:07:00 | \n",
" 8930.16 | \n",
" 8931.40 | \n",
" 8931.39 | \n",
" 8930.16 | \n",
" 4.535851 | \n",
"
\n",
" \n",
" 290 | \n",
" 2018-04-23 14:06:00 | \n",
" 8925.99 | \n",
" 8931.40 | \n",
" 8926.00 | \n",
" 8931.40 | \n",
" 8.161563 | \n",
"
\n",
" \n",
" 291 | \n",
" 2018-04-23 14:05:00 | \n",
" 8917.00 | \n",
" 8926.00 | \n",
" 8917.00 | \n",
" 8925.99 | \n",
" 2.849100 | \n",
"
\n",
" \n",
" 292 | \n",
" 2018-04-23 14:04:00 | \n",
" 8916.99 | \n",
" 8917.00 | \n",
" 8917.00 | \n",
" 8917.00 | \n",
" 5.369532 | \n",
"
\n",
" \n",
" 293 | \n",
" 2018-04-23 14:03:00 | \n",
" 8916.99 | \n",
" 8917.00 | \n",
" 8916.99 | \n",
" 8917.00 | \n",
" 10.412870 | \n",
"
\n",
" \n",
" 294 | \n",
" 2018-04-23 14:02:00 | \n",
" 8916.99 | \n",
" 8917.00 | \n",
" 8917.00 | \n",
" 8917.00 | \n",
" 7.625496 | \n",
"
\n",
" \n",
" 295 | \n",
" 2018-04-23 14:01:00 | \n",
" 8910.02 | \n",
" 8917.01 | \n",
" 8917.01 | \n",
" 8917.00 | \n",
" 7.587861 | \n",
"
\n",
" \n",
" 296 | \n",
" 2018-04-23 14:00:00 | \n",
" 8917.00 | \n",
" 8920.11 | \n",
" 8920.11 | \n",
" 8917.00 | \n",
" 15.114747 | \n",
"
\n",
" \n",
" 297 | \n",
" 2018-04-23 13:59:00 | \n",
" 8920.10 | \n",
" 8920.11 | \n",
" 8920.10 | \n",
" 8920.11 | \n",
" 1.583694 | \n",
"
\n",
" \n",
" 298 | \n",
" 2018-04-23 13:58:00 | \n",
" 8920.10 | \n",
" 8936.20 | \n",
" 8936.20 | \n",
" 8920.11 | \n",
" 6.452501 | \n",
"
\n",
" \n",
" 299 | \n",
" 2018-04-23 13:57:00 | \n",
" 8936.20 | \n",
" 8936.21 | \n",
" 8936.20 | \n",
" 8936.21 | \n",
" 4.502257 | \n",
"
\n",
" \n",
"
\n",
"
300 rows × 6 columns
\n",
"
"
],
"text/plain": [
" time low high open close volume\n",
"0 2018-04-23 18:56:00 8906.99 8907.00 8906.99 8907.00 0.637195\n",
"1 2018-04-23 18:55:00 8906.99 8907.00 8907.00 8906.99 1.507100\n",
"2 2018-04-23 18:54:00 8906.99 8907.00 8906.99 8907.00 0.509510\n",
"3 2018-04-23 18:53:00 8906.99 8907.00 8907.00 8907.00 0.192700\n",
"4 2018-04-23 18:52:00 8906.99 8907.00 8906.99 8906.99 1.943114\n",
"5 2018-04-23 18:51:00 8906.99 8907.00 8906.99 8907.00 3.656145\n",
"6 2018-04-23 18:50:00 8906.99 8907.00 8906.99 8907.00 2.251107\n",
"7 2018-04-23 18:49:00 8905.99 8907.00 8905.99 8906.99 6.483964\n",
"8 2018-04-23 18:48:00 8904.99 8905.00 8904.99 8905.00 6.437750\n",
"9 2018-04-23 18:47:00 8904.00 8905.00 8904.00 8904.99 12.768002\n",
"10 2018-04-23 18:46:00 8901.00 8904.00 8901.00 8904.00 4.724637\n",
"11 2018-04-23 18:45:00 8901.00 8901.01 8901.00 8901.01 4.016008\n",
"12 2018-04-23 18:44:00 8901.00 8901.01 8901.01 8901.01 1.759232\n",
"13 2018-04-23 18:43:00 8901.00 8901.01 8901.00 8901.00 1.378653\n",
"14 2018-04-23 18:42:00 8901.00 8901.01 8901.00 8901.00 1.026541\n",
"15 2018-04-23 18:41:00 8901.00 8901.01 8901.01 8901.00 5.311800\n",
"16 2018-04-23 18:40:00 8901.00 8901.01 8901.01 8901.00 1.550333\n",
"17 2018-04-23 18:39:00 8901.00 8901.01 8901.00 8901.00 2.352722\n",
"18 2018-04-23 18:38:00 8901.00 8909.00 8908.99 8901.00 77.299596\n",
"19 2018-04-23 18:37:00 8908.99 8909.00 8909.00 8908.99 76.701947\n",
"20 2018-04-23 18:36:00 8908.99 8909.00 8908.99 8908.99 3.016413\n",
"21 2018-04-23 18:35:00 8908.99 8909.00 8908.99 8908.99 0.496679\n",
"22 2018-04-23 18:34:00 8908.99 8909.00 8909.00 8908.99 3.709299\n",
"23 2018-04-23 18:33:00 8908.99 8909.00 8908.99 8908.99 2.497345\n",
"24 2018-04-23 18:32:00 8906.47 8909.00 8906.47 8908.99 4.148702\n",
"25 2018-04-23 18:31:00 8899.98 8906.48 8899.99 8906.48 16.156576\n",
"26 2018-04-23 18:30:00 8899.98 8899.99 8899.98 8899.99 14.527836\n",
"27 2018-04-23 18:29:00 8899.98 8899.99 8899.98 8899.99 7.258738\n",
"28 2018-04-23 18:28:00 8899.98 8899.99 8899.98 8899.98 2.922756\n",
"29 2018-04-23 18:27:00 8888.99 8899.99 8889.00 8899.99 37.816936\n",
".. ... ... ... ... ... ...\n",
"270 2018-04-23 14:26:00 8905.00 8905.01 8905.00 8905.00 8.249743\n",
"271 2018-04-23 14:25:00 8905.00 8905.01 8905.00 8905.01 4.561419\n",
"272 2018-04-23 14:24:00 8905.00 8908.15 8905.71 8905.00 5.256459\n",
"273 2018-04-23 14:23:00 8905.00 8905.66 8905.01 8905.66 1.816654\n",
"274 2018-04-23 14:22:00 8905.00 8911.69 8911.69 8905.00 11.729551\n",
"275 2018-04-23 14:21:00 8895.46 8911.70 8895.47 8911.69 18.928392\n",
"276 2018-04-23 14:20:00 8895.46 8895.47 8895.47 8895.47 2.908838\n",
"277 2018-04-23 14:19:00 8895.46 8895.47 8895.46 8895.46 1.846582\n",
"278 2018-04-23 14:18:00 8895.46 8895.47 8895.46 8895.47 15.159551\n",
"279 2018-04-23 14:17:00 8895.00 8903.00 8903.00 8895.34 19.115037\n",
"280 2018-04-23 14:16:00 8903.15 8915.00 8909.00 8903.15 4.357070\n",
"281 2018-04-23 14:15:00 8900.00 8908.00 8904.02 8908.00 29.639656\n",
"282 2018-04-23 14:14:00 8904.11 8921.00 8920.99 8904.11 42.594683\n",
"283 2018-04-23 14:13:00 8920.99 8921.00 8920.99 8920.99 1.679960\n",
"284 2018-04-23 14:12:00 8920.99 8921.00 8920.99 8920.99 3.590269\n",
"285 2018-04-23 14:11:00 8920.99 8925.99 8925.99 8921.00 11.038059\n",
"286 2018-04-23 14:10:00 8925.99 8930.01 8930.01 8926.00 3.653250\n",
"287 2018-04-23 14:09:00 8930.00 8930.09 8930.09 8930.01 1.615010\n",
"288 2018-04-23 14:08:00 8930.09 8930.10 8930.09 8930.09 1.763368\n",
"289 2018-04-23 14:07:00 8930.16 8931.40 8931.39 8930.16 4.535851\n",
"290 2018-04-23 14:06:00 8925.99 8931.40 8926.00 8931.40 8.161563\n",
"291 2018-04-23 14:05:00 8917.00 8926.00 8917.00 8925.99 2.849100\n",
"292 2018-04-23 14:04:00 8916.99 8917.00 8917.00 8917.00 5.369532\n",
"293 2018-04-23 14:03:00 8916.99 8917.00 8916.99 8917.00 10.412870\n",
"294 2018-04-23 14:02:00 8916.99 8917.00 8917.00 8917.00 7.625496\n",
"295 2018-04-23 14:01:00 8910.02 8917.01 8917.01 8917.00 7.587861\n",
"296 2018-04-23 14:00:00 8917.00 8920.11 8920.11 8917.00 15.114747\n",
"297 2018-04-23 13:59:00 8920.10 8920.11 8920.10 8920.11 1.583694\n",
"298 2018-04-23 13:58:00 8920.10 8936.20 8936.20 8920.11 6.452501\n",
"299 2018-04-23 13:57:00 8936.20 8936.21 8936.20 8936.21 4.502257\n",
"\n",
"[300 rows x 6 columns]"
]
},
"execution_count": 137,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# convert 'time' to dt \n",
"df = pd.DataFrame(\n",
" public_client.get_product_historic_rates('BTC-USD'), \n",
" columns=['time','low','high','open','close','volume'])\n",
"df['time'] = pd.to_datetime(df['time'], unit='s')\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 82,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:22:49.007328Z",
"start_time": "2018-04-23T17:22:48.998772Z"
},
"nbpresent": {
"id": "aebe08f5-ebb7-4547-a726-44c04ec249fe"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"data": {
"text/plain": [
"0 2018-04-23 17:22:00\n",
"1 2018-04-23 17:21:00\n",
"2 2018-04-23 17:20:00\n",
"3 2018-04-23 17:19:00\n",
"4 2018-04-23 17:18:00\n",
"Name: time, dtype: datetime64[ns]"
]
},
"execution_count": 82,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pd.to_datetime(df['time'], unit='s').head()"
]
},
{
"cell_type": "code",
"execution_count": 138,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T18:57:48.367498Z",
"start_time": "2018-04-23T18:57:48.361992Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [],
"source": [
"from time import sleep\n",
"\n",
"def get_loads(symbol, start=None, end=None, granularity=86400):\n",
" \"\"\" This was boring so I'm not live-coding this one\"\"\"\n",
" if end is None:\n",
" end = pd.to_datetime('now')\n",
" if start is None:\n",
" start = end-pd.Timedelta(seconds=granularity)\n",
" \n",
" while True:\n",
" response = public_client.get_product_historic_rates(\n",
" product_id=symbol,\n",
" granularity=granularity,\n",
" start=start.isoformat(),\n",
" end=end.isoformat()\n",
" )\n",
" \n",
" if not response:\n",
" raise StopIteration()\n",
" if not isinstance(response,list):\n",
" raise ValueError(response)\n",
" \n",
" for r in response:\n",
" yield r\n",
" sleep(3)\n",
" end = pd.to_datetime(r[0], unit='s')\n",
" start = end-pd.Timedelta(seconds=granularity*len(response))\n",
" print(f\"{start}-{end}\")\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 143,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T18:59:49.332043Z",
"start_time": "2018-04-23T18:59:29.127298Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2016-09-01 00:00:00-2017-06-28 00:00:00\n",
"2015-11-06 00:00:00-2016-09-01 00:00:00\n",
"2015-01-10 00:00:00-2015-11-06 00:00:00\n",
"2014-03-23 00:00:00-2015-01-13 00:00:00\n",
"2014-11-21 00:00:00-2014-12-01 00:00:00\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" time | \n",
" low | \n",
" high | \n",
" open | \n",
" close | \n",
" volume | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 2018-04-23 | \n",
" 8775.10 | \n",
" 8991.00 | \n",
" 8795.00 | \n",
" 8888.33 | \n",
" 5842.771784 | \n",
"
\n",
" \n",
" 1 | \n",
" 2018-04-22 | \n",
" 8754.01 | \n",
" 9015.00 | \n",
" 8915.42 | \n",
" 8795.01 | \n",
" 7803.469852 | \n",
"
\n",
" \n",
" 2 | \n",
" 2018-04-21 | \n",
" 8610.70 | \n",
" 9038.87 | \n",
" 8866.27 | \n",
" 8915.42 | \n",
" 12270.503231 | \n",
"
\n",
" \n",
" 3 | \n",
" 2018-04-20 | \n",
" 8216.21 | \n",
" 8932.57 | \n",
" 8274.00 | \n",
" 8866.27 | \n",
" 16412.808992 | \n",
"
\n",
" \n",
" 4 | \n",
" 2018-04-19 | \n",
" 8101.47 | \n",
" 8300.00 | \n",
" 8152.05 | \n",
" 8274.00 | \n",
" 11932.907048 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" time low high open close volume\n",
"0 2018-04-23 8775.10 8991.00 8795.00 8888.33 5842.771784\n",
"1 2018-04-22 8754.01 9015.00 8915.42 8795.01 7803.469852\n",
"2 2018-04-21 8610.70 9038.87 8866.27 8915.42 12270.503231\n",
"3 2018-04-20 8216.21 8932.57 8274.00 8866.27 16412.808992\n",
"4 2018-04-19 8101.47 8300.00 8152.05 8274.00 11932.907048"
]
},
"execution_count": 143,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# use get_loads to build a dataframe, remember TLHOCV\n",
"df= pd.DataFrame(\n",
" get_loads('BTC-USD'), \n",
" columns=['time','low','high','open','close','volume'])\n",
"df['time'] = pd.to_datetime(df['time'], unit='s')\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 85,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:08.029439Z",
"start_time": "2018-04-23T17:22:49.032062Z"
},
"nbpresent": {
"id": "70277862-c156-4fed-bdb8-60c8d36f8024"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2016-09-01 00:00:00-2017-06-28 00:00:00\n",
"2015-11-06 00:00:00-2016-09-01 00:00:00\n",
"2015-01-10 00:00:00-2015-11-06 00:00:00\n",
"2014-03-23 00:00:00-2015-01-13 00:00:00\n",
"2014-11-21 00:00:00-2014-12-01 00:00:00\n"
]
},
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" time | \n",
" low | \n",
" high | \n",
" open | \n",
" close | \n",
" volume | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 2018-04-23 | \n",
" 8775.10 | \n",
" 8991.00 | \n",
" 8795.00 | \n",
" 8915.98 | \n",
" 5337.019179 | \n",
"
\n",
" \n",
" 1 | \n",
" 2018-04-22 | \n",
" 8754.01 | \n",
" 9015.00 | \n",
" 8915.42 | \n",
" 8795.01 | \n",
" 7802.396345 | \n",
"
\n",
" \n",
" 2 | \n",
" 2018-04-21 | \n",
" 8610.70 | \n",
" 9038.87 | \n",
" 8866.27 | \n",
" 8915.42 | \n",
" 12270.611938 | \n",
"
\n",
" \n",
" 3 | \n",
" 2018-04-20 | \n",
" 8216.21 | \n",
" 8932.57 | \n",
" 8274.00 | \n",
" 8866.27 | \n",
" 16412.808992 | \n",
"
\n",
" \n",
" 4 | \n",
" 2018-04-19 | \n",
" 8101.47 | \n",
" 8300.00 | \n",
" 8152.05 | \n",
" 8274.00 | \n",
" 11936.129671 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" time low high open close volume\n",
"0 2018-04-23 8775.10 8991.00 8795.00 8915.98 5337.019179\n",
"1 2018-04-22 8754.01 9015.00 8915.42 8795.01 7802.396345\n",
"2 2018-04-21 8610.70 9038.87 8866.27 8915.42 12270.611938\n",
"3 2018-04-20 8216.21 8932.57 8274.00 8866.27 16412.808992\n",
"4 2018-04-19 8101.47 8300.00 8152.05 8274.00 11936.129671"
]
},
"execution_count": 85,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
" \n",
"df = pd.DataFrame(\n",
" get_loads('BTC-USD'),\n",
" columns=['time','low','high','open','close','volume']\n",
")\n",
"df['time'] = pd.to_datetime(df['time'], unit='s')\n",
"df.head()"
]
},
{
"cell_type": "code",
"execution_count": 86,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:08.042162Z",
"start_time": "2018-04-23T17:23:08.031555Z"
},
"nbpresent": {
"id": "4b2441c5-839a-4a66-8251-98d3657be21e"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"data": {
"text/plain": [
"first 2014-12-01 00:00:00\n",
"last 2018-04-23 00:00:00\n",
"Name: time, dtype: object"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display(df.time.describe()[['first','last']])"
]
},
{
"cell_type": "code",
"execution_count": 145,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:00:42.723044Z",
"start_time": "2018-04-23T19:00:42.651424Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"application/javascript": [
"/* Put everything inside the global mpl namespace */\n",
"window.mpl = {};\n",
"\n",
"\n",
"mpl.get_websocket_type = function() {\n",
" if (typeof(WebSocket) !== 'undefined') {\n",
" return WebSocket;\n",
" } else if (typeof(MozWebSocket) !== 'undefined') {\n",
" return MozWebSocket;\n",
" } else {\n",
" alert('Your browser does not have WebSocket support.' +\n",
" 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
" 'Firefox 4 and 5 are also supported but you ' +\n",
" 'have to enable WebSockets in about:config.');\n",
" };\n",
"}\n",
"\n",
"mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
" this.id = figure_id;\n",
"\n",
" this.ws = websocket;\n",
"\n",
" this.supports_binary = (this.ws.binaryType != undefined);\n",
"\n",
" if (!this.supports_binary) {\n",
" var warnings = document.getElementById(\"mpl-warnings\");\n",
" if (warnings) {\n",
" warnings.style.display = 'block';\n",
" warnings.textContent = (\n",
" \"This browser does not support binary websocket messages. \" +\n",
" \"Performance may be slow.\");\n",
" }\n",
" }\n",
"\n",
" this.imageObj = new Image();\n",
"\n",
" this.context = undefined;\n",
" this.message = undefined;\n",
" this.canvas = undefined;\n",
" this.rubberband_canvas = undefined;\n",
" this.rubberband_context = undefined;\n",
" this.format_dropdown = undefined;\n",
"\n",
" this.image_mode = 'full';\n",
"\n",
" this.root = $('');\n",
" this._root_extra_style(this.root)\n",
" this.root.attr('style', 'display: inline-block');\n",
"\n",
" $(parent_element).append(this.root);\n",
"\n",
" this._init_header(this);\n",
" this._init_canvas(this);\n",
" this._init_toolbar(this);\n",
"\n",
" var fig = this;\n",
"\n",
" this.waiting = false;\n",
"\n",
" this.ws.onopen = function () {\n",
" fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
" fig.send_message(\"send_image_mode\", {});\n",
" if (mpl.ratio != 1) {\n",
" fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n",
" }\n",
" fig.send_message(\"refresh\", {});\n",
" }\n",
"\n",
" this.imageObj.onload = function() {\n",
" if (fig.image_mode == 'full') {\n",
" // Full images could contain transparency (where diff images\n",
" // almost always do), so we need to clear the canvas so that\n",
" // there is no ghosting.\n",
" fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
" }\n",
" fig.context.drawImage(fig.imageObj, 0, 0);\n",
" };\n",
"\n",
" this.imageObj.onunload = function() {\n",
" fig.ws.close();\n",
" }\n",
"\n",
" this.ws.onmessage = this._make_on_message_function(this);\n",
"\n",
" this.ondownload = ondownload;\n",
"}\n",
"\n",
"mpl.figure.prototype._init_header = function() {\n",
" var titlebar = $(\n",
" '');\n",
" var titletext = $(\n",
" '');\n",
" titlebar.append(titletext)\n",
" this.root.append(titlebar);\n",
" this.header = titletext[0];\n",
"}\n",
"\n",
"\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._init_canvas = function() {\n",
" var fig = this;\n",
"\n",
" var canvas_div = $('');\n",
"\n",
" canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
"\n",
" function canvas_keyboard_event(event) {\n",
" return fig.key_event(event, event['data']);\n",
" }\n",
"\n",
" canvas_div.keydown('key_press', canvas_keyboard_event);\n",
" canvas_div.keyup('key_release', canvas_keyboard_event);\n",
" this.canvas_div = canvas_div\n",
" this._canvas_extra_style(canvas_div)\n",
" this.root.append(canvas_div);\n",
"\n",
" var canvas = $('');\n",
" canvas.addClass('mpl-canvas');\n",
" canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
"\n",
" this.canvas = canvas[0];\n",
" this.context = canvas[0].getContext(\"2d\");\n",
"\n",
" var backingStore = this.context.backingStorePixelRatio ||\n",
"\tthis.context.webkitBackingStorePixelRatio ||\n",
"\tthis.context.mozBackingStorePixelRatio ||\n",
"\tthis.context.msBackingStorePixelRatio ||\n",
"\tthis.context.oBackingStorePixelRatio ||\n",
"\tthis.context.backingStorePixelRatio || 1;\n",
"\n",
" mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
"\n",
" var rubberband = $('');\n",
" rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
"\n",
" var pass_mouse_events = true;\n",
"\n",
" canvas_div.resizable({\n",
" start: function(event, ui) {\n",
" pass_mouse_events = false;\n",
" },\n",
" resize: function(event, ui) {\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" stop: function(event, ui) {\n",
" pass_mouse_events = true;\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" });\n",
"\n",
" function mouse_event_fn(event) {\n",
" if (pass_mouse_events)\n",
" return fig.mouse_event(event, event['data']);\n",
" }\n",
"\n",
" rubberband.mousedown('button_press', mouse_event_fn);\n",
" rubberband.mouseup('button_release', mouse_event_fn);\n",
" // Throttle sequential mouse events to 1 every 20ms.\n",
" rubberband.mousemove('motion_notify', mouse_event_fn);\n",
"\n",
" rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
" rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
"\n",
" canvas_div.on(\"wheel\", function (event) {\n",
" event = event.originalEvent;\n",
" event['data'] = 'scroll'\n",
" if (event.deltaY < 0) {\n",
" event.step = 1;\n",
" } else {\n",
" event.step = -1;\n",
" }\n",
" mouse_event_fn(event);\n",
" });\n",
"\n",
" canvas_div.append(canvas);\n",
" canvas_div.append(rubberband);\n",
"\n",
" this.rubberband = rubberband;\n",
" this.rubberband_canvas = rubberband[0];\n",
" this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
" this.rubberband_context.strokeStyle = \"#000000\";\n",
"\n",
" this._resize_canvas = function(width, height) {\n",
" // Keep the size of the canvas, canvas container, and rubber band\n",
" // canvas in synch.\n",
" canvas_div.css('width', width)\n",
" canvas_div.css('height', height)\n",
"\n",
" canvas.attr('width', width * mpl.ratio);\n",
" canvas.attr('height', height * mpl.ratio);\n",
" canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n",
"\n",
" rubberband.attr('width', width);\n",
" rubberband.attr('height', height);\n",
" }\n",
"\n",
" // Set the figure to an initial 600x600px, this will subsequently be updated\n",
" // upon first draw.\n",
" this._resize_canvas(600, 600);\n",
"\n",
" // Disable right mouse context menu.\n",
" $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
" return false;\n",
" });\n",
"\n",
" function set_focus () {\n",
" canvas.focus();\n",
" canvas_div.focus();\n",
" }\n",
"\n",
" window.setTimeout(set_focus, 100);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" // put a spacer in here.\n",
" continue;\n",
" }\n",
" var button = $('');\n",
" button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
" 'ui-button-icon-only');\n",
" button.attr('role', 'button');\n",
" button.attr('aria-disabled', 'false');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
"\n",
" var icon_img = $('');\n",
" icon_img.addClass('ui-button-icon-primary ui-icon');\n",
" icon_img.addClass(image);\n",
" icon_img.addClass('ui-corner-all');\n",
"\n",
" var tooltip_span = $('');\n",
" tooltip_span.addClass('ui-button-text');\n",
" tooltip_span.html(tooltip);\n",
"\n",
" button.append(icon_img);\n",
" button.append(tooltip_span);\n",
"\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" var fmt_picker_span = $('');\n",
"\n",
" var fmt_picker = $('');\n",
" fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
" fmt_picker_span.append(fmt_picker);\n",
" nav_element.append(fmt_picker_span);\n",
" this.format_dropdown = fmt_picker[0];\n",
"\n",
" for (var ind in mpl.extensions) {\n",
" var fmt = mpl.extensions[ind];\n",
" var option = $(\n",
" '', {selected: fmt === mpl.default_extension}).html(fmt);\n",
" fmt_picker.append(option)\n",
" }\n",
"\n",
" // Add hover states to the ui-buttons\n",
" $( \".ui-button\" ).hover(\n",
" function() { $(this).addClass(\"ui-state-hover\");},\n",
" function() { $(this).removeClass(\"ui-state-hover\");}\n",
" );\n",
"\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"}\n",
"\n",
"mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
" // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
" // which will in turn request a refresh of the image.\n",
" this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
"}\n",
"\n",
"mpl.figure.prototype.send_message = function(type, properties) {\n",
" properties['type'] = type;\n",
" properties['figure_id'] = this.id;\n",
" this.ws.send(JSON.stringify(properties));\n",
"}\n",
"\n",
"mpl.figure.prototype.send_draw_message = function() {\n",
" if (!this.waiting) {\n",
" this.waiting = true;\n",
" this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
" }\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" var format_dropdown = fig.format_dropdown;\n",
" var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
" fig.ondownload(fig, format);\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
" var size = msg['size'];\n",
" if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
" fig._resize_canvas(size[0], size[1]);\n",
" fig.send_message(\"refresh\", {});\n",
" };\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
" var x0 = msg['x0'] / mpl.ratio;\n",
" var y0 = (fig.canvas.height - msg['y0']) / mpl.ratio;\n",
" var x1 = msg['x1'] / mpl.ratio;\n",
" var y1 = (fig.canvas.height - msg['y1']) / mpl.ratio;\n",
" x0 = Math.floor(x0) + 0.5;\n",
" y0 = Math.floor(y0) + 0.5;\n",
" x1 = Math.floor(x1) + 0.5;\n",
" y1 = Math.floor(y1) + 0.5;\n",
" var min_x = Math.min(x0, x1);\n",
" var min_y = Math.min(y0, y1);\n",
" var width = Math.abs(x1 - x0);\n",
" var height = Math.abs(y1 - y0);\n",
"\n",
" fig.rubberband_context.clearRect(\n",
" 0, 0, fig.canvas.width, fig.canvas.height);\n",
"\n",
" fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
" // Updates the figure title.\n",
" fig.header.textContent = msg['label'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
" var cursor = msg['cursor'];\n",
" switch(cursor)\n",
" {\n",
" case 0:\n",
" cursor = 'pointer';\n",
" break;\n",
" case 1:\n",
" cursor = 'default';\n",
" break;\n",
" case 2:\n",
" cursor = 'crosshair';\n",
" break;\n",
" case 3:\n",
" cursor = 'move';\n",
" break;\n",
" }\n",
" fig.rubberband_canvas.style.cursor = cursor;\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_message = function(fig, msg) {\n",
" fig.message.textContent = msg['message'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
" // Request the server to send over a new figure.\n",
" fig.send_draw_message();\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
" fig.image_mode = msg['mode'];\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Called whenever the canvas gets updated.\n",
" this.send_message(\"ack\", {});\n",
"}\n",
"\n",
"// A function to construct a web socket function for onmessage handling.\n",
"// Called in the figure constructor.\n",
"mpl.figure.prototype._make_on_message_function = function(fig) {\n",
" return function socket_on_message(evt) {\n",
" if (evt.data instanceof Blob) {\n",
" /* FIXME: We get \"Resource interpreted as Image but\n",
" * transferred with MIME type text/plain:\" errors on\n",
" * Chrome. But how to set the MIME type? It doesn't seem\n",
" * to be part of the websocket stream */\n",
" evt.data.type = \"image/png\";\n",
"\n",
" /* Free the memory for the previous frames */\n",
" if (fig.imageObj.src) {\n",
" (window.URL || window.webkitURL).revokeObjectURL(\n",
" fig.imageObj.src);\n",
" }\n",
"\n",
" fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
" evt.data);\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
" else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
" fig.imageObj.src = evt.data;\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
"\n",
" var msg = JSON.parse(evt.data);\n",
" var msg_type = msg['type'];\n",
"\n",
" // Call the \"handle_{type}\" callback, which takes\n",
" // the figure and JSON message as its only arguments.\n",
" try {\n",
" var callback = fig[\"handle_\" + msg_type];\n",
" } catch (e) {\n",
" console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
" return;\n",
" }\n",
"\n",
" if (callback) {\n",
" try {\n",
" // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
" callback(fig, msg);\n",
" } catch (e) {\n",
" console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
" }\n",
" }\n",
" };\n",
"}\n",
"\n",
"// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
"mpl.findpos = function(e) {\n",
" //this section is from http://www.quirksmode.org/js/events_properties.html\n",
" var targ;\n",
" if (!e)\n",
" e = window.event;\n",
" if (e.target)\n",
" targ = e.target;\n",
" else if (e.srcElement)\n",
" targ = e.srcElement;\n",
" if (targ.nodeType == 3) // defeat Safari bug\n",
" targ = targ.parentNode;\n",
"\n",
" // jQuery normalizes the pageX and pageY\n",
" // pageX,Y are the mouse positions relative to the document\n",
" // offset() returns the position of the element relative to the document\n",
" var x = e.pageX - $(targ).offset().left;\n",
" var y = e.pageY - $(targ).offset().top;\n",
"\n",
" return {\"x\": x, \"y\": y};\n",
"};\n",
"\n",
"/*\n",
" * return a copy of an object with only non-object keys\n",
" * we need this to avoid circular references\n",
" * http://stackoverflow.com/a/24161582/3208463\n",
" */\n",
"function simpleKeys (original) {\n",
" return Object.keys(original).reduce(function (obj, key) {\n",
" if (typeof original[key] !== 'object')\n",
" obj[key] = original[key]\n",
" return obj;\n",
" }, {});\n",
"}\n",
"\n",
"mpl.figure.prototype.mouse_event = function(event, name) {\n",
" var canvas_pos = mpl.findpos(event)\n",
"\n",
" if (name === 'button_press')\n",
" {\n",
" this.canvas.focus();\n",
" this.canvas_div.focus();\n",
" }\n",
"\n",
" var x = canvas_pos.x * mpl.ratio;\n",
" var y = canvas_pos.y * mpl.ratio;\n",
"\n",
" this.send_message(name, {x: x, y: y, button: event.button,\n",
" step: event.step,\n",
" guiEvent: simpleKeys(event)});\n",
"\n",
" /* This prevents the web browser from automatically changing to\n",
" * the text insertion cursor when the button is pressed. We want\n",
" * to control all of the cursor setting manually through the\n",
" * 'cursor' event from matplotlib */\n",
" event.preventDefault();\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" // Handle any extra behaviour associated with a key event\n",
"}\n",
"\n",
"mpl.figure.prototype.key_event = function(event, name) {\n",
"\n",
" // Prevent repeat events\n",
" if (name == 'key_press')\n",
" {\n",
" if (event.which === this._key)\n",
" return;\n",
" else\n",
" this._key = event.which;\n",
" }\n",
" if (name == 'key_release')\n",
" this._key = null;\n",
"\n",
" var value = '';\n",
" if (event.ctrlKey && event.which != 17)\n",
" value += \"ctrl+\";\n",
" if (event.altKey && event.which != 18)\n",
" value += \"alt+\";\n",
" if (event.shiftKey && event.which != 16)\n",
" value += \"shift+\";\n",
"\n",
" value += 'k';\n",
" value += event.which.toString();\n",
"\n",
" this._key_event_extra(event, name);\n",
"\n",
" this.send_message(name, {key: value,\n",
" guiEvent: simpleKeys(event)});\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
" if (name == 'download') {\n",
" this.handle_save(this, null);\n",
" } else {\n",
" this.send_message(\"toolbar_button\", {name: name});\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
" this.message.textContent = tooltip;\n",
"};\n",
"mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
"\n",
"mpl.extensions = [\"eps\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\"];\n",
"\n",
"mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
" // Create a \"websocket\"-like object which calls the given IPython comm\n",
" // object with the appropriate methods. Currently this is a non binary\n",
" // socket, so there is still some room for performance tuning.\n",
" var ws = {};\n",
"\n",
" ws.close = function() {\n",
" comm.close()\n",
" };\n",
" ws.send = function(m) {\n",
" //console.log('sending', m);\n",
" comm.send(m);\n",
" };\n",
" // Register the callback with on_msg.\n",
" comm.on_msg(function(msg) {\n",
" //console.log('receiving', msg['content']['data'], msg);\n",
" // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
" ws.onmessage(msg['content']['data'])\n",
" });\n",
" return ws;\n",
"}\n",
"\n",
"mpl.mpl_figure_comm = function(comm, msg) {\n",
" // This is the function which gets called when the mpl process\n",
" // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
"\n",
" var id = msg.content.data.id;\n",
" // Get hold of the div created by the display call when the Comm\n",
" // socket was opened in Python.\n",
" var element = $(\"#\" + id);\n",
" var ws_proxy = comm_websocket_adapter(comm)\n",
"\n",
" function ondownload(figure, format) {\n",
" window.open(figure.imageObj.src);\n",
" }\n",
"\n",
" var fig = new mpl.figure(id, ws_proxy,\n",
" ondownload,\n",
" element.get(0));\n",
"\n",
" // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
" // web socket which is closed, not our websocket->open comm proxy.\n",
" ws_proxy.onopen();\n",
"\n",
" fig.parent_element = element.get(0);\n",
" fig.cell_info = mpl.find_output_cell(\"\");\n",
" if (!fig.cell_info) {\n",
" console.error(\"Failed to find cell for figure\", id, fig);\n",
" return;\n",
" }\n",
"\n",
" var output_index = fig.cell_info[2]\n",
" var cell = fig.cell_info[0];\n",
"\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_close = function(fig, msg) {\n",
" var width = fig.canvas.width/mpl.ratio\n",
" fig.root.unbind('remove')\n",
"\n",
" // Update the output cell to use the data from the current canvas.\n",
" fig.push_to_output();\n",
" var dataURL = fig.canvas.toDataURL();\n",
" // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
" // the notebook keyboard shortcuts fail.\n",
" IPython.keyboard_manager.enable()\n",
" $(fig.parent_element).html('');\n",
" fig.close_ws(fig, msg);\n",
"}\n",
"\n",
"mpl.figure.prototype.close_ws = function(fig, msg){\n",
" fig.send_message('closing', msg);\n",
" // fig.ws.close()\n",
"}\n",
"\n",
"mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
" // Turn the data on the canvas into data in the output cell.\n",
" var width = this.canvas.width/mpl.ratio\n",
" var dataURL = this.canvas.toDataURL();\n",
" this.cell_info[1]['text/html'] = '';\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Tell IPython that the notebook contents must change.\n",
" IPython.notebook.set_dirty(true);\n",
" this.send_message(\"ack\", {});\n",
" var fig = this;\n",
" // Wait a second, then push the new image to the DOM so\n",
" // that it is saved nicely (might be nice to debounce this).\n",
" setTimeout(function () { fig.push_to_output() }, 1000);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items){\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) { continue; };\n",
"\n",
" var button = $('');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" // Add the status bar.\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"\n",
" // Add the close button to the window.\n",
" var buttongrp = $('');\n",
" var button = $('');\n",
" button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
" button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
" buttongrp.append(button);\n",
" var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
" titlebar.prepend(buttongrp);\n",
"}\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(el){\n",
" var fig = this\n",
" el.on(\"remove\", function(){\n",
"\tfig.close_ws(fig, {});\n",
" });\n",
"}\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(el){\n",
" // this is important to make the div 'focusable\n",
" el.attr('tabindex', 0)\n",
" // reach out to IPython and tell the keyboard manager to turn it's self\n",
" // off when our div gets focus\n",
"\n",
" // location in version 3\n",
" if (IPython.notebook.keyboard_manager) {\n",
" IPython.notebook.keyboard_manager.register_events(el);\n",
" }\n",
" else {\n",
" // location in version 2\n",
" IPython.keyboard_manager.register_events(el);\n",
" }\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" var manager = IPython.notebook.keyboard_manager;\n",
" if (!manager)\n",
" manager = IPython.keyboard_manager;\n",
"\n",
" // Check for shift+enter\n",
" if (event.shiftKey && event.which == 13) {\n",
" this.canvas_div.blur();\n",
" event.shiftKey = false;\n",
" // Send a \"J\" for go to next cell\n",
" event.which = 74;\n",
" event.keyCode = 74;\n",
" manager.command_mode();\n",
" manager.handle_keydown(event);\n",
" }\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" fig.ondownload(fig, null);\n",
"}\n",
"\n",
"\n",
"mpl.find_output_cell = function(html_output) {\n",
" // Return the cell and output element which can be found *uniquely* in the notebook.\n",
" // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
" // IPython event is triggered only after the cells have been serialised, which for\n",
" // our purposes (turning an active figure into a static one), is too late.\n",
" var cells = IPython.notebook.get_cells();\n",
" var ncells = cells.length;\n",
" for (var i=0; i= 3 moved mimebundle to data attribute of output\n",
" data = data.data;\n",
" }\n",
" if (data['text/html'] == html_output) {\n",
" return [cell, data, j];\n",
" }\n",
" }\n",
" }\n",
" }\n",
"}\n",
"\n",
"// Register the function which deals with the matplotlib target/channel.\n",
"// The kernel may be null if the page has been refreshed.\n",
"if (IPython.notebook.kernel != null) {\n",
" IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
"}\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
""
]
},
"execution_count": 145,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Plot dataframe using matplotlib\n",
"df.set_index('time').plot(secondary_y='volume')"
]
},
{
"cell_type": "code",
"execution_count": 88,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:08.147766Z",
"start_time": "2018-04-23T17:23:08.055746Z"
},
"nbpresent": {
"id": "000ce75c-f0cb-439b-ab0a-d6df8a865b4f"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"data": {
"application/javascript": [
"/* Put everything inside the global mpl namespace */\n",
"window.mpl = {};\n",
"\n",
"\n",
"mpl.get_websocket_type = function() {\n",
" if (typeof(WebSocket) !== 'undefined') {\n",
" return WebSocket;\n",
" } else if (typeof(MozWebSocket) !== 'undefined') {\n",
" return MozWebSocket;\n",
" } else {\n",
" alert('Your browser does not have WebSocket support.' +\n",
" 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
" 'Firefox 4 and 5 are also supported but you ' +\n",
" 'have to enable WebSockets in about:config.');\n",
" };\n",
"}\n",
"\n",
"mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
" this.id = figure_id;\n",
"\n",
" this.ws = websocket;\n",
"\n",
" this.supports_binary = (this.ws.binaryType != undefined);\n",
"\n",
" if (!this.supports_binary) {\n",
" var warnings = document.getElementById(\"mpl-warnings\");\n",
" if (warnings) {\n",
" warnings.style.display = 'block';\n",
" warnings.textContent = (\n",
" \"This browser does not support binary websocket messages. \" +\n",
" \"Performance may be slow.\");\n",
" }\n",
" }\n",
"\n",
" this.imageObj = new Image();\n",
"\n",
" this.context = undefined;\n",
" this.message = undefined;\n",
" this.canvas = undefined;\n",
" this.rubberband_canvas = undefined;\n",
" this.rubberband_context = undefined;\n",
" this.format_dropdown = undefined;\n",
"\n",
" this.image_mode = 'full';\n",
"\n",
" this.root = $('');\n",
" this._root_extra_style(this.root)\n",
" this.root.attr('style', 'display: inline-block');\n",
"\n",
" $(parent_element).append(this.root);\n",
"\n",
" this._init_header(this);\n",
" this._init_canvas(this);\n",
" this._init_toolbar(this);\n",
"\n",
" var fig = this;\n",
"\n",
" this.waiting = false;\n",
"\n",
" this.ws.onopen = function () {\n",
" fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
" fig.send_message(\"send_image_mode\", {});\n",
" if (mpl.ratio != 1) {\n",
" fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n",
" }\n",
" fig.send_message(\"refresh\", {});\n",
" }\n",
"\n",
" this.imageObj.onload = function() {\n",
" if (fig.image_mode == 'full') {\n",
" // Full images could contain transparency (where diff images\n",
" // almost always do), so we need to clear the canvas so that\n",
" // there is no ghosting.\n",
" fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
" }\n",
" fig.context.drawImage(fig.imageObj, 0, 0);\n",
" };\n",
"\n",
" this.imageObj.onunload = function() {\n",
" fig.ws.close();\n",
" }\n",
"\n",
" this.ws.onmessage = this._make_on_message_function(this);\n",
"\n",
" this.ondownload = ondownload;\n",
"}\n",
"\n",
"mpl.figure.prototype._init_header = function() {\n",
" var titlebar = $(\n",
" '');\n",
" var titletext = $(\n",
" '');\n",
" titlebar.append(titletext)\n",
" this.root.append(titlebar);\n",
" this.header = titletext[0];\n",
"}\n",
"\n",
"\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._init_canvas = function() {\n",
" var fig = this;\n",
"\n",
" var canvas_div = $('');\n",
"\n",
" canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
"\n",
" function canvas_keyboard_event(event) {\n",
" return fig.key_event(event, event['data']);\n",
" }\n",
"\n",
" canvas_div.keydown('key_press', canvas_keyboard_event);\n",
" canvas_div.keyup('key_release', canvas_keyboard_event);\n",
" this.canvas_div = canvas_div\n",
" this._canvas_extra_style(canvas_div)\n",
" this.root.append(canvas_div);\n",
"\n",
" var canvas = $('');\n",
" canvas.addClass('mpl-canvas');\n",
" canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
"\n",
" this.canvas = canvas[0];\n",
" this.context = canvas[0].getContext(\"2d\");\n",
"\n",
" var backingStore = this.context.backingStorePixelRatio ||\n",
"\tthis.context.webkitBackingStorePixelRatio ||\n",
"\tthis.context.mozBackingStorePixelRatio ||\n",
"\tthis.context.msBackingStorePixelRatio ||\n",
"\tthis.context.oBackingStorePixelRatio ||\n",
"\tthis.context.backingStorePixelRatio || 1;\n",
"\n",
" mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
"\n",
" var rubberband = $('');\n",
" rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
"\n",
" var pass_mouse_events = true;\n",
"\n",
" canvas_div.resizable({\n",
" start: function(event, ui) {\n",
" pass_mouse_events = false;\n",
" },\n",
" resize: function(event, ui) {\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" stop: function(event, ui) {\n",
" pass_mouse_events = true;\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" });\n",
"\n",
" function mouse_event_fn(event) {\n",
" if (pass_mouse_events)\n",
" return fig.mouse_event(event, event['data']);\n",
" }\n",
"\n",
" rubberband.mousedown('button_press', mouse_event_fn);\n",
" rubberband.mouseup('button_release', mouse_event_fn);\n",
" // Throttle sequential mouse events to 1 every 20ms.\n",
" rubberband.mousemove('motion_notify', mouse_event_fn);\n",
"\n",
" rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
" rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
"\n",
" canvas_div.on(\"wheel\", function (event) {\n",
" event = event.originalEvent;\n",
" event['data'] = 'scroll'\n",
" if (event.deltaY < 0) {\n",
" event.step = 1;\n",
" } else {\n",
" event.step = -1;\n",
" }\n",
" mouse_event_fn(event);\n",
" });\n",
"\n",
" canvas_div.append(canvas);\n",
" canvas_div.append(rubberband);\n",
"\n",
" this.rubberband = rubberband;\n",
" this.rubberband_canvas = rubberband[0];\n",
" this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
" this.rubberband_context.strokeStyle = \"#000000\";\n",
"\n",
" this._resize_canvas = function(width, height) {\n",
" // Keep the size of the canvas, canvas container, and rubber band\n",
" // canvas in synch.\n",
" canvas_div.css('width', width)\n",
" canvas_div.css('height', height)\n",
"\n",
" canvas.attr('width', width * mpl.ratio);\n",
" canvas.attr('height', height * mpl.ratio);\n",
" canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n",
"\n",
" rubberband.attr('width', width);\n",
" rubberband.attr('height', height);\n",
" }\n",
"\n",
" // Set the figure to an initial 600x600px, this will subsequently be updated\n",
" // upon first draw.\n",
" this._resize_canvas(600, 600);\n",
"\n",
" // Disable right mouse context menu.\n",
" $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
" return false;\n",
" });\n",
"\n",
" function set_focus () {\n",
" canvas.focus();\n",
" canvas_div.focus();\n",
" }\n",
"\n",
" window.setTimeout(set_focus, 100);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" // put a spacer in here.\n",
" continue;\n",
" }\n",
" var button = $('');\n",
" button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
" 'ui-button-icon-only');\n",
" button.attr('role', 'button');\n",
" button.attr('aria-disabled', 'false');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
"\n",
" var icon_img = $('');\n",
" icon_img.addClass('ui-button-icon-primary ui-icon');\n",
" icon_img.addClass(image);\n",
" icon_img.addClass('ui-corner-all');\n",
"\n",
" var tooltip_span = $('');\n",
" tooltip_span.addClass('ui-button-text');\n",
" tooltip_span.html(tooltip);\n",
"\n",
" button.append(icon_img);\n",
" button.append(tooltip_span);\n",
"\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" var fmt_picker_span = $('');\n",
"\n",
" var fmt_picker = $('');\n",
" fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
" fmt_picker_span.append(fmt_picker);\n",
" nav_element.append(fmt_picker_span);\n",
" this.format_dropdown = fmt_picker[0];\n",
"\n",
" for (var ind in mpl.extensions) {\n",
" var fmt = mpl.extensions[ind];\n",
" var option = $(\n",
" '', {selected: fmt === mpl.default_extension}).html(fmt);\n",
" fmt_picker.append(option)\n",
" }\n",
"\n",
" // Add hover states to the ui-buttons\n",
" $( \".ui-button\" ).hover(\n",
" function() { $(this).addClass(\"ui-state-hover\");},\n",
" function() { $(this).removeClass(\"ui-state-hover\");}\n",
" );\n",
"\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"}\n",
"\n",
"mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
" // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
" // which will in turn request a refresh of the image.\n",
" this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
"}\n",
"\n",
"mpl.figure.prototype.send_message = function(type, properties) {\n",
" properties['type'] = type;\n",
" properties['figure_id'] = this.id;\n",
" this.ws.send(JSON.stringify(properties));\n",
"}\n",
"\n",
"mpl.figure.prototype.send_draw_message = function() {\n",
" if (!this.waiting) {\n",
" this.waiting = true;\n",
" this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
" }\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" var format_dropdown = fig.format_dropdown;\n",
" var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
" fig.ondownload(fig, format);\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
" var size = msg['size'];\n",
" if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
" fig._resize_canvas(size[0], size[1]);\n",
" fig.send_message(\"refresh\", {});\n",
" };\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
" var x0 = msg['x0'] / mpl.ratio;\n",
" var y0 = (fig.canvas.height - msg['y0']) / mpl.ratio;\n",
" var x1 = msg['x1'] / mpl.ratio;\n",
" var y1 = (fig.canvas.height - msg['y1']) / mpl.ratio;\n",
" x0 = Math.floor(x0) + 0.5;\n",
" y0 = Math.floor(y0) + 0.5;\n",
" x1 = Math.floor(x1) + 0.5;\n",
" y1 = Math.floor(y1) + 0.5;\n",
" var min_x = Math.min(x0, x1);\n",
" var min_y = Math.min(y0, y1);\n",
" var width = Math.abs(x1 - x0);\n",
" var height = Math.abs(y1 - y0);\n",
"\n",
" fig.rubberband_context.clearRect(\n",
" 0, 0, fig.canvas.width, fig.canvas.height);\n",
"\n",
" fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
" // Updates the figure title.\n",
" fig.header.textContent = msg['label'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
" var cursor = msg['cursor'];\n",
" switch(cursor)\n",
" {\n",
" case 0:\n",
" cursor = 'pointer';\n",
" break;\n",
" case 1:\n",
" cursor = 'default';\n",
" break;\n",
" case 2:\n",
" cursor = 'crosshair';\n",
" break;\n",
" case 3:\n",
" cursor = 'move';\n",
" break;\n",
" }\n",
" fig.rubberband_canvas.style.cursor = cursor;\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_message = function(fig, msg) {\n",
" fig.message.textContent = msg['message'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
" // Request the server to send over a new figure.\n",
" fig.send_draw_message();\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
" fig.image_mode = msg['mode'];\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Called whenever the canvas gets updated.\n",
" this.send_message(\"ack\", {});\n",
"}\n",
"\n",
"// A function to construct a web socket function for onmessage handling.\n",
"// Called in the figure constructor.\n",
"mpl.figure.prototype._make_on_message_function = function(fig) {\n",
" return function socket_on_message(evt) {\n",
" if (evt.data instanceof Blob) {\n",
" /* FIXME: We get \"Resource interpreted as Image but\n",
" * transferred with MIME type text/plain:\" errors on\n",
" * Chrome. But how to set the MIME type? It doesn't seem\n",
" * to be part of the websocket stream */\n",
" evt.data.type = \"image/png\";\n",
"\n",
" /* Free the memory for the previous frames */\n",
" if (fig.imageObj.src) {\n",
" (window.URL || window.webkitURL).revokeObjectURL(\n",
" fig.imageObj.src);\n",
" }\n",
"\n",
" fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
" evt.data);\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
" else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
" fig.imageObj.src = evt.data;\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
"\n",
" var msg = JSON.parse(evt.data);\n",
" var msg_type = msg['type'];\n",
"\n",
" // Call the \"handle_{type}\" callback, which takes\n",
" // the figure and JSON message as its only arguments.\n",
" try {\n",
" var callback = fig[\"handle_\" + msg_type];\n",
" } catch (e) {\n",
" console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
" return;\n",
" }\n",
"\n",
" if (callback) {\n",
" try {\n",
" // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
" callback(fig, msg);\n",
" } catch (e) {\n",
" console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
" }\n",
" }\n",
" };\n",
"}\n",
"\n",
"// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
"mpl.findpos = function(e) {\n",
" //this section is from http://www.quirksmode.org/js/events_properties.html\n",
" var targ;\n",
" if (!e)\n",
" e = window.event;\n",
" if (e.target)\n",
" targ = e.target;\n",
" else if (e.srcElement)\n",
" targ = e.srcElement;\n",
" if (targ.nodeType == 3) // defeat Safari bug\n",
" targ = targ.parentNode;\n",
"\n",
" // jQuery normalizes the pageX and pageY\n",
" // pageX,Y are the mouse positions relative to the document\n",
" // offset() returns the position of the element relative to the document\n",
" var x = e.pageX - $(targ).offset().left;\n",
" var y = e.pageY - $(targ).offset().top;\n",
"\n",
" return {\"x\": x, \"y\": y};\n",
"};\n",
"\n",
"/*\n",
" * return a copy of an object with only non-object keys\n",
" * we need this to avoid circular references\n",
" * http://stackoverflow.com/a/24161582/3208463\n",
" */\n",
"function simpleKeys (original) {\n",
" return Object.keys(original).reduce(function (obj, key) {\n",
" if (typeof original[key] !== 'object')\n",
" obj[key] = original[key]\n",
" return obj;\n",
" }, {});\n",
"}\n",
"\n",
"mpl.figure.prototype.mouse_event = function(event, name) {\n",
" var canvas_pos = mpl.findpos(event)\n",
"\n",
" if (name === 'button_press')\n",
" {\n",
" this.canvas.focus();\n",
" this.canvas_div.focus();\n",
" }\n",
"\n",
" var x = canvas_pos.x * mpl.ratio;\n",
" var y = canvas_pos.y * mpl.ratio;\n",
"\n",
" this.send_message(name, {x: x, y: y, button: event.button,\n",
" step: event.step,\n",
" guiEvent: simpleKeys(event)});\n",
"\n",
" /* This prevents the web browser from automatically changing to\n",
" * the text insertion cursor when the button is pressed. We want\n",
" * to control all of the cursor setting manually through the\n",
" * 'cursor' event from matplotlib */\n",
" event.preventDefault();\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" // Handle any extra behaviour associated with a key event\n",
"}\n",
"\n",
"mpl.figure.prototype.key_event = function(event, name) {\n",
"\n",
" // Prevent repeat events\n",
" if (name == 'key_press')\n",
" {\n",
" if (event.which === this._key)\n",
" return;\n",
" else\n",
" this._key = event.which;\n",
" }\n",
" if (name == 'key_release')\n",
" this._key = null;\n",
"\n",
" var value = '';\n",
" if (event.ctrlKey && event.which != 17)\n",
" value += \"ctrl+\";\n",
" if (event.altKey && event.which != 18)\n",
" value += \"alt+\";\n",
" if (event.shiftKey && event.which != 16)\n",
" value += \"shift+\";\n",
"\n",
" value += 'k';\n",
" value += event.which.toString();\n",
"\n",
" this._key_event_extra(event, name);\n",
"\n",
" this.send_message(name, {key: value,\n",
" guiEvent: simpleKeys(event)});\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
" if (name == 'download') {\n",
" this.handle_save(this, null);\n",
" } else {\n",
" this.send_message(\"toolbar_button\", {name: name});\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
" this.message.textContent = tooltip;\n",
"};\n",
"mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
"\n",
"mpl.extensions = [\"eps\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\"];\n",
"\n",
"mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
" // Create a \"websocket\"-like object which calls the given IPython comm\n",
" // object with the appropriate methods. Currently this is a non binary\n",
" // socket, so there is still some room for performance tuning.\n",
" var ws = {};\n",
"\n",
" ws.close = function() {\n",
" comm.close()\n",
" };\n",
" ws.send = function(m) {\n",
" //console.log('sending', m);\n",
" comm.send(m);\n",
" };\n",
" // Register the callback with on_msg.\n",
" comm.on_msg(function(msg) {\n",
" //console.log('receiving', msg['content']['data'], msg);\n",
" // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
" ws.onmessage(msg['content']['data'])\n",
" });\n",
" return ws;\n",
"}\n",
"\n",
"mpl.mpl_figure_comm = function(comm, msg) {\n",
" // This is the function which gets called when the mpl process\n",
" // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
"\n",
" var id = msg.content.data.id;\n",
" // Get hold of the div created by the display call when the Comm\n",
" // socket was opened in Python.\n",
" var element = $(\"#\" + id);\n",
" var ws_proxy = comm_websocket_adapter(comm)\n",
"\n",
" function ondownload(figure, format) {\n",
" window.open(figure.imageObj.src);\n",
" }\n",
"\n",
" var fig = new mpl.figure(id, ws_proxy,\n",
" ondownload,\n",
" element.get(0));\n",
"\n",
" // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
" // web socket which is closed, not our websocket->open comm proxy.\n",
" ws_proxy.onopen();\n",
"\n",
" fig.parent_element = element.get(0);\n",
" fig.cell_info = mpl.find_output_cell(\"\");\n",
" if (!fig.cell_info) {\n",
" console.error(\"Failed to find cell for figure\", id, fig);\n",
" return;\n",
" }\n",
"\n",
" var output_index = fig.cell_info[2]\n",
" var cell = fig.cell_info[0];\n",
"\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_close = function(fig, msg) {\n",
" var width = fig.canvas.width/mpl.ratio\n",
" fig.root.unbind('remove')\n",
"\n",
" // Update the output cell to use the data from the current canvas.\n",
" fig.push_to_output();\n",
" var dataURL = fig.canvas.toDataURL();\n",
" // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
" // the notebook keyboard shortcuts fail.\n",
" IPython.keyboard_manager.enable()\n",
" $(fig.parent_element).html('');\n",
" fig.close_ws(fig, msg);\n",
"}\n",
"\n",
"mpl.figure.prototype.close_ws = function(fig, msg){\n",
" fig.send_message('closing', msg);\n",
" // fig.ws.close()\n",
"}\n",
"\n",
"mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
" // Turn the data on the canvas into data in the output cell.\n",
" var width = this.canvas.width/mpl.ratio\n",
" var dataURL = this.canvas.toDataURL();\n",
" this.cell_info[1]['text/html'] = '';\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Tell IPython that the notebook contents must change.\n",
" IPython.notebook.set_dirty(true);\n",
" this.send_message(\"ack\", {});\n",
" var fig = this;\n",
" // Wait a second, then push the new image to the DOM so\n",
" // that it is saved nicely (might be nice to debounce this).\n",
" setTimeout(function () { fig.push_to_output() }, 1000);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items){\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) { continue; };\n",
"\n",
" var button = $('');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" // Add the status bar.\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"\n",
" // Add the close button to the window.\n",
" var buttongrp = $('');\n",
" var button = $('');\n",
" button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
" button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
" buttongrp.append(button);\n",
" var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
" titlebar.prepend(buttongrp);\n",
"}\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(el){\n",
" var fig = this\n",
" el.on(\"remove\", function(){\n",
"\tfig.close_ws(fig, {});\n",
" });\n",
"}\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(el){\n",
" // this is important to make the div 'focusable\n",
" el.attr('tabindex', 0)\n",
" // reach out to IPython and tell the keyboard manager to turn it's self\n",
" // off when our div gets focus\n",
"\n",
" // location in version 3\n",
" if (IPython.notebook.keyboard_manager) {\n",
" IPython.notebook.keyboard_manager.register_events(el);\n",
" }\n",
" else {\n",
" // location in version 2\n",
" IPython.keyboard_manager.register_events(el);\n",
" }\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" var manager = IPython.notebook.keyboard_manager;\n",
" if (!manager)\n",
" manager = IPython.keyboard_manager;\n",
"\n",
" // Check for shift+enter\n",
" if (event.shiftKey && event.which == 13) {\n",
" this.canvas_div.blur();\n",
" event.shiftKey = false;\n",
" // Send a \"J\" for go to next cell\n",
" event.which = 74;\n",
" event.keyCode = 74;\n",
" manager.command_mode();\n",
" manager.handle_keydown(event);\n",
" }\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" fig.ondownload(fig, null);\n",
"}\n",
"\n",
"\n",
"mpl.find_output_cell = function(html_output) {\n",
" // Return the cell and output element which can be found *uniquely* in the notebook.\n",
" // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
" // IPython event is triggered only after the cells have been serialised, which for\n",
" // our purposes (turning an active figure into a static one), is too late.\n",
" var cells = IPython.notebook.get_cells();\n",
" var ncells = cells.length;\n",
" for (var i=0; i= 3 moved mimebundle to data attribute of output\n",
" data = data.data;\n",
" }\n",
" if (data['text/html'] == html_output) {\n",
" return [cell, data, j];\n",
" }\n",
" }\n",
" }\n",
" }\n",
"}\n",
"\n",
"// Register the function which deals with the matplotlib target/channel.\n",
"// The kernel may be null if the page has been refreshed.\n",
"if (IPython.notebook.kernel != null) {\n",
" IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
"}\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
""
]
},
"execution_count": 88,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%matplotlib nbagg\n",
"df.set_index('time').plot(secondary_y='volume')"
]
},
{
"cell_type": "code",
"execution_count": 146,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:01:28.220826Z",
"start_time": "2018-04-23T19:01:28.173112Z"
},
"nbpresent": {
"id": "fcfa8cb1-d4e4-4663-85ff-4dc2ceb2f300"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/vnd.plotly.v1+html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# This is just an alternative visualisation so I'm not rewriting this\n",
"import plotly.plotly as py\n",
"from plotly.offline import init_notebook_mode, plot, iplot\n",
"import plotly.graph_objs as go\n",
"from datetime import datetime\n",
"init_notebook_mode(connected=False)\n",
"import cufflinks\n",
"\n",
"data = [go.Candlestick(\n",
" x=df.time,\n",
" open=df.open,\n",
" close=df.close,\n",
" high=df.high,\n",
" low=df.low\n",
")]"
]
},
{
"cell_type": "code",
"execution_count": 147,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:01:46.841706Z",
"start_time": "2018-04-23T19:01:44.400803Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"execution_count": 147,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"py.iplot(data)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"## Data Cleaning\n",
"LSTM operates best with values in the range -1,1 because of the `tanh` function in the middle\n",
"\n",
"But lets pretend we don't know that and have a look at what other `sklearn` scales give\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"![](tanh.gif)"
]
},
{
"cell_type": "code",
"execution_count": 91,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:10.089962Z",
"start_time": "2018-04-23T17:23:10.085288Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [],
"source": [
"# use sklearn.preprocessing fuctions to try out a few scaling methods\n",
"# remember iplot and boxplot "
]
},
{
"cell_type": "code",
"execution_count": 92,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:10.119546Z",
"start_time": "2018-04-23T17:23:10.094097Z"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" close | \n",
" close_MM | \n",
" close_SS | \n",
" close_RS | \n",
"
\n",
" \n",
" \n",
" \n",
" 0 | \n",
" 8915.98 | \n",
" -0.099234 | \n",
" 1.748741 | \n",
" 3.766167 | \n",
"
\n",
" \n",
" 1 | \n",
" 8795.01 | \n",
" -0.111623 | \n",
" 1.716305 | \n",
" 3.711147 | \n",
"
\n",
" \n",
" 2 | \n",
" 8915.42 | \n",
" -0.099292 | \n",
" 1.748591 | \n",
" 3.765912 | \n",
"
\n",
" \n",
" 3 | \n",
" 8866.27 | \n",
" -0.104325 | \n",
" 1.735412 | \n",
" 3.743557 | \n",
"
\n",
" \n",
" 4 | \n",
" 8274.00 | \n",
" -0.164977 | \n",
" 1.576604 | \n",
" 3.474182 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" close close_MM close_SS close_RS\n",
"0 8915.98 -0.099234 1.748741 3.766167\n",
"1 8795.01 -0.111623 1.716305 3.711147\n",
"2 8915.42 -0.099292 1.748591 3.765912\n",
"3 8866.27 -0.104325 1.735412 3.743557\n",
"4 8274.00 -0.164977 1.576604 3.474182"
]
},
"execution_count": 92,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from sklearn.preprocessing import minmax_scale, scale, robust_scale\n",
"from functools import partial\n",
"key = 'close'\n",
"for sn,s in {'MM':partial(minmax_scale, feature_range=(-1,1)), 'SS':scale, 'RS':robust_scale}.items():\n",
" df[f\"{key}_{sn}\"] = s(df[key].values.reshape(-1, 1))\n",
"df[[k for k in df.columns if k.startswith('close')]].head()"
]
},
{
"cell_type": "code",
"execution_count": 93,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:10.229277Z",
"start_time": "2018-04-23T17:23:10.121933Z"
},
"nbpresent": {
"id": "5340f61e-af7f-4abe-bc2d-715641d2b416"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"data": [
{
"line": {
"color": "rgba(255, 153, 51, 1.0)",
"dash": "solid",
"width": 1.3
},
"mode": "lines",
"name": "close",
"text": "",
"type": "scatter",
"x": [
"2018-04-23",
"2018-04-22",
"2018-04-21",
"2018-04-20",
"2018-04-19",
"2018-04-18",
"2018-04-17",
"2018-04-16",
"2018-04-15",
"2018-04-14",
"2018-04-13",
"2018-04-12",
"2018-04-11",
"2018-04-10",
"2018-04-09",
"2018-04-08",
"2018-04-07",
"2018-04-06",
"2018-04-05",
"2018-04-04",
"2018-04-03",
"2018-04-02",
"2018-04-01",
"2018-03-31",
"2018-03-30",
"2018-03-29",
"2018-03-28",
"2018-03-27",
"2018-03-26",
"2018-03-25",
"2018-03-24",
"2018-03-23",
"2018-03-22",
"2018-03-21",
"2018-03-20",
"2018-03-19",
"2018-03-18",
"2018-03-17",
"2018-03-16",
"2018-03-15",
"2018-03-14",
"2018-03-13",
"2018-03-12",
"2018-03-11",
"2018-03-10",
"2018-03-09",
"2018-03-08",
"2018-03-07",
"2018-03-06",
"2018-03-05",
"2018-03-04",
"2018-03-03",
"2018-03-02",
"2018-03-01",
"2018-02-28",
"2018-02-27",
"2018-02-26",
"2018-02-25",
"2018-02-24",
"2018-02-23",
"2018-02-22",
"2018-02-21",
"2018-02-20",
"2018-02-19",
"2018-02-18",
"2018-02-17",
"2018-02-16",
"2018-02-15",
"2018-02-14",
"2018-02-13",
"2018-02-12",
"2018-02-11",
"2018-02-10",
"2018-02-09",
"2018-02-08",
"2018-02-07",
"2018-02-06",
"2018-02-05",
"2018-02-04",
"2018-02-03",
"2018-02-02",
"2018-02-01",
"2018-01-31",
"2018-01-30",
"2018-01-29",
"2018-01-28",
"2018-01-27",
"2018-01-26",
"2018-01-25",
"2018-01-24",
"2018-01-23",
"2018-01-22",
"2018-01-21",
"2018-01-20",
"2018-01-19",
"2018-01-18",
"2018-01-17",
"2018-01-16",
"2018-01-15",
"2018-01-14",
"2018-01-13",
"2018-01-12",
"2018-01-11",
"2018-01-10",
"2018-01-09",
"2018-01-08",
"2018-01-07",
"2018-01-06",
"2018-01-05",
"2018-01-04",
"2018-01-03",
"2018-01-02",
"2018-01-01",
"2017-12-31",
"2017-12-30",
"2017-12-29",
"2017-12-28",
"2017-12-27",
"2017-12-26",
"2017-12-25",
"2017-12-24",
"2017-12-23",
"2017-12-22",
"2017-12-21",
"2017-12-20",
"2017-12-19",
"2017-12-18",
"2017-12-17",
"2017-12-16",
"2017-12-15",
"2017-12-14",
"2017-12-13",
"2017-12-12",
"2017-12-11",
"2017-12-10",
"2017-12-09",
"2017-12-08",
"2017-12-07",
"2017-12-06",
"2017-12-05",
"2017-12-04",
"2017-12-03",
"2017-12-02",
"2017-12-01",
"2017-11-30",
"2017-11-29",
"2017-11-28",
"2017-11-27",
"2017-11-26",
"2017-11-25",
"2017-11-24",
"2017-11-23",
"2017-11-22",
"2017-11-21",
"2017-11-20",
"2017-11-19",
"2017-11-18",
"2017-11-17",
"2017-11-16",
"2017-11-15",
"2017-11-14",
"2017-11-13",
"2017-11-12",
"2017-11-11",
"2017-11-10",
"2017-11-09",
"2017-11-08",
"2017-11-07",
"2017-11-06",
"2017-11-05",
"2017-11-04",
"2017-11-03",
"2017-11-02",
"2017-11-01",
"2017-10-31",
"2017-10-30",
"2017-10-29",
"2017-10-28",
"2017-10-27",
"2017-10-26",
"2017-10-25",
"2017-10-24",
"2017-10-23",
"2017-10-22",
"2017-10-21",
"2017-10-20",
"2017-10-19",
"2017-10-18",
"2017-10-17",
"2017-10-16",
"2017-10-15",
"2017-10-14",
"2017-10-13",
"2017-10-12",
"2017-10-11",
"2017-10-10",
"2017-10-09",
"2017-10-08",
"2017-10-07",
"2017-10-06",
"2017-10-05",
"2017-10-04",
"2017-10-03",
"2017-10-02",
"2017-10-01",
"2017-09-30",
"2017-09-29",
"2017-09-28",
"2017-09-27",
"2017-09-26",
"2017-09-25",
"2017-09-24",
"2017-09-23",
"2017-09-22",
"2017-09-21",
"2017-09-20",
"2017-09-19",
"2017-09-18",
"2017-09-17",
"2017-09-16",
"2017-09-15",
"2017-09-14",
"2017-09-13",
"2017-09-12",
"2017-09-11",
"2017-09-10",
"2017-09-09",
"2017-09-08",
"2017-09-07",
"2017-09-06",
"2017-09-05",
"2017-09-04",
"2017-09-03",
"2017-09-02",
"2017-09-01",
"2017-08-31",
"2017-08-30",
"2017-08-29",
"2017-08-28",
"2017-08-27",
"2017-08-26",
"2017-08-25",
"2017-08-24",
"2017-08-23",
"2017-08-22",
"2017-08-21",
"2017-08-20",
"2017-08-19",
"2017-08-18",
"2017-08-17",
"2017-08-16",
"2017-08-15",
"2017-08-14",
"2017-08-13",
"2017-08-12",
"2017-08-11",
"2017-08-10",
"2017-08-09",
"2017-08-08",
"2017-08-07",
"2017-08-06",
"2017-08-05",
"2017-08-04",
"2017-08-03",
"2017-08-02",
"2017-08-01",
"2017-07-31",
"2017-07-30",
"2017-07-29",
"2017-07-28",
"2017-07-27",
"2017-07-26",
"2017-07-25",
"2017-07-24",
"2017-07-23",
"2017-07-22",
"2017-07-21",
"2017-07-20",
"2017-07-19",
"2017-07-18",
"2017-07-17",
"2017-07-16",
"2017-07-15",
"2017-07-14",
"2017-07-13",
"2017-07-12",
"2017-07-11",
"2017-07-10",
"2017-07-09",
"2017-07-08",
"2017-07-07",
"2017-07-06",
"2017-07-05",
"2017-07-04",
"2017-07-03",
"2017-07-02",
"2017-07-01",
"2017-06-30",
"2017-06-29",
"2017-06-28",
"2017-06-27",
"2017-06-26",
"2017-06-25",
"2017-06-24",
"2017-06-23",
"2017-06-22",
"2017-06-21",
"2017-06-20",
"2017-06-19",
"2017-06-18",
"2017-06-17",
"2017-06-16",
"2017-06-15",
"2017-06-14",
"2017-06-13",
"2017-06-12",
"2017-06-11",
"2017-06-10",
"2017-06-09",
"2017-06-08",
"2017-06-07",
"2017-06-06",
"2017-06-05",
"2017-06-04",
"2017-06-03",
"2017-06-02",
"2017-06-01",
"2017-05-31",
"2017-05-30",
"2017-05-29",
"2017-05-28",
"2017-05-27",
"2017-05-26",
"2017-05-25",
"2017-05-24",
"2017-05-23",
"2017-05-22",
"2017-05-21",
"2017-05-20",
"2017-05-19",
"2017-05-18",
"2017-05-17",
"2017-05-16",
"2017-05-15",
"2017-05-14",
"2017-05-13",
"2017-05-12",
"2017-05-11",
"2017-05-10",
"2017-05-09",
"2017-05-08",
"2017-05-07",
"2017-05-06",
"2017-05-05",
"2017-05-04",
"2017-05-03",
"2017-05-02",
"2017-05-01",
"2017-04-30",
"2017-04-29",
"2017-04-28",
"2017-04-27",
"2017-04-26",
"2017-04-25",
"2017-04-24",
"2017-04-23",
"2017-04-22",
"2017-04-21",
"2017-04-20",
"2017-04-19",
"2017-04-18",
"2017-04-17",
"2017-04-16",
"2017-04-15",
"2017-04-14",
"2017-04-13",
"2017-04-12",
"2017-04-11",
"2017-04-10",
"2017-04-09",
"2017-04-08",
"2017-04-07",
"2017-04-06",
"2017-04-05",
"2017-04-04",
"2017-04-03",
"2017-04-02",
"2017-04-01",
"2017-03-31",
"2017-03-30",
"2017-03-29",
"2017-03-28",
"2017-03-27",
"2017-03-26",
"2017-03-25",
"2017-03-24",
"2017-03-23",
"2017-03-22",
"2017-03-21",
"2017-03-20",
"2017-03-19",
"2017-03-18",
"2017-03-17",
"2017-03-16",
"2017-03-15",
"2017-03-14",
"2017-03-13",
"2017-03-12",
"2017-03-11",
"2017-03-10",
"2017-03-09",
"2017-03-08",
"2017-03-07",
"2017-03-06",
"2017-03-05",
"2017-03-04",
"2017-03-03",
"2017-03-02",
"2017-03-01",
"2017-02-28",
"2017-02-27",
"2017-02-26",
"2017-02-25",
"2017-02-24",
"2017-02-23",
"2017-02-22",
"2017-02-21",
"2017-02-20",
"2017-02-19",
"2017-02-18",
"2017-02-17",
"2017-02-16",
"2017-02-15",
"2017-02-14",
"2017-02-13",
"2017-02-12",
"2017-02-11",
"2017-02-10",
"2017-02-09",
"2017-02-08",
"2017-02-07",
"2017-02-06",
"2017-02-05",
"2017-02-04",
"2017-02-03",
"2017-02-02",
"2017-02-01",
"2017-01-31",
"2017-01-30",
"2017-01-29",
"2017-01-28",
"2017-01-27",
"2017-01-26",
"2017-01-25",
"2017-01-24",
"2017-01-23",
"2017-01-22",
"2017-01-21",
"2017-01-20",
"2017-01-19",
"2017-01-18",
"2017-01-17",
"2017-01-16",
"2017-01-15",
"2017-01-14",
"2017-01-13",
"2017-01-12",
"2017-01-11",
"2017-01-10",
"2017-01-09",
"2017-01-08",
"2017-01-07",
"2017-01-06",
"2017-01-05",
"2017-01-04",
"2017-01-03",
"2017-01-02",
"2017-01-01",
"2016-12-31",
"2016-12-30",
"2016-12-29",
"2016-12-28",
"2016-12-27",
"2016-12-26",
"2016-12-25",
"2016-12-24",
"2016-12-23",
"2016-12-22",
"2016-12-21",
"2016-12-20",
"2016-12-19",
"2016-12-18",
"2016-12-17",
"2016-12-16",
"2016-12-15",
"2016-12-14",
"2016-12-13",
"2016-12-12",
"2016-12-11",
"2016-12-10",
"2016-12-09",
"2016-12-08",
"2016-12-07",
"2016-12-06",
"2016-12-05",
"2016-12-04",
"2016-12-03",
"2016-12-02",
"2016-12-01",
"2016-11-30",
"2016-11-29",
"2016-11-28",
"2016-11-27",
"2016-11-26",
"2016-11-25",
"2016-11-24",
"2016-11-23",
"2016-11-22",
"2016-11-21",
"2016-11-20",
"2016-11-19",
"2016-11-18",
"2016-11-17",
"2016-11-16",
"2016-11-15",
"2016-11-14",
"2016-11-13",
"2016-11-12",
"2016-11-11",
"2016-11-10",
"2016-11-09",
"2016-11-08",
"2016-11-07",
"2016-11-06",
"2016-11-05",
"2016-11-04",
"2016-11-03",
"2016-11-02",
"2016-11-01",
"2016-10-31",
"2016-10-30",
"2016-10-29",
"2016-10-28",
"2016-10-27",
"2016-10-26",
"2016-10-25",
"2016-10-24",
"2016-10-23",
"2016-10-22",
"2016-10-21",
"2016-10-20",
"2016-10-19",
"2016-10-18",
"2016-10-17",
"2016-10-16",
"2016-10-15",
"2016-10-14",
"2016-10-13",
"2016-10-12",
"2016-10-11",
"2016-10-10",
"2016-10-09",
"2016-10-08",
"2016-10-07",
"2016-10-06",
"2016-10-05",
"2016-10-04",
"2016-10-03",
"2016-10-02",
"2016-10-01",
"2016-09-30",
"2016-09-29",
"2016-09-28",
"2016-09-27",
"2016-09-26",
"2016-09-25",
"2016-09-24",
"2016-09-23",
"2016-09-22",
"2016-09-21",
"2016-09-20",
"2016-09-19",
"2016-09-18",
"2016-09-17",
"2016-09-16",
"2016-09-15",
"2016-09-14",
"2016-09-13",
"2016-09-12",
"2016-09-11",
"2016-09-10",
"2016-09-09",
"2016-09-08",
"2016-09-07",
"2016-09-06",
"2016-09-05",
"2016-09-04",
"2016-09-03",
"2016-09-02",
"2016-09-01",
"2016-08-31",
"2016-08-30",
"2016-08-29",
"2016-08-28",
"2016-08-27",
"2016-08-26",
"2016-08-25",
"2016-08-24",
"2016-08-23",
"2016-08-22",
"2016-08-21",
"2016-08-20",
"2016-08-19",
"2016-08-18",
"2016-08-17",
"2016-08-16",
"2016-08-15",
"2016-08-14",
"2016-08-13",
"2016-08-12",
"2016-08-11",
"2016-08-10",
"2016-08-09",
"2016-08-08",
"2016-08-07",
"2016-08-06",
"2016-08-05",
"2016-08-04",
"2016-08-03",
"2016-08-02",
"2016-08-01",
"2016-07-31",
"2016-07-30",
"2016-07-29",
"2016-07-28",
"2016-07-27",
"2016-07-26",
"2016-07-25",
"2016-07-24",
"2016-07-23",
"2016-07-22",
"2016-07-21",
"2016-07-20",
"2016-07-19",
"2016-07-18",
"2016-07-17",
"2016-07-16",
"2016-07-15",
"2016-07-14",
"2016-07-13",
"2016-07-12",
"2016-07-11",
"2016-07-10",
"2016-07-09",
"2016-07-08",
"2016-07-07",
"2016-07-06",
"2016-07-05",
"2016-07-04",
"2016-07-03",
"2016-07-02",
"2016-07-01",
"2016-06-30",
"2016-06-29",
"2016-06-28",
"2016-06-27",
"2016-06-26",
"2016-06-25",
"2016-06-24",
"2016-06-23",
"2016-06-22",
"2016-06-21",
"2016-06-20",
"2016-06-19",
"2016-06-18",
"2016-06-17",
"2016-06-16",
"2016-06-15",
"2016-06-14",
"2016-06-13",
"2016-06-12",
"2016-06-11",
"2016-06-10",
"2016-06-09",
"2016-06-08",
"2016-06-07",
"2016-06-06",
"2016-06-05",
"2016-06-04",
"2016-06-03",
"2016-06-02",
"2016-06-01",
"2016-05-31",
"2016-05-30",
"2016-05-29",
"2016-05-28",
"2016-05-27",
"2016-05-26",
"2016-05-25",
"2016-05-24",
"2016-05-23",
"2016-05-22",
"2016-05-21",
"2016-05-20",
"2016-05-19",
"2016-05-18",
"2016-05-17",
"2016-05-16",
"2016-05-15",
"2016-05-14",
"2016-05-13",
"2016-05-12",
"2016-05-11",
"2016-05-10",
"2016-05-09",
"2016-05-08",
"2016-05-07",
"2016-05-06",
"2016-05-05",
"2016-05-04",
"2016-05-03",
"2016-05-02",
"2016-05-01",
"2016-04-30",
"2016-04-29",
"2016-04-28",
"2016-04-27",
"2016-04-26",
"2016-04-25",
"2016-04-24",
"2016-04-23",
"2016-04-22",
"2016-04-21",
"2016-04-20",
"2016-04-19",
"2016-04-18",
"2016-04-17",
"2016-04-16",
"2016-04-15",
"2016-04-14",
"2016-04-13",
"2016-04-12",
"2016-04-11",
"2016-04-10",
"2016-04-09",
"2016-04-08",
"2016-04-07",
"2016-04-06",
"2016-04-05",
"2016-04-04",
"2016-04-03",
"2016-04-02",
"2016-04-01",
"2016-03-31",
"2016-03-30",
"2016-03-29",
"2016-03-28",
"2016-03-27",
"2016-03-26",
"2016-03-25",
"2016-03-24",
"2016-03-23",
"2016-03-22",
"2016-03-21",
"2016-03-20",
"2016-03-19",
"2016-03-18",
"2016-03-17",
"2016-03-16",
"2016-03-15",
"2016-03-14",
"2016-03-13",
"2016-03-12",
"2016-03-11",
"2016-03-10",
"2016-03-09",
"2016-03-08",
"2016-03-07",
"2016-03-06",
"2016-03-05",
"2016-03-04",
"2016-03-03",
"2016-03-02",
"2016-03-01",
"2016-02-29",
"2016-02-28",
"2016-02-27",
"2016-02-26",
"2016-02-25",
"2016-02-24",
"2016-02-23",
"2016-02-22",
"2016-02-21",
"2016-02-20",
"2016-02-19",
"2016-02-18",
"2016-02-17",
"2016-02-16",
"2016-02-15",
"2016-02-14",
"2016-02-13",
"2016-02-12",
"2016-02-11",
"2016-02-10",
"2016-02-09",
"2016-02-08",
"2016-02-07",
"2016-02-06",
"2016-02-05",
"2016-02-04",
"2016-02-03",
"2016-02-02",
"2016-02-01",
"2016-01-31",
"2016-01-30",
"2016-01-29",
"2016-01-28",
"2016-01-27",
"2016-01-26",
"2016-01-25",
"2016-01-24",
"2016-01-23",
"2016-01-22",
"2016-01-21",
"2016-01-20",
"2016-01-19",
"2016-01-18",
"2016-01-17",
"2016-01-16",
"2016-01-15",
"2016-01-14",
"2016-01-13",
"2016-01-12",
"2016-01-11",
"2016-01-10",
"2016-01-09",
"2016-01-08",
"2016-01-07",
"2016-01-06",
"2016-01-05",
"2016-01-04",
"2016-01-03",
"2016-01-02",
"2016-01-01",
"2015-12-31",
"2015-12-30",
"2015-12-29",
"2015-12-28",
"2015-12-27",
"2015-12-26",
"2015-12-25",
"2015-12-24",
"2015-12-23",
"2015-12-22",
"2015-12-21",
"2015-12-20",
"2015-12-19",
"2015-12-18",
"2015-12-17",
"2015-12-16",
"2015-12-15",
"2015-12-14",
"2015-12-13",
"2015-12-12",
"2015-12-11",
"2015-12-10",
"2015-12-09",
"2015-12-08",
"2015-12-07",
"2015-12-06",
"2015-12-05",
"2015-12-04",
"2015-12-03",
"2015-12-02",
"2015-12-01",
"2015-11-30",
"2015-11-29",
"2015-11-28",
"2015-11-27",
"2015-11-26",
"2015-11-25",
"2015-11-24",
"2015-11-23",
"2015-11-22",
"2015-11-21",
"2015-11-20",
"2015-11-19",
"2015-11-18",
"2015-11-17",
"2015-11-16",
"2015-11-15",
"2015-11-14",
"2015-11-13",
"2015-11-12",
"2015-11-11",
"2015-11-10",
"2015-11-09",
"2015-11-08",
"2015-11-07",
"2015-11-06",
"2015-11-05",
"2015-11-04",
"2015-11-03",
"2015-11-02",
"2015-11-01",
"2015-10-31",
"2015-10-30",
"2015-10-29",
"2015-10-28",
"2015-10-27",
"2015-10-26",
"2015-10-25",
"2015-10-24",
"2015-10-23",
"2015-10-22",
"2015-10-21",
"2015-10-20",
"2015-10-19",
"2015-10-18",
"2015-10-17",
"2015-10-16",
"2015-10-15",
"2015-10-14",
"2015-10-13",
"2015-10-12",
"2015-10-11",
"2015-10-10",
"2015-10-09",
"2015-10-08",
"2015-10-07",
"2015-10-06",
"2015-10-05",
"2015-10-04",
"2015-10-03",
"2015-10-02",
"2015-10-01",
"2015-09-30",
"2015-09-29",
"2015-09-28",
"2015-09-27",
"2015-09-26",
"2015-09-25",
"2015-09-24",
"2015-09-23",
"2015-09-22",
"2015-09-21",
"2015-09-20",
"2015-09-19",
"2015-09-18",
"2015-09-17",
"2015-09-16",
"2015-09-15",
"2015-09-14",
"2015-09-13",
"2015-09-12",
"2015-09-11",
"2015-09-10",
"2015-09-09",
"2015-09-08",
"2015-09-07",
"2015-09-06",
"2015-09-05",
"2015-09-04",
"2015-09-03",
"2015-09-02",
"2015-09-01",
"2015-08-31",
"2015-08-30",
"2015-08-29",
"2015-08-28",
"2015-08-27",
"2015-08-26",
"2015-08-25",
"2015-08-24",
"2015-08-23",
"2015-08-22",
"2015-08-21",
"2015-08-20",
"2015-08-19",
"2015-08-18",
"2015-08-17",
"2015-08-16",
"2015-08-15",
"2015-08-14",
"2015-08-13",
"2015-08-12",
"2015-08-11",
"2015-08-10",
"2015-08-09",
"2015-08-08",
"2015-08-07",
"2015-08-06",
"2015-08-05",
"2015-08-04",
"2015-08-03",
"2015-08-02",
"2015-08-01",
"2015-07-31",
"2015-07-30",
"2015-07-29",
"2015-07-28",
"2015-07-27",
"2015-07-26",
"2015-07-25",
"2015-07-24",
"2015-07-23",
"2015-07-22",
"2015-07-21",
"2015-07-20",
"2015-07-19",
"2015-07-18",
"2015-07-17",
"2015-07-16",
"2015-07-15",
"2015-07-14",
"2015-07-13",
"2015-07-12",
"2015-07-11",
"2015-07-10",
"2015-07-09",
"2015-07-08",
"2015-07-07",
"2015-07-06",
"2015-07-05",
"2015-07-04",
"2015-07-03",
"2015-07-02",
"2015-07-01",
"2015-06-30",
"2015-06-29",
"2015-06-28",
"2015-06-27",
"2015-06-26",
"2015-06-25",
"2015-06-24",
"2015-06-23",
"2015-06-22",
"2015-06-21",
"2015-06-20",
"2015-06-19",
"2015-06-18",
"2015-06-17",
"2015-06-16",
"2015-06-15",
"2015-06-14",
"2015-06-13",
"2015-06-12",
"2015-06-11",
"2015-06-10",
"2015-06-09",
"2015-06-08",
"2015-06-07",
"2015-06-06",
"2015-06-05",
"2015-06-04",
"2015-06-03",
"2015-06-02",
"2015-06-01",
"2015-05-31",
"2015-05-30",
"2015-05-29",
"2015-05-28",
"2015-05-27",
"2015-05-26",
"2015-05-25",
"2015-05-24",
"2015-05-23",
"2015-05-22",
"2015-05-21",
"2015-05-20",
"2015-05-19",
"2015-05-18",
"2015-05-17",
"2015-05-16",
"2015-05-15",
"2015-05-14",
"2015-05-13",
"2015-05-12",
"2015-05-11",
"2015-05-10",
"2015-05-09",
"2015-05-08",
"2015-05-07",
"2015-05-06",
"2015-05-05",
"2015-05-04",
"2015-05-03",
"2015-05-02",
"2015-05-01",
"2015-04-30",
"2015-04-29",
"2015-04-28",
"2015-04-27",
"2015-04-26",
"2015-04-25",
"2015-04-24",
"2015-04-23",
"2015-04-22",
"2015-04-21",
"2015-04-20",
"2015-04-19",
"2015-04-18",
"2015-04-17",
"2015-04-16",
"2015-04-15",
"2015-04-14",
"2015-04-13",
"2015-04-12",
"2015-04-11",
"2015-04-10",
"2015-04-09",
"2015-04-08",
"2015-04-07",
"2015-04-06",
"2015-04-05",
"2015-04-04",
"2015-04-03",
"2015-04-02",
"2015-04-01",
"2015-03-31",
"2015-03-30",
"2015-03-29",
"2015-03-28",
"2015-03-27",
"2015-03-26",
"2015-03-25",
"2015-03-24",
"2015-03-23",
"2015-03-22",
"2015-03-21",
"2015-03-20",
"2015-03-19",
"2015-03-18",
"2015-03-17",
"2015-03-16",
"2015-03-15",
"2015-03-14",
"2015-03-13",
"2015-03-12",
"2015-03-11",
"2015-03-10",
"2015-03-09",
"2015-03-08",
"2015-03-07",
"2015-03-06",
"2015-03-05",
"2015-03-04",
"2015-03-03",
"2015-03-02",
"2015-03-01",
"2015-02-28",
"2015-02-27",
"2015-02-26",
"2015-02-25",
"2015-02-24",
"2015-02-23",
"2015-02-22",
"2015-02-21",
"2015-02-20",
"2015-02-19",
"2015-02-18",
"2015-02-17",
"2015-02-16",
"2015-02-15",
"2015-02-14",
"2015-02-13",
"2015-02-12",
"2015-02-11",
"2015-02-10",
"2015-02-09",
"2015-02-08",
"2015-02-07",
"2015-02-06",
"2015-02-05",
"2015-02-04",
"2015-02-03",
"2015-02-02",
"2015-02-01",
"2015-01-31",
"2015-01-30",
"2015-01-29",
"2015-01-28",
"2015-01-27",
"2015-01-26",
"2015-01-25",
"2015-01-24",
"2015-01-23",
"2015-01-22",
"2015-01-21",
"2015-01-20",
"2015-01-19",
"2015-01-17",
"2015-01-16",
"2015-01-15",
"2015-01-14",
"2015-01-13",
"2015-01-08",
"2014-12-18",
"2014-12-12",
"2014-12-10",
"2014-12-08",
"2014-12-06",
"2014-12-04",
"2014-12-03",
"2014-12-02",
"2014-12-01"
],
"xaxis": "x1",
"y": [
8915.98,
8795.01,
8915.42,
8866.27,
8274,
8152.05,
7892.1,
8048.93,
8355.25,
8003.11,
7893.19,
7916,
6942.99,
6824.99,
6771.13,
7020.01,
6894.01,
6619.01,
6785.85,
6791.68,
7424.9,
7045.01,
6816.01,
6928.5,
6848.01,
7079.99,
7942.72,
7793.61,
8145,
8452.96,
8531.34,
8927.1,
8715.09,
8891.81,
8900,
8497.8,
8192,
7865.02,
8275,
8259.99,
8207.03,
9145.41,
9120,
9533.88,
8795.44,
9255,
9304.9,
9920,
10700,
11377.54,
11469.9,
11432.5,
11000,
10895.92,
10307.27,
10566.57,
10300,
9597.99,
9688.62,
10144.99,
9830,
10454.27,
11235.57,
11140,
10380.04,
11121.5,
10167.49,
10031.23,
9472.98,
8520.01,
8872.28,
8072.99,
8547.49,
8671.01,
8218.1,
7575.75,
7688.46,
6905.19,
8167.91,
9240,
8787.52,
9014.23,
10099.99,
9995,
11123.01,
11536,
11319,
11086.89,
11118,
11356.79,
10824.94,
10766.7,
11518.17,
12762.8,
11498.99,
11305.53,
11200.01,
11570.01,
13590,
13656.23,
14187.95,
13820,
13308.06,
14875.18,
14480.99,
14993.74,
16174.22,
17098.99,
16960.01,
15144.99,
15098.14,
14781.51,
13480.01,
13863.13,
12839.99,
14565.05,
14450.01,
15367.08,
15790.88,
14171.98,
14221.94,
15075.89,
14210.57,
15758.8,
16496.89,
17838.73,
19039.01,
19378.99,
19650.01,
17738.67,
16749.78,
16689.61,
17730.12,
16885.76,
15290.01,
15309.98,
16367.03,
17390.01,
14090,
11718.35,
11643.98,
11290,
10930.24,
10869.84,
9903,
9935.98,
9949,
9768.71,
9401.11,
8795.5,
8215.01,
8031.16,
8250,
8109,
8256.01,
8031.82,
7777.01,
7714.71,
7838.53,
7294,
6605,
6535.87,
5886.35,
6346.7,
6577.62,
7156,
7467.96,
7126.63,
6969.76,
7392,
7412.55,
7170.01,
7039.98,
6783.69,
6445.01,
6124.16,
6140.01,
5752.01,
5780,
5891.61,
5739.97,
5525.43,
5905.99,
6005.05,
6024.86,
5989.1,
5704.01,
5574.44,
5594,
5754.9,
5693.7,
5819.13,
5624.8,
5440,
4814.99,
4750,
4769.55,
4603.49,
4425,
4362.99,
4320.04,
4214.84,
4307.99,
4392.71,
4394.81,
4339,
4156.99,
4189.42,
4200,
3885.09,
3919.78,
3669.01,
3787.33,
3619.01,
3617.47,
3872.06,
3910.11,
4100,
3719.97,
3726.51,
3740.02,
3250.4,
3855.32,
4164.52,
4210.72,
4251.36,
4334.36,
4350,
4624.18,
4616.18,
4432.51,
4498.25,
4626.05,
4649.99,
4947.99,
4743.94,
4581.98,
4599,
4384.99,
4340.11,
4344.32,
4360,
4312.03,
4143.49,
4092,
4002,
4050.99,
4157.41,
4101.72,
4280.01,
4370.01,
4159.93,
4320.6,
4060.47,
3874,
3656.15,
3444.98,
3342.8,
3422.43,
3398.23,
3222.22,
3243.49,
2857.34,
2787.02,
2699.9,
2732.59,
2856.88,
2723.99,
2700.21,
2786.07,
2664.99,
2525.99,
2564,
2762.26,
2754.28,
2825.27,
2657.45,
2873.48,
2258.99,
2308.15,
2235.19,
1911.78,
1964.31,
2217.24,
2340,
2383.42,
2310.01,
2331.05,
2508.99,
2561.11,
2501.15,
2604.84,
2616.96,
2602,
2542.41,
2516.66,
2423.63,
2455.19,
2530,
2553.12,
2575.75,
2407.91,
2505.61,
2574.84,
2690.76,
2679.99,
2643.35,
2725.08,
2596.98,
2515.25,
2634.94,
2480.43,
2409.98,
2432.21,
2709.01,
2655.71,
2998.98,
2931.15,
2811.39,
2799.73,
2685.64,
2871.29,
2698,
2521.36,
2548.05,
2478.99,
2419.99,
2303.29,
2191.58,
2279.48,
2232.78,
2099.99,
2272.7,
2355,
2432.97,
2272.75,
2123.29,
2057,
2058.91,
1976.23,
1899.16,
1813.23,
1777.48,
1747.81,
1799.99,
1792.73,
1695.61,
1837.93,
1794.99,
1720.43,
1713,
1609.57,
1585.39,
1551.3,
1563.39,
1533,
1471.99,
1436.5,
1384.55,
1365.43,
1353.34,
1349.26,
1298.44,
1281.16,
1257.29,
1251.98,
1247,
1249.99,
1236.15,
1214.21,
1201.94,
1189.91,
1177.99,
1178.85,
1173.74,
1177.05,
1214.17,
1223.99,
1210,
1210.97,
1184.5,
1194,
1192.3,
1132.99,
1143.99,
1152.6,
1113.99,
1092,
1088.99,
1042.34,
1043.27,
1045.4,
1042.08,
973.08,
963.72,
934.87,
1025.14,
1034.57,
1114.42,
1044.96,
1019.49,
970,
1069.57,
1175.11,
1263,
1247.42,
1245.49,
1235.58,
1188.11,
1109.01,
1197.3,
1150.22,
1237.36,
1284.99,
1278.98,
1273.97,
1292.86,
1269.17,
1230,
1195.08,
1195.81,
1184.91,
1158,
1186.91,
1186.9,
1128.71,
1128.29,
1089.82,
1059.88,
1062.15,
1057.3,
1038.94,
1014.53,
1013.92,
1002.82,
1010,
1018.65,
1001.99,
994.24,
1056.7,
1053.96,
1022.58,
1016.32,
1035.54,
1018,
1008.38,
992.75,
970.01,
923.23,
916.54,
924.98,
922.63,
917.02,
896,
887,
910.7,
931.22,
925.06,
894.31,
902.92,
887.99,
906,
834.41,
833.31,
828,
831.42,
812.25,
795.77,
907,
902.66,
923.33,
909,
895.71,
1007,
1130.3,
1020.67,
1011.45,
992.95,
973.37,
960.81,
970.72,
982.17,
925.2,
902.09,
896.12,
891.5,
917.26,
856.02,
834.5,
798.99,
790.81,
790.72,
788.57,
780.98,
776.16,
777.66,
776.18,
778.94,
771.05,
775.87,
773.22,
767.89,
764.34,
759.8,
752,
767.99,
766.98,
769.25,
754,
742.69,
732.37,
729.77,
729.24,
735.7,
739.74,
737.99,
741.52,
746.66,
736.4,
731.99,
750.77,
748.54,
730.71,
739.85,
712.29,
708.32,
704.01,
704.53,
716.9,
712.91,
720.97,
711.15,
706.42,
717.02,
706.99,
706.32,
690,
744.6,
730.7,
696.9,
697.41,
714.28,
689.95,
691.21,
674,
654.3,
649.98,
651.04,
652.75,
630.83,
628.05,
629.79,
635.11,
639.56,
641.92,
638.16,
638.03,
635.66,
635.79,
642.12,
618.72,
617.42,
619.5,
617.98,
611.88,
613.16,
610.34,
612.99,
612.4,
615.65,
608.99,
605.99,
605.04,
605.71,
607.08,
601.67,
603.68,
602.96,
596.21,
597,
605.6,
608.6,
611.4,
607.92,
607.93,
605.44,
608.43,
608.63,
606.74,
607.94,
623.74,
622.07,
627.97,
615.21,
612.99,
605.69,
611.92,
600.91,
576.21,
573.02,
572.89,
574.95,
573.21,
575.41,
570.84,
579.29,
575.58,
578.47,
582.39,
585.2,
581.29,
581.87,
573.67,
574.09,
574.45,
579.02,
567.79,
574.99,
586.45,
587.74,
587.91,
594.94,
586.45,
591.48,
595.14,
591.71,
583,
587.5,
573.36,
537.47,
605.2,
626.97,
655.87,
657,
657.4,
657.35,
654.06,
657.79,
661,
657.5,
654.67,
667.28,
666.92,
673.98,
675.5,
680,
666.32,
667.48,
661.65,
655.34,
666.56,
650.97,
652.44,
657.61,
667.33,
641.97,
678.79,
669.87,
681.98,
663.55,
704.95,
678.19,
673.49,
639.42,
648.43,
657.87,
638.56,
673.71,
669.98,
631.1,
604.5,
667.66,
703.12,
768.76,
758.99,
752.26,
769.76,
698.78,
684.95,
706.01,
677.86,
609.5,
580.31,
577.46,
583.21,
579.71,
586.77,
575.17,
576.31,
571.25,
537.87,
534.84,
531.34,
532.55,
525.22,
523.25,
471.27,
454.97,
451.49,
446.99,
445.67,
442.48,
446.28,
445.65,
438.38,
455.56,
454.19,
455.66,
461.47,
458.9,
457.98,
456.48,
454.37,
452.78,
464.16,
462.79,
461.91,
462.31,
449.98,
448.68,
452.21,
446.42,
456.98,
454.02,
458.82,
451.68,
445.31,
470.59,
466.17,
464.46,
455.69,
448.41,
452.25,
442.96,
437.06,
430.97,
431,
433.39,
430.93,
426.32,
425.58,
427.8,
423.94,
423.4,
419.46,
419.48,
421.99,
421.46,
422.36,
419.47,
420.16,
419.95,
417.68,
416.03,
412.79,
416.39,
423,
425.3,
416.97,
416.41,
412.95,
417.53,
416.66,
412,
411.27,
410.2,
409.65,
418.41,
416.07,
415.41,
415.02,
412.52,
410.58,
419.39,
415.98,
412.8,
411.18,
412.21,
403.24,
396.08,
407.35,
418.8,
420.39,
433.08,
436.44,
433.73,
433.12,
430.85,
423.54,
423.94,
419.97,
437.55,
438.56,
437.46,
420.72,
421.19,
415.2,
407.42,
398.95,
406.59,
391,
382.05,
378.23,
378.44,
372.68,
371.14,
377.49,
375.44,
384.5,
387.99,
368.87,
372.93,
371.33,
367.95,
378.46,
378.68,
379.61,
394.79,
391.54,
391.4,
403.05,
387.5,
382.9,
409.38,
418.54,
375.27,
384.89,
378.46,
388.7,
357.53,
430.03,
432.77,
434.01,
449.19,
449.99,
450.38,
454.44,
459.07,
430.87,
433.34,
433.85,
431.91,
435.4,
435.66,
430.35,
427.95,
433.89,
421.94,
424.72,
419.41,
455.84,
455.74,
442.43,
433.92,
436.81,
442.22,
461.29,
463.17,
455.5,
453.97,
464.27,
444.01,
433.83,
436.87,
452.95,
415.68,
418.39,
418.94,
394.73,
387.55,
387.99,
363.98,
361.77,
360,
362.68,
376.86,
372.24,
357.24,
358.19,
352.57,
328.98,
321,
323,
323.71,
327,
322.39,
326.41,
335.49,
336.49,
332.89,
322.93,
334.71,
338.07,
336.49,
313.2,
337.14,
379.53,
373.83,
384.81,
374.09,
387.21,
410,
404.1,
365.21,
329.46,
314.85,
329.11,
316.08,
304.09,
295.61,
287.1,
284.97,
284.29,
278.76,
275.84,
268.77,
271.14,
265.17,
265,
272.87,
263.43,
254.99,
253.27,
250.99,
246.39,
249.02,
246.07,
244.35,
242.94,
244,
246.64,
240.95,
239.87,
239.92,
238.28,
238.34,
237.14,
236.89,
239.99,
233.58,
234.69,
235.89,
235.27,
230.26,
231.28,
227.31,
232.24,
232.88,
233.78,
233.34,
229.73,
230.6,
231.01,
230.82,
236.5,
240.9,
238.52,
238.75,
244.14,
241.31,
241.29,
236.01,
231.39,
227.25,
229.97,
228.22,
230.75,
229.39,
230.61,
231.55,
225.8,
226.81,
223.73,
211.16,
229.21,
231.15,
232.85,
235.56,
227.34,
221.99,
257.31,
259.2,
262.46,
266.17,
264.67,
266.94,
271.99,
265.15,
267.63,
262.02,
279.94,
279.65,
282.77,
285.51,
280.95,
282.62,
281.53,
285.19,
288.49,
290.19,
295.76,
294.21,
293.89,
289.7,
289.12,
277.39,
277.89,
277.32,
280,
275.61,
277.71,
280.58,
279.38,
285.7,
287.51,
293.08,
312.16,
294.23,
286.67,
269.75,
270.97,
266.18,
269.94,
271.74,
260.64,
256.95,
254.85,
259.02,
263.82,
257.54,
249.11,
251.59,
243,
242.44,
240.04,
244.52,
247.5,
244.66,
246.13,
246.33,
249.27,
250.25,
251.91,
236.99,
233.6,
233.47,
229.47,
229.69,
228.73,
229.18,
229.1,
223.89,
225.48,
224.97,
224.57,
225.86,
225.85,
223.56,
230.21,
233.55,
236.89,
237.34,
237.35,
236.79,
237.43,
240.82,
239.36,
240.45,
235.77,
234.54,
232.59,
234.04,
237.12,
236.73,
237.82,
237.46,
236.32,
242.03,
242.86,
241.57,
242.5,
244.54,
237.99,
230,
236.76,
239.75,
240.78,
235.94,
233.14,
236.81,
225.6,
225.64,
227.58,
221.27,
227.05,
231.51,
235.99,
233.98,
235.89,
225.37,
224.03,
224.02,
223.62,
229.45,
224.35,
221.05,
225.73,
237.55,
237.91,
236.78,
244.74,
246.58,
254.27,
256.85,
261.47,
254.36,
254.84,
254.39,
247.87,
245.5,
248.78,
243.69,
253.52,
247.81,
249.88,
246.88,
246.15,
267.53,
269.45,
261.9,
263.31,
263.05,
258.5,
286.74,
292.37,
288,
283.95,
284,
296.05,
296.99,
293.47,
290.19,
275.5,
276.89,
273.23,
276.86,
273.37,
283.27,
276.7,
260.24,
255.59,
254.42,
237.11,
238.19,
239.87,
239.49,
236.83,
245.99,
245.34,
240.9,
237.49,
244.82,
234.68,
235.54,
256.66,
236.49,
223.21,
219.81,
220.87,
221.1,
223.99,
229,
223.2,
216.76,
227.11,
228.58,
237.83,
228.99,
218.45,
229.07,
235.03,
236.09,
263.65,
274.48,
254.53,
240,
235,
226.32,
225.51,
218,
225.51,
184,
199.46,
204.22,
120,
260,
288.99,
340,
350,
360.5,
375,
378,
377.1,
378,
378,
370
],
"yaxis": "y2"
},
{
"line": {
"color": "rgba(55, 128, 191, 1.0)",
"dash": "solid",
"width": 1.3
},
"mode": "lines",
"name": "close_MM",
"text": "",
"type": "scatter",
"x": [
"2018-04-23",
"2018-04-22",
"2018-04-21",
"2018-04-20",
"2018-04-19",
"2018-04-18",
"2018-04-17",
"2018-04-16",
"2018-04-15",
"2018-04-14",
"2018-04-13",
"2018-04-12",
"2018-04-11",
"2018-04-10",
"2018-04-09",
"2018-04-08",
"2018-04-07",
"2018-04-06",
"2018-04-05",
"2018-04-04",
"2018-04-03",
"2018-04-02",
"2018-04-01",
"2018-03-31",
"2018-03-30",
"2018-03-29",
"2018-03-28",
"2018-03-27",
"2018-03-26",
"2018-03-25",
"2018-03-24",
"2018-03-23",
"2018-03-22",
"2018-03-21",
"2018-03-20",
"2018-03-19",
"2018-03-18",
"2018-03-17",
"2018-03-16",
"2018-03-15",
"2018-03-14",
"2018-03-13",
"2018-03-12",
"2018-03-11",
"2018-03-10",
"2018-03-09",
"2018-03-08",
"2018-03-07",
"2018-03-06",
"2018-03-05",
"2018-03-04",
"2018-03-03",
"2018-03-02",
"2018-03-01",
"2018-02-28",
"2018-02-27",
"2018-02-26",
"2018-02-25",
"2018-02-24",
"2018-02-23",
"2018-02-22",
"2018-02-21",
"2018-02-20",
"2018-02-19",
"2018-02-18",
"2018-02-17",
"2018-02-16",
"2018-02-15",
"2018-02-14",
"2018-02-13",
"2018-02-12",
"2018-02-11",
"2018-02-10",
"2018-02-09",
"2018-02-08",
"2018-02-07",
"2018-02-06",
"2018-02-05",
"2018-02-04",
"2018-02-03",
"2018-02-02",
"2018-02-01",
"2018-01-31",
"2018-01-30",
"2018-01-29",
"2018-01-28",
"2018-01-27",
"2018-01-26",
"2018-01-25",
"2018-01-24",
"2018-01-23",
"2018-01-22",
"2018-01-21",
"2018-01-20",
"2018-01-19",
"2018-01-18",
"2018-01-17",
"2018-01-16",
"2018-01-15",
"2018-01-14",
"2018-01-13",
"2018-01-12",
"2018-01-11",
"2018-01-10",
"2018-01-09",
"2018-01-08",
"2018-01-07",
"2018-01-06",
"2018-01-05",
"2018-01-04",
"2018-01-03",
"2018-01-02",
"2018-01-01",
"2017-12-31",
"2017-12-30",
"2017-12-29",
"2017-12-28",
"2017-12-27",
"2017-12-26",
"2017-12-25",
"2017-12-24",
"2017-12-23",
"2017-12-22",
"2017-12-21",
"2017-12-20",
"2017-12-19",
"2017-12-18",
"2017-12-17",
"2017-12-16",
"2017-12-15",
"2017-12-14",
"2017-12-13",
"2017-12-12",
"2017-12-11",
"2017-12-10",
"2017-12-09",
"2017-12-08",
"2017-12-07",
"2017-12-06",
"2017-12-05",
"2017-12-04",
"2017-12-03",
"2017-12-02",
"2017-12-01",
"2017-11-30",
"2017-11-29",
"2017-11-28",
"2017-11-27",
"2017-11-26",
"2017-11-25",
"2017-11-24",
"2017-11-23",
"2017-11-22",
"2017-11-21",
"2017-11-20",
"2017-11-19",
"2017-11-18",
"2017-11-17",
"2017-11-16",
"2017-11-15",
"2017-11-14",
"2017-11-13",
"2017-11-12",
"2017-11-11",
"2017-11-10",
"2017-11-09",
"2017-11-08",
"2017-11-07",
"2017-11-06",
"2017-11-05",
"2017-11-04",
"2017-11-03",
"2017-11-02",
"2017-11-01",
"2017-10-31",
"2017-10-30",
"2017-10-29",
"2017-10-28",
"2017-10-27",
"2017-10-26",
"2017-10-25",
"2017-10-24",
"2017-10-23",
"2017-10-22",
"2017-10-21",
"2017-10-20",
"2017-10-19",
"2017-10-18",
"2017-10-17",
"2017-10-16",
"2017-10-15",
"2017-10-14",
"2017-10-13",
"2017-10-12",
"2017-10-11",
"2017-10-10",
"2017-10-09",
"2017-10-08",
"2017-10-07",
"2017-10-06",
"2017-10-05",
"2017-10-04",
"2017-10-03",
"2017-10-02",
"2017-10-01",
"2017-09-30",
"2017-09-29",
"2017-09-28",
"2017-09-27",
"2017-09-26",
"2017-09-25",
"2017-09-24",
"2017-09-23",
"2017-09-22",
"2017-09-21",
"2017-09-20",
"2017-09-19",
"2017-09-18",
"2017-09-17",
"2017-09-16",
"2017-09-15",
"2017-09-14",
"2017-09-13",
"2017-09-12",
"2017-09-11",
"2017-09-10",
"2017-09-09",
"2017-09-08",
"2017-09-07",
"2017-09-06",
"2017-09-05",
"2017-09-04",
"2017-09-03",
"2017-09-02",
"2017-09-01",
"2017-08-31",
"2017-08-30",
"2017-08-29",
"2017-08-28",
"2017-08-27",
"2017-08-26",
"2017-08-25",
"2017-08-24",
"2017-08-23",
"2017-08-22",
"2017-08-21",
"2017-08-20",
"2017-08-19",
"2017-08-18",
"2017-08-17",
"2017-08-16",
"2017-08-15",
"2017-08-14",
"2017-08-13",
"2017-08-12",
"2017-08-11",
"2017-08-10",
"2017-08-09",
"2017-08-08",
"2017-08-07",
"2017-08-06",
"2017-08-05",
"2017-08-04",
"2017-08-03",
"2017-08-02",
"2017-08-01",
"2017-07-31",
"2017-07-30",
"2017-07-29",
"2017-07-28",
"2017-07-27",
"2017-07-26",
"2017-07-25",
"2017-07-24",
"2017-07-23",
"2017-07-22",
"2017-07-21",
"2017-07-20",
"2017-07-19",
"2017-07-18",
"2017-07-17",
"2017-07-16",
"2017-07-15",
"2017-07-14",
"2017-07-13",
"2017-07-12",
"2017-07-11",
"2017-07-10",
"2017-07-09",
"2017-07-08",
"2017-07-07",
"2017-07-06",
"2017-07-05",
"2017-07-04",
"2017-07-03",
"2017-07-02",
"2017-07-01",
"2017-06-30",
"2017-06-29",
"2017-06-28",
"2017-06-27",
"2017-06-26",
"2017-06-25",
"2017-06-24",
"2017-06-23",
"2017-06-22",
"2017-06-21",
"2017-06-20",
"2017-06-19",
"2017-06-18",
"2017-06-17",
"2017-06-16",
"2017-06-15",
"2017-06-14",
"2017-06-13",
"2017-06-12",
"2017-06-11",
"2017-06-10",
"2017-06-09",
"2017-06-08",
"2017-06-07",
"2017-06-06",
"2017-06-05",
"2017-06-04",
"2017-06-03",
"2017-06-02",
"2017-06-01",
"2017-05-31",
"2017-05-30",
"2017-05-29",
"2017-05-28",
"2017-05-27",
"2017-05-26",
"2017-05-25",
"2017-05-24",
"2017-05-23",
"2017-05-22",
"2017-05-21",
"2017-05-20",
"2017-05-19",
"2017-05-18",
"2017-05-17",
"2017-05-16",
"2017-05-15",
"2017-05-14",
"2017-05-13",
"2017-05-12",
"2017-05-11",
"2017-05-10",
"2017-05-09",
"2017-05-08",
"2017-05-07",
"2017-05-06",
"2017-05-05",
"2017-05-04",
"2017-05-03",
"2017-05-02",
"2017-05-01",
"2017-04-30",
"2017-04-29",
"2017-04-28",
"2017-04-27",
"2017-04-26",
"2017-04-25",
"2017-04-24",
"2017-04-23",
"2017-04-22",
"2017-04-21",
"2017-04-20",
"2017-04-19",
"2017-04-18",
"2017-04-17",
"2017-04-16",
"2017-04-15",
"2017-04-14",
"2017-04-13",
"2017-04-12",
"2017-04-11",
"2017-04-10",
"2017-04-09",
"2017-04-08",
"2017-04-07",
"2017-04-06",
"2017-04-05",
"2017-04-04",
"2017-04-03",
"2017-04-02",
"2017-04-01",
"2017-03-31",
"2017-03-30",
"2017-03-29",
"2017-03-28",
"2017-03-27",
"2017-03-26",
"2017-03-25",
"2017-03-24",
"2017-03-23",
"2017-03-22",
"2017-03-21",
"2017-03-20",
"2017-03-19",
"2017-03-18",
"2017-03-17",
"2017-03-16",
"2017-03-15",
"2017-03-14",
"2017-03-13",
"2017-03-12",
"2017-03-11",
"2017-03-10",
"2017-03-09",
"2017-03-08",
"2017-03-07",
"2017-03-06",
"2017-03-05",
"2017-03-04",
"2017-03-03",
"2017-03-02",
"2017-03-01",
"2017-02-28",
"2017-02-27",
"2017-02-26",
"2017-02-25",
"2017-02-24",
"2017-02-23",
"2017-02-22",
"2017-02-21",
"2017-02-20",
"2017-02-19",
"2017-02-18",
"2017-02-17",
"2017-02-16",
"2017-02-15",
"2017-02-14",
"2017-02-13",
"2017-02-12",
"2017-02-11",
"2017-02-10",
"2017-02-09",
"2017-02-08",
"2017-02-07",
"2017-02-06",
"2017-02-05",
"2017-02-04",
"2017-02-03",
"2017-02-02",
"2017-02-01",
"2017-01-31",
"2017-01-30",
"2017-01-29",
"2017-01-28",
"2017-01-27",
"2017-01-26",
"2017-01-25",
"2017-01-24",
"2017-01-23",
"2017-01-22",
"2017-01-21",
"2017-01-20",
"2017-01-19",
"2017-01-18",
"2017-01-17",
"2017-01-16",
"2017-01-15",
"2017-01-14",
"2017-01-13",
"2017-01-12",
"2017-01-11",
"2017-01-10",
"2017-01-09",
"2017-01-08",
"2017-01-07",
"2017-01-06",
"2017-01-05",
"2017-01-04",
"2017-01-03",
"2017-01-02",
"2017-01-01",
"2016-12-31",
"2016-12-30",
"2016-12-29",
"2016-12-28",
"2016-12-27",
"2016-12-26",
"2016-12-25",
"2016-12-24",
"2016-12-23",
"2016-12-22",
"2016-12-21",
"2016-12-20",
"2016-12-19",
"2016-12-18",
"2016-12-17",
"2016-12-16",
"2016-12-15",
"2016-12-14",
"2016-12-13",
"2016-12-12",
"2016-12-11",
"2016-12-10",
"2016-12-09",
"2016-12-08",
"2016-12-07",
"2016-12-06",
"2016-12-05",
"2016-12-04",
"2016-12-03",
"2016-12-02",
"2016-12-01",
"2016-11-30",
"2016-11-29",
"2016-11-28",
"2016-11-27",
"2016-11-26",
"2016-11-25",
"2016-11-24",
"2016-11-23",
"2016-11-22",
"2016-11-21",
"2016-11-20",
"2016-11-19",
"2016-11-18",
"2016-11-17",
"2016-11-16",
"2016-11-15",
"2016-11-14",
"2016-11-13",
"2016-11-12",
"2016-11-11",
"2016-11-10",
"2016-11-09",
"2016-11-08",
"2016-11-07",
"2016-11-06",
"2016-11-05",
"2016-11-04",
"2016-11-03",
"2016-11-02",
"2016-11-01",
"2016-10-31",
"2016-10-30",
"2016-10-29",
"2016-10-28",
"2016-10-27",
"2016-10-26",
"2016-10-25",
"2016-10-24",
"2016-10-23",
"2016-10-22",
"2016-10-21",
"2016-10-20",
"2016-10-19",
"2016-10-18",
"2016-10-17",
"2016-10-16",
"2016-10-15",
"2016-10-14",
"2016-10-13",
"2016-10-12",
"2016-10-11",
"2016-10-10",
"2016-10-09",
"2016-10-08",
"2016-10-07",
"2016-10-06",
"2016-10-05",
"2016-10-04",
"2016-10-03",
"2016-10-02",
"2016-10-01",
"2016-09-30",
"2016-09-29",
"2016-09-28",
"2016-09-27",
"2016-09-26",
"2016-09-25",
"2016-09-24",
"2016-09-23",
"2016-09-22",
"2016-09-21",
"2016-09-20",
"2016-09-19",
"2016-09-18",
"2016-09-17",
"2016-09-16",
"2016-09-15",
"2016-09-14",
"2016-09-13",
"2016-09-12",
"2016-09-11",
"2016-09-10",
"2016-09-09",
"2016-09-08",
"2016-09-07",
"2016-09-06",
"2016-09-05",
"2016-09-04",
"2016-09-03",
"2016-09-02",
"2016-09-01",
"2016-08-31",
"2016-08-30",
"2016-08-29",
"2016-08-28",
"2016-08-27",
"2016-08-26",
"2016-08-25",
"2016-08-24",
"2016-08-23",
"2016-08-22",
"2016-08-21",
"2016-08-20",
"2016-08-19",
"2016-08-18",
"2016-08-17",
"2016-08-16",
"2016-08-15",
"2016-08-14",
"2016-08-13",
"2016-08-12",
"2016-08-11",
"2016-08-10",
"2016-08-09",
"2016-08-08",
"2016-08-07",
"2016-08-06",
"2016-08-05",
"2016-08-04",
"2016-08-03",
"2016-08-02",
"2016-08-01",
"2016-07-31",
"2016-07-30",
"2016-07-29",
"2016-07-28",
"2016-07-27",
"2016-07-26",
"2016-07-25",
"2016-07-24",
"2016-07-23",
"2016-07-22",
"2016-07-21",
"2016-07-20",
"2016-07-19",
"2016-07-18",
"2016-07-17",
"2016-07-16",
"2016-07-15",
"2016-07-14",
"2016-07-13",
"2016-07-12",
"2016-07-11",
"2016-07-10",
"2016-07-09",
"2016-07-08",
"2016-07-07",
"2016-07-06",
"2016-07-05",
"2016-07-04",
"2016-07-03",
"2016-07-02",
"2016-07-01",
"2016-06-30",
"2016-06-29",
"2016-06-28",
"2016-06-27",
"2016-06-26",
"2016-06-25",
"2016-06-24",
"2016-06-23",
"2016-06-22",
"2016-06-21",
"2016-06-20",
"2016-06-19",
"2016-06-18",
"2016-06-17",
"2016-06-16",
"2016-06-15",
"2016-06-14",
"2016-06-13",
"2016-06-12",
"2016-06-11",
"2016-06-10",
"2016-06-09",
"2016-06-08",
"2016-06-07",
"2016-06-06",
"2016-06-05",
"2016-06-04",
"2016-06-03",
"2016-06-02",
"2016-06-01",
"2016-05-31",
"2016-05-30",
"2016-05-29",
"2016-05-28",
"2016-05-27",
"2016-05-26",
"2016-05-25",
"2016-05-24",
"2016-05-23",
"2016-05-22",
"2016-05-21",
"2016-05-20",
"2016-05-19",
"2016-05-18",
"2016-05-17",
"2016-05-16",
"2016-05-15",
"2016-05-14",
"2016-05-13",
"2016-05-12",
"2016-05-11",
"2016-05-10",
"2016-05-09",
"2016-05-08",
"2016-05-07",
"2016-05-06",
"2016-05-05",
"2016-05-04",
"2016-05-03",
"2016-05-02",
"2016-05-01",
"2016-04-30",
"2016-04-29",
"2016-04-28",
"2016-04-27",
"2016-04-26",
"2016-04-25",
"2016-04-24",
"2016-04-23",
"2016-04-22",
"2016-04-21",
"2016-04-20",
"2016-04-19",
"2016-04-18",
"2016-04-17",
"2016-04-16",
"2016-04-15",
"2016-04-14",
"2016-04-13",
"2016-04-12",
"2016-04-11",
"2016-04-10",
"2016-04-09",
"2016-04-08",
"2016-04-07",
"2016-04-06",
"2016-04-05",
"2016-04-04",
"2016-04-03",
"2016-04-02",
"2016-04-01",
"2016-03-31",
"2016-03-30",
"2016-03-29",
"2016-03-28",
"2016-03-27",
"2016-03-26",
"2016-03-25",
"2016-03-24",
"2016-03-23",
"2016-03-22",
"2016-03-21",
"2016-03-20",
"2016-03-19",
"2016-03-18",
"2016-03-17",
"2016-03-16",
"2016-03-15",
"2016-03-14",
"2016-03-13",
"2016-03-12",
"2016-03-11",
"2016-03-10",
"2016-03-09",
"2016-03-08",
"2016-03-07",
"2016-03-06",
"2016-03-05",
"2016-03-04",
"2016-03-03",
"2016-03-02",
"2016-03-01",
"2016-02-29",
"2016-02-28",
"2016-02-27",
"2016-02-26",
"2016-02-25",
"2016-02-24",
"2016-02-23",
"2016-02-22",
"2016-02-21",
"2016-02-20",
"2016-02-19",
"2016-02-18",
"2016-02-17",
"2016-02-16",
"2016-02-15",
"2016-02-14",
"2016-02-13",
"2016-02-12",
"2016-02-11",
"2016-02-10",
"2016-02-09",
"2016-02-08",
"2016-02-07",
"2016-02-06",
"2016-02-05",
"2016-02-04",
"2016-02-03",
"2016-02-02",
"2016-02-01",
"2016-01-31",
"2016-01-30",
"2016-01-29",
"2016-01-28",
"2016-01-27",
"2016-01-26",
"2016-01-25",
"2016-01-24",
"2016-01-23",
"2016-01-22",
"2016-01-21",
"2016-01-20",
"2016-01-19",
"2016-01-18",
"2016-01-17",
"2016-01-16",
"2016-01-15",
"2016-01-14",
"2016-01-13",
"2016-01-12",
"2016-01-11",
"2016-01-10",
"2016-01-09",
"2016-01-08",
"2016-01-07",
"2016-01-06",
"2016-01-05",
"2016-01-04",
"2016-01-03",
"2016-01-02",
"2016-01-01",
"2015-12-31",
"2015-12-30",
"2015-12-29",
"2015-12-28",
"2015-12-27",
"2015-12-26",
"2015-12-25",
"2015-12-24",
"2015-12-23",
"2015-12-22",
"2015-12-21",
"2015-12-20",
"2015-12-19",
"2015-12-18",
"2015-12-17",
"2015-12-16",
"2015-12-15",
"2015-12-14",
"2015-12-13",
"2015-12-12",
"2015-12-11",
"2015-12-10",
"2015-12-09",
"2015-12-08",
"2015-12-07",
"2015-12-06",
"2015-12-05",
"2015-12-04",
"2015-12-03",
"2015-12-02",
"2015-12-01",
"2015-11-30",
"2015-11-29",
"2015-11-28",
"2015-11-27",
"2015-11-26",
"2015-11-25",
"2015-11-24",
"2015-11-23",
"2015-11-22",
"2015-11-21",
"2015-11-20",
"2015-11-19",
"2015-11-18",
"2015-11-17",
"2015-11-16",
"2015-11-15",
"2015-11-14",
"2015-11-13",
"2015-11-12",
"2015-11-11",
"2015-11-10",
"2015-11-09",
"2015-11-08",
"2015-11-07",
"2015-11-06",
"2015-11-05",
"2015-11-04",
"2015-11-03",
"2015-11-02",
"2015-11-01",
"2015-10-31",
"2015-10-30",
"2015-10-29",
"2015-10-28",
"2015-10-27",
"2015-10-26",
"2015-10-25",
"2015-10-24",
"2015-10-23",
"2015-10-22",
"2015-10-21",
"2015-10-20",
"2015-10-19",
"2015-10-18",
"2015-10-17",
"2015-10-16",
"2015-10-15",
"2015-10-14",
"2015-10-13",
"2015-10-12",
"2015-10-11",
"2015-10-10",
"2015-10-09",
"2015-10-08",
"2015-10-07",
"2015-10-06",
"2015-10-05",
"2015-10-04",
"2015-10-03",
"2015-10-02",
"2015-10-01",
"2015-09-30",
"2015-09-29",
"2015-09-28",
"2015-09-27",
"2015-09-26",
"2015-09-25",
"2015-09-24",
"2015-09-23",
"2015-09-22",
"2015-09-21",
"2015-09-20",
"2015-09-19",
"2015-09-18",
"2015-09-17",
"2015-09-16",
"2015-09-15",
"2015-09-14",
"2015-09-13",
"2015-09-12",
"2015-09-11",
"2015-09-10",
"2015-09-09",
"2015-09-08",
"2015-09-07",
"2015-09-06",
"2015-09-05",
"2015-09-04",
"2015-09-03",
"2015-09-02",
"2015-09-01",
"2015-08-31",
"2015-08-30",
"2015-08-29",
"2015-08-28",
"2015-08-27",
"2015-08-26",
"2015-08-25",
"2015-08-24",
"2015-08-23",
"2015-08-22",
"2015-08-21",
"2015-08-20",
"2015-08-19",
"2015-08-18",
"2015-08-17",
"2015-08-16",
"2015-08-15",
"2015-08-14",
"2015-08-13",
"2015-08-12",
"2015-08-11",
"2015-08-10",
"2015-08-09",
"2015-08-08",
"2015-08-07",
"2015-08-06",
"2015-08-05",
"2015-08-04",
"2015-08-03",
"2015-08-02",
"2015-08-01",
"2015-07-31",
"2015-07-30",
"2015-07-29",
"2015-07-28",
"2015-07-27",
"2015-07-26",
"2015-07-25",
"2015-07-24",
"2015-07-23",
"2015-07-22",
"2015-07-21",
"2015-07-20",
"2015-07-19",
"2015-07-18",
"2015-07-17",
"2015-07-16",
"2015-07-15",
"2015-07-14",
"2015-07-13",
"2015-07-12",
"2015-07-11",
"2015-07-10",
"2015-07-09",
"2015-07-08",
"2015-07-07",
"2015-07-06",
"2015-07-05",
"2015-07-04",
"2015-07-03",
"2015-07-02",
"2015-07-01",
"2015-06-30",
"2015-06-29",
"2015-06-28",
"2015-06-27",
"2015-06-26",
"2015-06-25",
"2015-06-24",
"2015-06-23",
"2015-06-22",
"2015-06-21",
"2015-06-20",
"2015-06-19",
"2015-06-18",
"2015-06-17",
"2015-06-16",
"2015-06-15",
"2015-06-14",
"2015-06-13",
"2015-06-12",
"2015-06-11",
"2015-06-10",
"2015-06-09",
"2015-06-08",
"2015-06-07",
"2015-06-06",
"2015-06-05",
"2015-06-04",
"2015-06-03",
"2015-06-02",
"2015-06-01",
"2015-05-31",
"2015-05-30",
"2015-05-29",
"2015-05-28",
"2015-05-27",
"2015-05-26",
"2015-05-25",
"2015-05-24",
"2015-05-23",
"2015-05-22",
"2015-05-21",
"2015-05-20",
"2015-05-19",
"2015-05-18",
"2015-05-17",
"2015-05-16",
"2015-05-15",
"2015-05-14",
"2015-05-13",
"2015-05-12",
"2015-05-11",
"2015-05-10",
"2015-05-09",
"2015-05-08",
"2015-05-07",
"2015-05-06",
"2015-05-05",
"2015-05-04",
"2015-05-03",
"2015-05-02",
"2015-05-01",
"2015-04-30",
"2015-04-29",
"2015-04-28",
"2015-04-27",
"2015-04-26",
"2015-04-25",
"2015-04-24",
"2015-04-23",
"2015-04-22",
"2015-04-21",
"2015-04-20",
"2015-04-19",
"2015-04-18",
"2015-04-17",
"2015-04-16",
"2015-04-15",
"2015-04-14",
"2015-04-13",
"2015-04-12",
"2015-04-11",
"2015-04-10",
"2015-04-09",
"2015-04-08",
"2015-04-07",
"2015-04-06",
"2015-04-05",
"2015-04-04",
"2015-04-03",
"2015-04-02",
"2015-04-01",
"2015-03-31",
"2015-03-30",
"2015-03-29",
"2015-03-28",
"2015-03-27",
"2015-03-26",
"2015-03-25",
"2015-03-24",
"2015-03-23",
"2015-03-22",
"2015-03-21",
"2015-03-20",
"2015-03-19",
"2015-03-18",
"2015-03-17",
"2015-03-16",
"2015-03-15",
"2015-03-14",
"2015-03-13",
"2015-03-12",
"2015-03-11",
"2015-03-10",
"2015-03-09",
"2015-03-08",
"2015-03-07",
"2015-03-06",
"2015-03-05",
"2015-03-04",
"2015-03-03",
"2015-03-02",
"2015-03-01",
"2015-02-28",
"2015-02-27",
"2015-02-26",
"2015-02-25",
"2015-02-24",
"2015-02-23",
"2015-02-22",
"2015-02-21",
"2015-02-20",
"2015-02-19",
"2015-02-18",
"2015-02-17",
"2015-02-16",
"2015-02-15",
"2015-02-14",
"2015-02-13",
"2015-02-12",
"2015-02-11",
"2015-02-10",
"2015-02-09",
"2015-02-08",
"2015-02-07",
"2015-02-06",
"2015-02-05",
"2015-02-04",
"2015-02-03",
"2015-02-02",
"2015-02-01",
"2015-01-31",
"2015-01-30",
"2015-01-29",
"2015-01-28",
"2015-01-27",
"2015-01-26",
"2015-01-25",
"2015-01-24",
"2015-01-23",
"2015-01-22",
"2015-01-21",
"2015-01-20",
"2015-01-19",
"2015-01-17",
"2015-01-16",
"2015-01-15",
"2015-01-14",
"2015-01-13",
"2015-01-08",
"2014-12-18",
"2014-12-12",
"2014-12-10",
"2014-12-08",
"2014-12-06",
"2014-12-04",
"2014-12-03",
"2014-12-02",
"2014-12-01"
],
"y": [
-0.09923446019740889,
-0.11162257469402204,
-0.09929180783829594,
-0.1043250873911481,
-0.16497738608428758,
-0.17746585895245304,
-0.2040864290392067,
-0.18802601739579228,
-0.1566568578305898,
-0.19271828329836993,
-0.2039748059524802,
-0.20163891365134978,
-0.3012814637575709,
-0.31336543094447966,
-0.31888104511979243,
-0.29339411500557333,
-0.3062973342051539,
-0.33445912214074636,
-0.3173736214164763,
-0.3167765915122418,
-0.25193074657923875,
-0.290833952465974,
-0.3142850413287037,
-0.30276533396552274,
-0.3110080332780166,
-0.2872517730405667,
-0.19890261192902603,
-0.21417244538021218,
-0.17818782478862005,
-0.14665071856082001,
-0.1386240969666681,
-0.09809569989979505,
-0.11980690230061308,
-0.10170962534069361,
-0.10087091609272081,
-0.14205881102979467,
-0.17337471921417336,
-0.20685959710210067,
-0.16487497958270358,
-0.1664121011714791,
-0.17183554949536617,
-0.07573933653899811,
-0.07834148574424682,
-0.035957482868672286,
-0.11157853989834088,
-0.06451660803041048,
-0.05940652360137033,
0.003583715522931241,
0.08346078675842983,
0.15284528784163465,
0.16230355232793037,
0.15847354916868972,
0.11418273723362171,
0.10352426854876184,
0.04324268139135623,
0.06979668725208032,
0.0424981861248408,
-0.029392202052123784,
-0.02011110081356826,
0.026624154314309312,
-0.0056328696196263905,
0.058296437124200295,
0.13830663681175803,
0.1285196474553778,
0.05069480251162206,
0.12662512717607433,
0.028928300599948553,
0.014974390694116435,
-0.04219403881513617,
-0.13978436262961447,
-0.10370962431662845,
-0.185562116967682,
-0.13697023196608693,
-0.12432098089043464,
-0.1707019095228316,
-0.2364827258152965,
-0.2249404890217669,
-0.30515242951744515,
-0.17584169183733123,
-0.06605270555417009,
-0.112389599390886,
-0.08917302141678363,
0.022015861743030385,
0.011264203141729157,
0.126779760993466,
0.16907262208263085,
0.14685041123890885,
0.12308083815625293,
0.12626670442053034,
0.1507203529337673,
0.09625545506633149,
0.09029130041408084,
0.16724671415938874,
0.2947049182258483,
0.165282557459008,
0.14547099566257282,
0.1346650616154319,
0.17255546720150194,
0.37941557633611045,
0.38619795893601694,
0.44064954395824696,
0.4029690717004242,
0.3505430872795252,
0.5110263640418005,
0.47065874518241424,
0.5231676788695963,
0.6440565058594441,
0.7387589663292546,
0.7245265107391137,
0.538656662234172,
0.5338589176349628,
0.5014339470384297,
0.36815188522688946,
0.4073858641137409,
0.3026096760831152,
0.47926703570556284,
0.46748619176334283,
0.5614001221709566,
0.604799997542244,
0.43901411212795094,
0.44413034094708626,
0.5315803729747195,
0.4429659790240763,
0.6015147969714303,
0.6771000117255446,
0.8145131518109823,
0.9374296275321927,
0.972245789940712,
0.9999999999999998,
0.8042663572624897,
0.7029975919111153,
0.6968357927108078,
0.803390781673947,
0.7169228279965039,
0.5535076530938798,
0.5555527109305116,
0.6638015034298499,
0.7685613064202219,
0.43061882712809685,
0.1877464476464683,
0.18013047612366817,
0.14388062269297364,
0.10703885968312377,
0.10085350698745166,
0.0018428049960037551,
0.005220171418243158,
0.006553504068866456,
-0.011909364101708064,
-0.049553994083976205,
-0.11157239550824594,
-0.1710183456127261,
-0.18984578092893956,
-0.16743514212230293,
-0.18187445884564313,
-0.16681967904778328,
-0.18977819263789408,
-0.2158723933065061,
-0.22225231835518766,
-0.20957234532906022,
-0.2653357576365807,
-0.33589383722793786,
-0.3429731986824378,
-0.4094882695912596,
-0.36234543658707796,
-0.338697727241307,
-0.2794678548551689,
-0.24752112262103287,
-0.2824755338066902,
-0.298540041710168,
-0.2552999204813514,
-0.2531954668738008,
-0.2780331397679775,
-0.29134905716894144,
-0.31759481945989776,
-0.35227785341635753,
-0.3851349794495752,
-0.3835118363994692,
-0.4232455590140506,
-0.42037920103471516,
-0.40894961139292807,
-0.4244785332931216,
-0.44644882414294706,
-0.40747700590015046,
-0.39733261785324214,
-0.3953039450568637,
-0.3989660015535065,
-0.4281610710900813,
-0.4414298815003166,
-0.43942681032933406,
-0.4229496042244729,
-0.42921688212141207,
-0.4163720346277343,
-0.4362726900805477,
-0.4551974115732659,
-0.5192024991282645,
-0.5258578976662069,
-0.5238558505602402,
-0.5408614742132748,
-0.5591400106809981,
-0.5654902378442201,
-0.5698885970872518,
-0.5806617610538857,
-0.5711225954313386,
-0.5624467166171445,
-0.5622316629638181,
-0.5679469698172197,
-0.5865859771705185,
-0.5832649343241503,
-0.5821814735373918,
-0.6144303049512005,
-0.6108778234112526,
-0.6365583018134654,
-0.6244415645460498,
-0.641678626892664,
-0.6418363329051033,
-0.6157646616668397,
-0.6118680942815696,
-0.5924221236957892,
-0.6313396664927462,
-0.630669927972387,
-0.6292864161359876,
-0.6794266874415322,
-0.6174789465033554,
-0.5858148562135912,
-0.5810836758404117,
-0.576921875616039,
-0.5684221359845694,
-0.566820498299796,
-0.5387426836955023,
-0.5395619357081741,
-0.5583709378541024,
-0.551638734439972,
-0.5385511835375403,
-0.53609957188962,
-0.5055824344175962,
-0.5264784810658059,
-0.543064238062346,
-0.5413212794053868,
-0.5632372948093728,
-0.5678332986004615,
-0.567402167228793,
-0.5657964332839562,
-0.5707088731649395,
-0.5879684649419021,
-0.5932413757084609,
-0.6024579608510184,
-0.5974410663384195,
-0.5865429664398533,
-0.5922459845130646,
-0.5739879293456582,
-0.5647713442031006,
-0.5862849020558616,
-0.5698312494463647,
-0.5964702527034036,
-0.6155659930537669,
-0.6378752494238353,
-0.6595004303633227,
-0.6699643266951731,
-0.6618096969740415,
-0.6642879343123735,
-0.6823125026561685,
-0.6801343163674775,
-0.7196785869541285,
-0.7268798121455133,
-0.7358014665635091,
-0.7324537980267289,
-0.7197256939448571,
-0.7333344939403512,
-0.735769720548018,
-0.7269770983220182,
-0.7393764775338056,
-0.7536109812539777,
-0.7497185101287709,
-0.7294153971247326,
-0.7302326010073726,
-0.7229627634599265,
-0.7401486225557488,
-0.7180257460185631,
-0.7809535171768984,
-0.7759192135590303,
-0.783390791914597,
-0.8165100785918695,
-0.8111306650636635,
-0.7852289886180293,
-0.7726575664835809,
-0.7682110761848047,
-0.7757287374660842,
-0.7735741046727573,
-0.7553518917809053,
-0.7500144649183487,
-0.7561547587533236,
-0.7455362286040815,
-0.7442950618048838,
-0.7458270630685799,
-0.751929466497969,
-0.7545664339137562,
-0.7640933107561132,
-0.760861361566123,
-0.7532003311826261,
-0.7508326928660045,
-0.7485152337351593,
-0.7657031409610132,
-0.7556980257562591,
-0.7486084236516006,
-0.7367374619879865,
-0.7378403800100459,
-0.7415925542280828,
-0.7332228708536246,
-0.7463411437065315,
-0.7547108270809897,
-0.7424537929064039,
-0.7582766214661436,
-0.7654911595027344,
-0.7632146629725227,
-0.7348685433340791,
-0.7403268098685049,
-0.7051737300697746,
-0.7121199630722155,
-0.724384165701912,
-0.7255782255103811,
-0.7372617832760966,
-0.718250016257032,
-0.7359960389165187,
-0.7540851233563115,
-0.7513518938290353,
-0.7584240868284244,
-0.7644660704218789,
-0.7764169091567285,
-0.7878567394486741,
-0.7788552079594429,
-0.7836375915834144,
-0.7972361509287501,
-0.7795495240401822,
-0.7711214689598213,
-0.7631368340313189,
-0.7795444037151029,
-0.7948500794418435,
-0.801638606431845,
-0.8014430100138197,
-0.8099099795647825,
-0.8178024486418592,
-0.8266022393229701,
-0.830263271754597,
-0.8333016726565935,
-0.8279581014039419,
-0.8287015726054414,
-0.8386472920392769,
-0.8240727987338459,
-0.8284701339118616,
-0.8361055626699627,
-0.8368664429767316,
-0.8474583474355619,
-0.8499345366438623,
-0.85342557428286,
-0.8521874796787098,
-0.8552996132618467,
-0.8615474339234849,
-0.8651818406647,
-0.8705018584219875,
-0.8724598707322729,
-0.8736979653364232,
-0.8741157838628858,
-0.8793200822733833,
-0.8810896666207544,
-0.8835341098135637,
-0.8840778883369746,
-0.8845878727148628,
-0.8842816772751267,
-0.885698983257049,
-0.8879457819018013,
-0.8892023096762366,
-0.8904342598902918,
-0.8916549453891728,
-0.8915668757978106,
-0.8920901730209047,
-0.8917512075006617,
-0.8879498781618647,
-0.88694424631631,
-0.8883769132734698,
-0.8882775789669334,
-0.8909882790638611,
-0.8900154172988134,
-0.8901895083515061,
-0.8962632379604516,
-0.8951367664430279,
-0.8942550464643898,
-0.8982089614905471,
-0.9004608804603785,
-0.9007691240301463,
-0.9055463873290387,
-0.9054511492825655,
-0.9052330234341917,
-0.9055730130194505,
-0.9126390616287445,
-0.9135975864835706,
-0.9165520140542682,
-0.9073077791562829,
-0.9063420858463461,
-0.8981649266948659,
-0.9052780822948886,
-0.9078863758902325,
-0.9129544736536233,
-0.902757858290907,
-0.8919498761137347,
-0.8829493686895192,
-0.8845448619841976,
-0.8847425065322546,
-0.8857573549629518,
-0.8906185915931429,
-0.8987189458684353,
-0.8896774758435863,
-0.8944987739381597,
-0.8855750713901324,
-0.8806974497196878,
-0.8813129127942074,
-0.8818259693671431,
-0.8798915105522218,
-0.8823175205747462,
-0.8863287832417903,
-0.8899048182771027,
-0.8898300615309463,
-0.8909462923982117,
-0.8937020513558364,
-0.8907414793950438,
-0.8907425034600596,
-0.8967015377872309,
-0.8967445485178962,
-0.9006841266338317,
-0.9037501772912557,
-0.9035177145326602,
-0.9040143860653425,
-0.9058945694344241,
-0.908394312138089,
-0.9084567801040552,
-0.9095934922716372,
-0.9088582135902643,
-0.907972397351563,
-0.909678489667952,
-0.9104721400552277,
-0.9040758299662928,
-0.9043564237806329,
-0.907569939800338,
-0.9082110045002536,
-0.9062427515398097,
-0.9080389615775926,
-0.9090241121228304,
-0.9106247257425879,
-0.9129534495886074,
-0.9177440257327056,
-0.9184291252283024,
-0.9175648143549336,
-0.9178054696336561,
-0.9183799701075421,
-0.9205325547708372,
-0.9214542132850929,
-0.9190271791975528,
-0.9169257977850497,
-0.917556621834807,
-0.9207056217585141,
-0.9198239017798762,
-0.9213528308485248,
-0.9195084897549974,
-0.9268397712033941,
-0.9269524183551364,
-0.9274961968785473,
-0.9271459666431301,
-0.9291090992784949,
-0.9307967584245987,
-0.9194060832534134,
-0.919850527470288,
-0.9177337850825472,
-0.9192012702502456,
-0.9205622526562965,
-0.9091654330950163,
-0.8965387114497124,
-0.9077655362183633,
-0.9087097241629676,
-0.9106042444422711,
-0.9126093637432853,
-0.9138955894031799,
-0.9128807409724827,
-0.9117081865293463,
-0.9175422849245852,
-0.9199088991761908,
-0.9205202659906471,
-0.920993384027965,
-0.9183553925471619,
-0.9246267667041644,
-0.9268305546182515,
-0.9304670094894983,
-0.9313046946724552,
-0.9313139112575979,
-0.9315340852360033,
-0.9323113505830257,
-0.9328049499206604,
-0.9326513401682845,
-0.9328029017906287,
-0.932520259846257,
-0.9333282471437546,
-0.9328346478061198,
-0.9331060250353174,
-0.93365185168876,
-0.934015394769383,
-0.9344803202865742,
-0.9352790909989293,
-0.9336416110386015,
-0.9337450416052013,
-0.9335125788466058,
-0.9350742779957613,
-0.936232495528676,
-0.9372893306250226,
-0.9375555875291409,
-0.9376098629749805,
-0.936948316974748,
-0.9365345947083488,
-0.9367138060861206,
-0.9363523111355293,
-0.9358259417173876,
-0.9368766324236393,
-0.9373282450956245,
-0.9354050509958776,
-0.9356334174944098,
-0.937459325417652,
-0.9365233299931746,
-0.9393456531768288,
-0.9397522069881171,
-0.940193579009944,
-0.9401403276291205,
-0.9388735592045266,
-0.9392821611458467,
-0.9384567647430799,
-0.9394623965886345,
-0.9399467793411267,
-0.9388612704243366,
-0.9398884076352239,
-0.9399570199912851,
-0.9416282940971356,
-0.9360368991106507,
-0.9374603494826679,
-0.9409216892362061,
-0.9408694619203983,
-0.9391418642386767,
-0.9416334144222147,
-0.9415043822302189,
-0.9432667981224792,
-0.9452842062036834,
-0.9457266022905262,
-0.9456180513988471,
-0.9454429362811385,
-0.9476876867958592,
-0.9479723768702627,
-0.9477941895575065,
-0.9472493869690798,
-0.9467936780370312,
-0.946551998693293,
-0.9469370471392486,
-0.9469503599844546,
-0.9471930633932086,
-0.9471797505480027,
-0.9465315173929761,
-0.9489278295300411,
-0.9490609579821003,
-0.9488479524588056,
-0.9490036103412133,
-0.9496282900008755,
-0.949497209678848,
-0.9497859960133148,
-0.9495146187841172,
-0.9495750386200519,
-0.9492422174899039,
-0.9499242447904531,
-0.9502314642952051,
-0.9503287504717098,
-0.9502601381156486,
-0.9501198412084786,
-0.9506738603820478,
-0.950468023313864,
-0.9505417559950046,
-0.9512329998806963,
-0.951152098744445,
-0.9502714028308228,
-0.9499641833260709,
-0.9496774451216358,
-0.9500338197471481,
-0.9500327956821322,
-0.9502877878710763,
-0.9499815924313402,
-0.9499611111310234,
-0.9501546594190171,
-0.9500317716171164,
-0.9484137488920896,
-0.9485847677497348,
-0.9479805693903893,
-0.9492872763506008,
-0.9495146187841172,
-0.9502621862456803,
-0.9496241937408121,
-0.9507516893232517,
-0.9532811299123758,
-0.9536078066524286,
-0.9536211194976346,
-0.9534101621043716,
-0.9535883494171277,
-0.9533630551136429,
-0.9538310528258818,
-0.9529657178874972,
-0.9533456460083737,
-0.953049691218796,
-0.9526482577325869,
-0.9523604954631358,
-0.9527609048843292,
-0.9527015091134106,
-0.953541242426399,
-0.9534982316957338,
-0.9534613653551636,
-0.9529933676429249,
-0.9541433926557128,
-0.9534060658443082,
-0.952232487336156,
-0.9521003829491126,
-0.9520829738438433,
-0.951363056137708,
-0.952232487336156,
-0.9517173826331885,
-0.9513425748373912,
-0.9516938291378242,
-0.9525857897666206,
-0.9521249605094927,
-0.9535729884418901,
-0.9572483577837388,
-0.9503123654314565,
-0.9480829758919733,
-0.9451234279961965,
-0.9450077086494066,
-0.9449667460487731,
-0.9449718663738522,
-0.9453087837640636,
-0.9449268075131553,
-0.9445980826430708,
-0.9449565053986146,
-0.9452463157980973,
-0.9439549698131234,
-0.9439918361536936,
-0.9432688462525107,
-0.9431131883701032,
-0.9426523591129753,
-0.9440532800546441,
-0.9439344885128066,
-0.9445315184170412,
-0.945177703442036,
-0.9440287024942638,
-0.945625219853958,
-0.9454746822966296,
-0.9449452406834404,
-0.9439498494880442,
-0.9465468783682137,
-0.9427762709798919,
-0.9436897369740209,
-0.942449594239839,
-0.9443369460640316,
-0.9400973168984552,
-0.9428377148808422,
-0.9433190254382869,
-0.9468080149472529,
-0.9458853323679813,
-0.9449186149930286,
-0.9468960845386151,
-0.9432964960079384,
-0.9436784722588467,
-0.9476600370404316,
-0.9503840499825652,
-0.9439160553425215,
-0.9402847207963538,
-0.9335627580323819,
-0.9345632695528573,
-0.9352524653085175,
-0.9334603515307979,
-0.9407291650132282,
-0.9421454469301346,
-0.9399887660067762,
-0.942871509026365,
-0.9498720174746453,
-0.9528612632558815,
-0.9531531217853958,
-0.9525642844012879,
-0.9529227071568319,
-0.952199717255649,
-0.9533876326740232,
-0.9532708892622174,
-0.9537890661602323,
-0.9572073951831053,
-0.9575176868829047,
-0.9578761096384486,
-0.957752197771532,
-0.9585028374281426,
-0.958704578236263,
-0.9640276681885979,
-0.9656968941644166,
-0.9660532687899288,
-0.9665140980470567,
-0.9666492746291475,
-0.9669759513692004,
-0.9665868066631813,
-0.9666513227591792,
-0.9673958180256947,
-0.9656364743284821,
-0.9657767712356521,
-0.9656262336783237,
-0.9650312519041208,
-0.9652944366131916,
-0.9653886505946488,
-0.9655422603470248,
-0.965758338065367,
-0.9659211644028856,
-0.9647557784148599,
-0.9648960753220299,
-0.9649861930434238,
-0.9649452304427902,
-0.9662079026073207,
-0.9663410310593799,
-0.9659795361087884,
-0.9665724697529596,
-0.9654910570962328,
-0.9657941803409213,
-0.9653026291333183,
-0.9660338115546279,
-0.9666861409697178,
-0.964097304609675,
-0.9645499413466762,
-0.9647250564643848,
-0.9656231614832762,
-0.9663686808148075,
-0.965975439848725,
-0.9669267962484401,
-0.9675309946077856,
-0.968154650202432,
-0.9681515780073845,
-0.9679068264685987,
-0.9681587464624953,
-0.9686308404347974,
-0.9687066212459696,
-0.9684792788124531,
-0.9688745679085673,
-0.9689298674194227,
-0.9693333490356635,
-0.9693313009056318,
-0.969074260586656,
-0.9691285360324955,
-0.9690363701810699,
-0.9693323249706477,
-0.9692616644845548,
-0.9692831698498874,
-0.969515632608483,
-0.9696846033360965,
-0.9700164004012286,
-0.9696477369955263,
-0.9689708300200562,
-0.9687352950664131,
-0.9695883412246076,
-0.9696456888654946,
-0.9700000153609751,
-0.9695309935837205,
-0.9696200872400986,
-0.97009730153748,
-0.9701720582836362,
-0.9702816332403311,
-0.9703379568162023,
-0.9694408758623266,
-0.9696805070760331,
-0.9697480953670786,
-0.9697880339026963,
-0.9700440501566563,
-0.9702427187697291,
-0.9693405174907743,
-0.9696897236611757,
-0.9700153763362127,
-0.9701812748687788,
-0.9700757961721473,
-0.9709943824913555,
-0.9717276130426967,
-0.9705734917698454,
-0.969400937326709,
-0.9692381109891904,
-0.9679385724840898,
-0.9675944866387677,
-0.9678720082580602,
-0.9679344762240264,
-0.9681669389826221,
-0.9689155305092009,
-0.9688745679085673,
-0.9692811217198557,
-0.9674808154220094,
-0.9673773848554096,
-0.967490032007152,
-0.9692043168436677,
-0.9691561857879232,
-0.9697696007324113,
-0.9705663233147345,
-0.9714337063831507,
-0.9706513207110492,
-0.9722478380707433,
-0.9731643762599199,
-0.9735555690959706,
-0.973534063730638,
-0.9741239251797618,
-0.974281631192201,
-0.9736313499071428,
-0.97384128323539,
-0.9729134803310392,
-0.9725560816405111,
-0.9745140939507967,
-0.9740983235543658,
-0.9742621739569001,
-0.974608307932254,
-0.9735320156006063,
-0.9735094861702579,
-0.9734142481237847,
-0.9718597174297401,
-0.972192538559888,
-0.9722068754701098,
-0.9710138397266564,
-0.9726062608262872,
-0.9730773307335735,
-0.97036560657163,
-0.9694275630171207,
-0.9738586923406592,
-0.9728735417954214,
-0.9735320156006063,
-0.9724833730243865,
-0.975675383678759,
-0.9682509123139209,
-0.9679703184995808,
-0.9678433344376167,
-0.966288803743572,
-0.9662068785423048,
-0.966166940006687,
-0.9657511696102561,
-0.9652770275079223,
-0.9681648908525904,
-0.967911946793678,
-0.9678597194778701,
-0.968058388090943,
-0.9677009894004149,
-0.9676743637100031,
-0.9682181422334141,
-0.9684639178372155,
-0.9678556232178067,
-0.9690793809117353,
-0.9687946908373318,
-0.9693384693607426,
-0.9656078005080385,
-0.9656180411581969,
-0.9669810716942796,
-0.9678525510227592,
-0.9675565962331816,
-0.9670025770596122,
-0.9650496850744059,
-0.964857160851428,
-0.9656426187185772,
-0.9657993006660006,
-0.9647445136996857,
-0.966819269421777,
-0.9678617676079018,
-0.9675504518430865,
-0.9659037552976163,
-0.9697204456116509,
-0.9694429239923583,
-0.9693866004164872,
-0.9718658618198351,
-0.972601140501208,
-0.9725560816405111,
-0.9750148617435422,
-0.9752411801120429,
-0.9754224396198465,
-0.9751479901956015,
-0.9736958660031407,
-0.9741689840404587,
-0.9757050815642183,
-0.9756077953877135,
-0.9761833199266154,
-0.9785990892989813,
-0.9794162931816214,
-0.9792114801784535,
-0.9791387715623289,
-0.9788018541721176,
-0.9792739481444197,
-0.9788622740080521,
-0.9779324229736697,
-0.9778300164720857,
-0.978198679877788,
-0.9792186486335643,
-0.9780123000449051,
-0.977668214199583,
-0.9778300164720857,
-0.9802150638939764,
-0.9777634522460561,
-0.9734224406439115,
-0.9740061577029402,
-0.9728817343155481,
-0.9739795320125283,
-0.9726359587117466,
-0.9703021145406479,
-0.9709063128999933,
-0.974888901746594,
-0.978549934178221,
-0.9800460931663628,
-0.9785857764537754,
-0.9799201331694146,
-0.9811479871234065,
-0.9820163942568385,
-0.9828878735853182,
-0.9831059994336919,
-0.9831756358547691,
-0.9837419438085284,
-0.9840409707931537,
-0.9847649847593524,
-0.9845222813505983,
-0.9851336481650547,
-0.9851510572703239,
-0.9843451181028581,
-0.9853118354778108,
-0.9861761463511795,
-0.9863522855339039,
-0.9865857723575153,
-0.9870568422648016,
-0.9867875131656357,
-0.9870896123453085,
-0.987265751528033,
-0.9874101446952663,
-0.9873015938035873,
-0.9870312406394056,
-0.9876139336334184,
-0.9877245326551292,
-0.9877194123300499,
-0.9878873589926477,
-0.9878812146025526,
-0.9880041024044534,
-0.9880297040298494,
-0.987712243874939,
-0.9883686695500923,
-0.9882549983333341,
-0.9881321105314333,
-0.9881956025624153,
-0.9887086591353511,
-0.9886042045037354,
-0.9890107583150238,
-0.9885058942622148,
-0.9884403541012011,
-0.9883481882497755,
-0.9883932471104725,
-0.9887629345811906,
-0.9886738409248126,
-0.9886318542591631,
-0.9886513114944641,
-0.9880696425654671,
-0.9876190539584976,
-0.9878627814322675,
-0.9878392279369032,
-0.9872872568933656,
-0.9875770672928482,
-0.9875791154228799,
-0.9881198217512432,
-0.9885929397885612,
-0.9890169027051189,
-0.9887383570208105,
-0.9889175683985824,
-0.9886584799495749,
-0.9887977527917291,
-0.9886728168597967,
-0.9885765547483077,
-0.9891653921324156,
-0.9890619615658158,
-0.9893773735906944,
-0.990664623315605,
-0.9888161859620143,
-0.9886175173489413,
-0.9884434262962486,
-0.9881659046769561,
-0.9890076861199762,
-0.9895555609034505,
-0.9859385632675046,
-0.985745014979511,
-0.9854111697843472,
-0.9850312416634707,
-0.9851848514158466,
-0.984952388657251,
-0.984435235824252,
-0.9851356962950863,
-0.984881728171158,
-0.9854562286450441,
-0.9836211041366594,
-0.9836508020221187,
-0.9833312937371766,
-0.9830506999228366,
-0.9835176735700595,
-0.9833466547124143,
-0.9834582777991409,
-0.9830834700033435,
-0.9827455285481164,
-0.9825714374954236,
-0.9820010332816009,
-0.9821597633590561,
-0.9821925334395629,
-0.9826216166811997,
-0.9826810124521185,
-0.9838822407156985,
-0.9838310374649065,
-0.9838894091708094,
-0.9836149597465643,
-0.984064524288518,
-0.9838494706351916,
-0.9835555639756456,
-0.9836784517775463,
-0.9830312426875356,
-0.9828458869196687,
-0.982275482705846,
-0.9803215666556238,
-0.9821577152290244,
-0.9829319083809992,
-0.9846646263878001,
-0.9845396904558675,
-0.9850302175984548,
-0.9846451691524991,
-0.984460837449648,
-0.98559754961723,
-0.9859754296080748,
-0.9861904832614012,
-0.985763448149796,
-0.985271896942193,
-0.9859150097721403,
-0.9867782965804932,
-0.986524328456565,
-0.9874040003051713,
-0.9874613479460583,
-0.9877071235498599,
-0.9872483424227636,
-0.9869431710480434,
-0.9872340055125419,
-0.9870834679552134,
-0.9870629866548967,
-0.9867619115402397,
-0.9866615531686875,
-0.9864915583760581,
-0.9880194633796909,
-0.9883666214200606,
-0.9883799342652666,
-0.9887895602716025,
-0.988767030841254,
-0.9888653410827746,
-0.9888192581570618,
-0.9888274506771885,
-0.989360988550441,
-0.9891981622129224,
-0.9892503895287303,
-0.9892913521293639,
-0.9891592477423206,
-0.9891602718073365,
-0.9893947826959637,
-0.9887137794604303,
-0.9883717417451399,
-0.9880297040298494,
-0.9879836211041366,
-0.9879825970391207,
-0.9880399446800078,
-0.987974404518994,
-0.9876272464786243,
-0.987776759970937,
-0.9876651368842104,
-0.9881443993116235,
-0.9882703593085717,
-0.9884700519866605,
-0.9883215625593637,
-0.988006150534485,
-0.9880460890701028,
-0.9879344659833763,
-0.9879713323239465,
-0.9880880757357522,
-0.9875033346117077,
-0.9874183372153931,
-0.9875504416024363,
-0.9874552035559633,
-0.9872462942927319,
-0.9879170568781069,
-0.9887352848257629,
-0.9880430168750552,
-0.9877368214353192,
-0.9876313427386877,
-0.9881269902063541,
-0.9884137284107892,
-0.9880378965499761,
-0.9891858734327325,
-0.9891817771726691,
-0.9889831085595961,
-0.9896292935845911,
-0.9890373840054356,
-0.9885806510083711,
-0.9881218698812749,
-0.9883277069494587,
-0.9881321105314333,
-0.9892094269280968,
-0.9893466516402193,
-0.9893476757052351,
-0.9893886383058687,
-0.9887916084016342,
-0.9893138815597123,
-0.9896518230149395,
-0.9891725605875265,
-0.9879621157388039,
-0.9879252493982337,
-0.9880409687450236,
-0.9872258129924152,
-0.9870373850295007,
-0.9862498790323199,
-0.9859856702582332,
-0.9855125522209153,
-0.9862406624471773,
-0.986191507326417,
-0.9862375902521299,
-0.9869052806424573,
-0.9871479840512114,
-0.986812090726016,
-0.9873333398190783,
-0.9863266839085079,
-0.9869114250325524,
-0.9866994435742735,
-0.9870066630790255,
-0.9870814198251818,
-0.9848919688213165,
-0.9846953483382752,
-0.9854685174252342,
-0.9853241242580008,
-0.9853507499484127,
-0.9858166995306197,
-0.9829247399258884,
-0.9823481913219706,
-0.9827957077338925,
-0.9832104540653076,
-0.9832053337402284,
-0.9819713353961416,
-0.9818750732846526,
-0.9822355441702282,
-0.9825714374954236,
-0.9840757890036922,
-0.9839334439664904,
-0.9843082517622878,
-0.983936516161538,
-0.9842939148520661,
-0.9832800904863848,
-0.9839529012017915,
-0.9856385122178636,
-0.986114702450229,
-0.9862345180570823,
-0.9880071745995009,
-0.9878965755777902,
-0.9877245326551292,
-0.987763447125731,
-0.9880358484199444,
-0.9870978048654352,
-0.9871643690914648,
-0.9876190539584976,
-0.9879682601288989,
-0.9872176204722884,
-0.98825602239835,
-0.9881679528069878,
-0.9860051274935342,
-0.9880706666304829,
-0.9894306249715181,
-0.9897788070769036,
-0.9896702561852246,
-0.9896467026898603,
-0.9893507479002827,
-0.9888376913273469,
-0.9894316490365339,
-0.9900911469067347,
-0.9890312396153406,
-0.9888807020580122,
-0.9879334419183604,
-0.9888387153923628,
-0.9899180799190578,
-0.988830522872236,
-0.9882201801227956,
-0.9881116292311165,
-0.9852893060474622,
-0.9841802436353079,
-0.9862232533419081,
-0.9877112198099232,
-0.988223252317843,
-0.9891121407515919,
-0.989195090017875,
-0.9899641628447706,
-0.989195090017875,
-0.9934459838986257,
-0.9918627793841375,
-0.9913753244365977,
-0.9999999999999999,
-0.9856630897782438,
-0.9826943252973244,
-0.9774705696515259,
-0.9764465046356863,
-0.9753712363690545,
-0.9738863420960869,
-0.9735791225913349,
-0.9736712884427605,
-0.9735791225913349,
-0.9735791225913349,
-0.9743983746040068
]
},
{
"line": {
"color": "rgba(50, 171, 96, 1.0)",
"dash": "solid",
"width": 1.3
},
"mode": "lines",
"name": "close_SS",
"text": "",
"type": "scatter",
"x": [
"2018-04-23",
"2018-04-22",
"2018-04-21",
"2018-04-20",
"2018-04-19",
"2018-04-18",
"2018-04-17",
"2018-04-16",
"2018-04-15",
"2018-04-14",
"2018-04-13",
"2018-04-12",
"2018-04-11",
"2018-04-10",
"2018-04-09",
"2018-04-08",
"2018-04-07",
"2018-04-06",
"2018-04-05",
"2018-04-04",
"2018-04-03",
"2018-04-02",
"2018-04-01",
"2018-03-31",
"2018-03-30",
"2018-03-29",
"2018-03-28",
"2018-03-27",
"2018-03-26",
"2018-03-25",
"2018-03-24",
"2018-03-23",
"2018-03-22",
"2018-03-21",
"2018-03-20",
"2018-03-19",
"2018-03-18",
"2018-03-17",
"2018-03-16",
"2018-03-15",
"2018-03-14",
"2018-03-13",
"2018-03-12",
"2018-03-11",
"2018-03-10",
"2018-03-09",
"2018-03-08",
"2018-03-07",
"2018-03-06",
"2018-03-05",
"2018-03-04",
"2018-03-03",
"2018-03-02",
"2018-03-01",
"2018-02-28",
"2018-02-27",
"2018-02-26",
"2018-02-25",
"2018-02-24",
"2018-02-23",
"2018-02-22",
"2018-02-21",
"2018-02-20",
"2018-02-19",
"2018-02-18",
"2018-02-17",
"2018-02-16",
"2018-02-15",
"2018-02-14",
"2018-02-13",
"2018-02-12",
"2018-02-11",
"2018-02-10",
"2018-02-09",
"2018-02-08",
"2018-02-07",
"2018-02-06",
"2018-02-05",
"2018-02-04",
"2018-02-03",
"2018-02-02",
"2018-02-01",
"2018-01-31",
"2018-01-30",
"2018-01-29",
"2018-01-28",
"2018-01-27",
"2018-01-26",
"2018-01-25",
"2018-01-24",
"2018-01-23",
"2018-01-22",
"2018-01-21",
"2018-01-20",
"2018-01-19",
"2018-01-18",
"2018-01-17",
"2018-01-16",
"2018-01-15",
"2018-01-14",
"2018-01-13",
"2018-01-12",
"2018-01-11",
"2018-01-10",
"2018-01-09",
"2018-01-08",
"2018-01-07",
"2018-01-06",
"2018-01-05",
"2018-01-04",
"2018-01-03",
"2018-01-02",
"2018-01-01",
"2017-12-31",
"2017-12-30",
"2017-12-29",
"2017-12-28",
"2017-12-27",
"2017-12-26",
"2017-12-25",
"2017-12-24",
"2017-12-23",
"2017-12-22",
"2017-12-21",
"2017-12-20",
"2017-12-19",
"2017-12-18",
"2017-12-17",
"2017-12-16",
"2017-12-15",
"2017-12-14",
"2017-12-13",
"2017-12-12",
"2017-12-11",
"2017-12-10",
"2017-12-09",
"2017-12-08",
"2017-12-07",
"2017-12-06",
"2017-12-05",
"2017-12-04",
"2017-12-03",
"2017-12-02",
"2017-12-01",
"2017-11-30",
"2017-11-29",
"2017-11-28",
"2017-11-27",
"2017-11-26",
"2017-11-25",
"2017-11-24",
"2017-11-23",
"2017-11-22",
"2017-11-21",
"2017-11-20",
"2017-11-19",
"2017-11-18",
"2017-11-17",
"2017-11-16",
"2017-11-15",
"2017-11-14",
"2017-11-13",
"2017-11-12",
"2017-11-11",
"2017-11-10",
"2017-11-09",
"2017-11-08",
"2017-11-07",
"2017-11-06",
"2017-11-05",
"2017-11-04",
"2017-11-03",
"2017-11-02",
"2017-11-01",
"2017-10-31",
"2017-10-30",
"2017-10-29",
"2017-10-28",
"2017-10-27",
"2017-10-26",
"2017-10-25",
"2017-10-24",
"2017-10-23",
"2017-10-22",
"2017-10-21",
"2017-10-20",
"2017-10-19",
"2017-10-18",
"2017-10-17",
"2017-10-16",
"2017-10-15",
"2017-10-14",
"2017-10-13",
"2017-10-12",
"2017-10-11",
"2017-10-10",
"2017-10-09",
"2017-10-08",
"2017-10-07",
"2017-10-06",
"2017-10-05",
"2017-10-04",
"2017-10-03",
"2017-10-02",
"2017-10-01",
"2017-09-30",
"2017-09-29",
"2017-09-28",
"2017-09-27",
"2017-09-26",
"2017-09-25",
"2017-09-24",
"2017-09-23",
"2017-09-22",
"2017-09-21",
"2017-09-20",
"2017-09-19",
"2017-09-18",
"2017-09-17",
"2017-09-16",
"2017-09-15",
"2017-09-14",
"2017-09-13",
"2017-09-12",
"2017-09-11",
"2017-09-10",
"2017-09-09",
"2017-09-08",
"2017-09-07",
"2017-09-06",
"2017-09-05",
"2017-09-04",
"2017-09-03",
"2017-09-02",
"2017-09-01",
"2017-08-31",
"2017-08-30",
"2017-08-29",
"2017-08-28",
"2017-08-27",
"2017-08-26",
"2017-08-25",
"2017-08-24",
"2017-08-23",
"2017-08-22",
"2017-08-21",
"2017-08-20",
"2017-08-19",
"2017-08-18",
"2017-08-17",
"2017-08-16",
"2017-08-15",
"2017-08-14",
"2017-08-13",
"2017-08-12",
"2017-08-11",
"2017-08-10",
"2017-08-09",
"2017-08-08",
"2017-08-07",
"2017-08-06",
"2017-08-05",
"2017-08-04",
"2017-08-03",
"2017-08-02",
"2017-08-01",
"2017-07-31",
"2017-07-30",
"2017-07-29",
"2017-07-28",
"2017-07-27",
"2017-07-26",
"2017-07-25",
"2017-07-24",
"2017-07-23",
"2017-07-22",
"2017-07-21",
"2017-07-20",
"2017-07-19",
"2017-07-18",
"2017-07-17",
"2017-07-16",
"2017-07-15",
"2017-07-14",
"2017-07-13",
"2017-07-12",
"2017-07-11",
"2017-07-10",
"2017-07-09",
"2017-07-08",
"2017-07-07",
"2017-07-06",
"2017-07-05",
"2017-07-04",
"2017-07-03",
"2017-07-02",
"2017-07-01",
"2017-06-30",
"2017-06-29",
"2017-06-28",
"2017-06-27",
"2017-06-26",
"2017-06-25",
"2017-06-24",
"2017-06-23",
"2017-06-22",
"2017-06-21",
"2017-06-20",
"2017-06-19",
"2017-06-18",
"2017-06-17",
"2017-06-16",
"2017-06-15",
"2017-06-14",
"2017-06-13",
"2017-06-12",
"2017-06-11",
"2017-06-10",
"2017-06-09",
"2017-06-08",
"2017-06-07",
"2017-06-06",
"2017-06-05",
"2017-06-04",
"2017-06-03",
"2017-06-02",
"2017-06-01",
"2017-05-31",
"2017-05-30",
"2017-05-29",
"2017-05-28",
"2017-05-27",
"2017-05-26",
"2017-05-25",
"2017-05-24",
"2017-05-23",
"2017-05-22",
"2017-05-21",
"2017-05-20",
"2017-05-19",
"2017-05-18",
"2017-05-17",
"2017-05-16",
"2017-05-15",
"2017-05-14",
"2017-05-13",
"2017-05-12",
"2017-05-11",
"2017-05-10",
"2017-05-09",
"2017-05-08",
"2017-05-07",
"2017-05-06",
"2017-05-05",
"2017-05-04",
"2017-05-03",
"2017-05-02",
"2017-05-01",
"2017-04-30",
"2017-04-29",
"2017-04-28",
"2017-04-27",
"2017-04-26",
"2017-04-25",
"2017-04-24",
"2017-04-23",
"2017-04-22",
"2017-04-21",
"2017-04-20",
"2017-04-19",
"2017-04-18",
"2017-04-17",
"2017-04-16",
"2017-04-15",
"2017-04-14",
"2017-04-13",
"2017-04-12",
"2017-04-11",
"2017-04-10",
"2017-04-09",
"2017-04-08",
"2017-04-07",
"2017-04-06",
"2017-04-05",
"2017-04-04",
"2017-04-03",
"2017-04-02",
"2017-04-01",
"2017-03-31",
"2017-03-30",
"2017-03-29",
"2017-03-28",
"2017-03-27",
"2017-03-26",
"2017-03-25",
"2017-03-24",
"2017-03-23",
"2017-03-22",
"2017-03-21",
"2017-03-20",
"2017-03-19",
"2017-03-18",
"2017-03-17",
"2017-03-16",
"2017-03-15",
"2017-03-14",
"2017-03-13",
"2017-03-12",
"2017-03-11",
"2017-03-10",
"2017-03-09",
"2017-03-08",
"2017-03-07",
"2017-03-06",
"2017-03-05",
"2017-03-04",
"2017-03-03",
"2017-03-02",
"2017-03-01",
"2017-02-28",
"2017-02-27",
"2017-02-26",
"2017-02-25",
"2017-02-24",
"2017-02-23",
"2017-02-22",
"2017-02-21",
"2017-02-20",
"2017-02-19",
"2017-02-18",
"2017-02-17",
"2017-02-16",
"2017-02-15",
"2017-02-14",
"2017-02-13",
"2017-02-12",
"2017-02-11",
"2017-02-10",
"2017-02-09",
"2017-02-08",
"2017-02-07",
"2017-02-06",
"2017-02-05",
"2017-02-04",
"2017-02-03",
"2017-02-02",
"2017-02-01",
"2017-01-31",
"2017-01-30",
"2017-01-29",
"2017-01-28",
"2017-01-27",
"2017-01-26",
"2017-01-25",
"2017-01-24",
"2017-01-23",
"2017-01-22",
"2017-01-21",
"2017-01-20",
"2017-01-19",
"2017-01-18",
"2017-01-17",
"2017-01-16",
"2017-01-15",
"2017-01-14",
"2017-01-13",
"2017-01-12",
"2017-01-11",
"2017-01-10",
"2017-01-09",
"2017-01-08",
"2017-01-07",
"2017-01-06",
"2017-01-05",
"2017-01-04",
"2017-01-03",
"2017-01-02",
"2017-01-01",
"2016-12-31",
"2016-12-30",
"2016-12-29",
"2016-12-28",
"2016-12-27",
"2016-12-26",
"2016-12-25",
"2016-12-24",
"2016-12-23",
"2016-12-22",
"2016-12-21",
"2016-12-20",
"2016-12-19",
"2016-12-18",
"2016-12-17",
"2016-12-16",
"2016-12-15",
"2016-12-14",
"2016-12-13",
"2016-12-12",
"2016-12-11",
"2016-12-10",
"2016-12-09",
"2016-12-08",
"2016-12-07",
"2016-12-06",
"2016-12-05",
"2016-12-04",
"2016-12-03",
"2016-12-02",
"2016-12-01",
"2016-11-30",
"2016-11-29",
"2016-11-28",
"2016-11-27",
"2016-11-26",
"2016-11-25",
"2016-11-24",
"2016-11-23",
"2016-11-22",
"2016-11-21",
"2016-11-20",
"2016-11-19",
"2016-11-18",
"2016-11-17",
"2016-11-16",
"2016-11-15",
"2016-11-14",
"2016-11-13",
"2016-11-12",
"2016-11-11",
"2016-11-10",
"2016-11-09",
"2016-11-08",
"2016-11-07",
"2016-11-06",
"2016-11-05",
"2016-11-04",
"2016-11-03",
"2016-11-02",
"2016-11-01",
"2016-10-31",
"2016-10-30",
"2016-10-29",
"2016-10-28",
"2016-10-27",
"2016-10-26",
"2016-10-25",
"2016-10-24",
"2016-10-23",
"2016-10-22",
"2016-10-21",
"2016-10-20",
"2016-10-19",
"2016-10-18",
"2016-10-17",
"2016-10-16",
"2016-10-15",
"2016-10-14",
"2016-10-13",
"2016-10-12",
"2016-10-11",
"2016-10-10",
"2016-10-09",
"2016-10-08",
"2016-10-07",
"2016-10-06",
"2016-10-05",
"2016-10-04",
"2016-10-03",
"2016-10-02",
"2016-10-01",
"2016-09-30",
"2016-09-29",
"2016-09-28",
"2016-09-27",
"2016-09-26",
"2016-09-25",
"2016-09-24",
"2016-09-23",
"2016-09-22",
"2016-09-21",
"2016-09-20",
"2016-09-19",
"2016-09-18",
"2016-09-17",
"2016-09-16",
"2016-09-15",
"2016-09-14",
"2016-09-13",
"2016-09-12",
"2016-09-11",
"2016-09-10",
"2016-09-09",
"2016-09-08",
"2016-09-07",
"2016-09-06",
"2016-09-05",
"2016-09-04",
"2016-09-03",
"2016-09-02",
"2016-09-01",
"2016-08-31",
"2016-08-30",
"2016-08-29",
"2016-08-28",
"2016-08-27",
"2016-08-26",
"2016-08-25",
"2016-08-24",
"2016-08-23",
"2016-08-22",
"2016-08-21",
"2016-08-20",
"2016-08-19",
"2016-08-18",
"2016-08-17",
"2016-08-16",
"2016-08-15",
"2016-08-14",
"2016-08-13",
"2016-08-12",
"2016-08-11",
"2016-08-10",
"2016-08-09",
"2016-08-08",
"2016-08-07",
"2016-08-06",
"2016-08-05",
"2016-08-04",
"2016-08-03",
"2016-08-02",
"2016-08-01",
"2016-07-31",
"2016-07-30",
"2016-07-29",
"2016-07-28",
"2016-07-27",
"2016-07-26",
"2016-07-25",
"2016-07-24",
"2016-07-23",
"2016-07-22",
"2016-07-21",
"2016-07-20",
"2016-07-19",
"2016-07-18",
"2016-07-17",
"2016-07-16",
"2016-07-15",
"2016-07-14",
"2016-07-13",
"2016-07-12",
"2016-07-11",
"2016-07-10",
"2016-07-09",
"2016-07-08",
"2016-07-07",
"2016-07-06",
"2016-07-05",
"2016-07-04",
"2016-07-03",
"2016-07-02",
"2016-07-01",
"2016-06-30",
"2016-06-29",
"2016-06-28",
"2016-06-27",
"2016-06-26",
"2016-06-25",
"2016-06-24",
"2016-06-23",
"2016-06-22",
"2016-06-21",
"2016-06-20",
"2016-06-19",
"2016-06-18",
"2016-06-17",
"2016-06-16",
"2016-06-15",
"2016-06-14",
"2016-06-13",
"2016-06-12",
"2016-06-11",
"2016-06-10",
"2016-06-09",
"2016-06-08",
"2016-06-07",
"2016-06-06",
"2016-06-05",
"2016-06-04",
"2016-06-03",
"2016-06-02",
"2016-06-01",
"2016-05-31",
"2016-05-30",
"2016-05-29",
"2016-05-28",
"2016-05-27",
"2016-05-26",
"2016-05-25",
"2016-05-24",
"2016-05-23",
"2016-05-22",
"2016-05-21",
"2016-05-20",
"2016-05-19",
"2016-05-18",
"2016-05-17",
"2016-05-16",
"2016-05-15",
"2016-05-14",
"2016-05-13",
"2016-05-12",
"2016-05-11",
"2016-05-10",
"2016-05-09",
"2016-05-08",
"2016-05-07",
"2016-05-06",
"2016-05-05",
"2016-05-04",
"2016-05-03",
"2016-05-02",
"2016-05-01",
"2016-04-30",
"2016-04-29",
"2016-04-28",
"2016-04-27",
"2016-04-26",
"2016-04-25",
"2016-04-24",
"2016-04-23",
"2016-04-22",
"2016-04-21",
"2016-04-20",
"2016-04-19",
"2016-04-18",
"2016-04-17",
"2016-04-16",
"2016-04-15",
"2016-04-14",
"2016-04-13",
"2016-04-12",
"2016-04-11",
"2016-04-10",
"2016-04-09",
"2016-04-08",
"2016-04-07",
"2016-04-06",
"2016-04-05",
"2016-04-04",
"2016-04-03",
"2016-04-02",
"2016-04-01",
"2016-03-31",
"2016-03-30",
"2016-03-29",
"2016-03-28",
"2016-03-27",
"2016-03-26",
"2016-03-25",
"2016-03-24",
"2016-03-23",
"2016-03-22",
"2016-03-21",
"2016-03-20",
"2016-03-19",
"2016-03-18",
"2016-03-17",
"2016-03-16",
"2016-03-15",
"2016-03-14",
"2016-03-13",
"2016-03-12",
"2016-03-11",
"2016-03-10",
"2016-03-09",
"2016-03-08",
"2016-03-07",
"2016-03-06",
"2016-03-05",
"2016-03-04",
"2016-03-03",
"2016-03-02",
"2016-03-01",
"2016-02-29",
"2016-02-28",
"2016-02-27",
"2016-02-26",
"2016-02-25",
"2016-02-24",
"2016-02-23",
"2016-02-22",
"2016-02-21",
"2016-02-20",
"2016-02-19",
"2016-02-18",
"2016-02-17",
"2016-02-16",
"2016-02-15",
"2016-02-14",
"2016-02-13",
"2016-02-12",
"2016-02-11",
"2016-02-10",
"2016-02-09",
"2016-02-08",
"2016-02-07",
"2016-02-06",
"2016-02-05",
"2016-02-04",
"2016-02-03",
"2016-02-02",
"2016-02-01",
"2016-01-31",
"2016-01-30",
"2016-01-29",
"2016-01-28",
"2016-01-27",
"2016-01-26",
"2016-01-25",
"2016-01-24",
"2016-01-23",
"2016-01-22",
"2016-01-21",
"2016-01-20",
"2016-01-19",
"2016-01-18",
"2016-01-17",
"2016-01-16",
"2016-01-15",
"2016-01-14",
"2016-01-13",
"2016-01-12",
"2016-01-11",
"2016-01-10",
"2016-01-09",
"2016-01-08",
"2016-01-07",
"2016-01-06",
"2016-01-05",
"2016-01-04",
"2016-01-03",
"2016-01-02",
"2016-01-01",
"2015-12-31",
"2015-12-30",
"2015-12-29",
"2015-12-28",
"2015-12-27",
"2015-12-26",
"2015-12-25",
"2015-12-24",
"2015-12-23",
"2015-12-22",
"2015-12-21",
"2015-12-20",
"2015-12-19",
"2015-12-18",
"2015-12-17",
"2015-12-16",
"2015-12-15",
"2015-12-14",
"2015-12-13",
"2015-12-12",
"2015-12-11",
"2015-12-10",
"2015-12-09",
"2015-12-08",
"2015-12-07",
"2015-12-06",
"2015-12-05",
"2015-12-04",
"2015-12-03",
"2015-12-02",
"2015-12-01",
"2015-11-30",
"2015-11-29",
"2015-11-28",
"2015-11-27",
"2015-11-26",
"2015-11-25",
"2015-11-24",
"2015-11-23",
"2015-11-22",
"2015-11-21",
"2015-11-20",
"2015-11-19",
"2015-11-18",
"2015-11-17",
"2015-11-16",
"2015-11-15",
"2015-11-14",
"2015-11-13",
"2015-11-12",
"2015-11-11",
"2015-11-10",
"2015-11-09",
"2015-11-08",
"2015-11-07",
"2015-11-06",
"2015-11-05",
"2015-11-04",
"2015-11-03",
"2015-11-02",
"2015-11-01",
"2015-10-31",
"2015-10-30",
"2015-10-29",
"2015-10-28",
"2015-10-27",
"2015-10-26",
"2015-10-25",
"2015-10-24",
"2015-10-23",
"2015-10-22",
"2015-10-21",
"2015-10-20",
"2015-10-19",
"2015-10-18",
"2015-10-17",
"2015-10-16",
"2015-10-15",
"2015-10-14",
"2015-10-13",
"2015-10-12",
"2015-10-11",
"2015-10-10",
"2015-10-09",
"2015-10-08",
"2015-10-07",
"2015-10-06",
"2015-10-05",
"2015-10-04",
"2015-10-03",
"2015-10-02",
"2015-10-01",
"2015-09-30",
"2015-09-29",
"2015-09-28",
"2015-09-27",
"2015-09-26",
"2015-09-25",
"2015-09-24",
"2015-09-23",
"2015-09-22",
"2015-09-21",
"2015-09-20",
"2015-09-19",
"2015-09-18",
"2015-09-17",
"2015-09-16",
"2015-09-15",
"2015-09-14",
"2015-09-13",
"2015-09-12",
"2015-09-11",
"2015-09-10",
"2015-09-09",
"2015-09-08",
"2015-09-07",
"2015-09-06",
"2015-09-05",
"2015-09-04",
"2015-09-03",
"2015-09-02",
"2015-09-01",
"2015-08-31",
"2015-08-30",
"2015-08-29",
"2015-08-28",
"2015-08-27",
"2015-08-26",
"2015-08-25",
"2015-08-24",
"2015-08-23",
"2015-08-22",
"2015-08-21",
"2015-08-20",
"2015-08-19",
"2015-08-18",
"2015-08-17",
"2015-08-16",
"2015-08-15",
"2015-08-14",
"2015-08-13",
"2015-08-12",
"2015-08-11",
"2015-08-10",
"2015-08-09",
"2015-08-08",
"2015-08-07",
"2015-08-06",
"2015-08-05",
"2015-08-04",
"2015-08-03",
"2015-08-02",
"2015-08-01",
"2015-07-31",
"2015-07-30",
"2015-07-29",
"2015-07-28",
"2015-07-27",
"2015-07-26",
"2015-07-25",
"2015-07-24",
"2015-07-23",
"2015-07-22",
"2015-07-21",
"2015-07-20",
"2015-07-19",
"2015-07-18",
"2015-07-17",
"2015-07-16",
"2015-07-15",
"2015-07-14",
"2015-07-13",
"2015-07-12",
"2015-07-11",
"2015-07-10",
"2015-07-09",
"2015-07-08",
"2015-07-07",
"2015-07-06",
"2015-07-05",
"2015-07-04",
"2015-07-03",
"2015-07-02",
"2015-07-01",
"2015-06-30",
"2015-06-29",
"2015-06-28",
"2015-06-27",
"2015-06-26",
"2015-06-25",
"2015-06-24",
"2015-06-23",
"2015-06-22",
"2015-06-21",
"2015-06-20",
"2015-06-19",
"2015-06-18",
"2015-06-17",
"2015-06-16",
"2015-06-15",
"2015-06-14",
"2015-06-13",
"2015-06-12",
"2015-06-11",
"2015-06-10",
"2015-06-09",
"2015-06-08",
"2015-06-07",
"2015-06-06",
"2015-06-05",
"2015-06-04",
"2015-06-03",
"2015-06-02",
"2015-06-01",
"2015-05-31",
"2015-05-30",
"2015-05-29",
"2015-05-28",
"2015-05-27",
"2015-05-26",
"2015-05-25",
"2015-05-24",
"2015-05-23",
"2015-05-22",
"2015-05-21",
"2015-05-20",
"2015-05-19",
"2015-05-18",
"2015-05-17",
"2015-05-16",
"2015-05-15",
"2015-05-14",
"2015-05-13",
"2015-05-12",
"2015-05-11",
"2015-05-10",
"2015-05-09",
"2015-05-08",
"2015-05-07",
"2015-05-06",
"2015-05-05",
"2015-05-04",
"2015-05-03",
"2015-05-02",
"2015-05-01",
"2015-04-30",
"2015-04-29",
"2015-04-28",
"2015-04-27",
"2015-04-26",
"2015-04-25",
"2015-04-24",
"2015-04-23",
"2015-04-22",
"2015-04-21",
"2015-04-20",
"2015-04-19",
"2015-04-18",
"2015-04-17",
"2015-04-16",
"2015-04-15",
"2015-04-14",
"2015-04-13",
"2015-04-12",
"2015-04-11",
"2015-04-10",
"2015-04-09",
"2015-04-08",
"2015-04-07",
"2015-04-06",
"2015-04-05",
"2015-04-04",
"2015-04-03",
"2015-04-02",
"2015-04-01",
"2015-03-31",
"2015-03-30",
"2015-03-29",
"2015-03-28",
"2015-03-27",
"2015-03-26",
"2015-03-25",
"2015-03-24",
"2015-03-23",
"2015-03-22",
"2015-03-21",
"2015-03-20",
"2015-03-19",
"2015-03-18",
"2015-03-17",
"2015-03-16",
"2015-03-15",
"2015-03-14",
"2015-03-13",
"2015-03-12",
"2015-03-11",
"2015-03-10",
"2015-03-09",
"2015-03-08",
"2015-03-07",
"2015-03-06",
"2015-03-05",
"2015-03-04",
"2015-03-03",
"2015-03-02",
"2015-03-01",
"2015-02-28",
"2015-02-27",
"2015-02-26",
"2015-02-25",
"2015-02-24",
"2015-02-23",
"2015-02-22",
"2015-02-21",
"2015-02-20",
"2015-02-19",
"2015-02-18",
"2015-02-17",
"2015-02-16",
"2015-02-15",
"2015-02-14",
"2015-02-13",
"2015-02-12",
"2015-02-11",
"2015-02-10",
"2015-02-09",
"2015-02-08",
"2015-02-07",
"2015-02-06",
"2015-02-05",
"2015-02-04",
"2015-02-03",
"2015-02-02",
"2015-02-01",
"2015-01-31",
"2015-01-30",
"2015-01-29",
"2015-01-28",
"2015-01-27",
"2015-01-26",
"2015-01-25",
"2015-01-24",
"2015-01-23",
"2015-01-22",
"2015-01-21",
"2015-01-20",
"2015-01-19",
"2015-01-17",
"2015-01-16",
"2015-01-15",
"2015-01-14",
"2015-01-13",
"2015-01-08",
"2014-12-18",
"2014-12-12",
"2014-12-10",
"2014-12-08",
"2014-12-06",
"2014-12-04",
"2014-12-03",
"2014-12-02",
"2014-12-01"
],
"y": [
1.7487413759153005,
1.7163050196167615,
1.7485912200127862,
1.7354123582117347,
1.5766037218148117,
1.5439045926868722,
1.4742027590107107,
1.5162544557809836,
1.5983897344564277,
1.5039684853288129,
1.4744950267495336,
1.4806111984215984,
1.2197126364472117,
1.1880726427030799,
1.1736308625076655,
1.2403644357537629,
1.206579357687995,
1.132842084131756,
1.1775778176594758,
1.179141047858868,
1.3489298346271652,
1.2470678242588755,
1.1856647855520437,
1.2158273524696486,
1.1942451228385877,
1.2564472054552291,
1.4877757800558629,
1.447794089655969,
1.5420142371284304,
1.6245892580898098,
1.6456057217310394,
1.751723043122375,
1.6948756272436174,
1.7422605399085576,
1.7444565699828327,
1.63661245571258,
1.554616607518042,
1.4669416485819728,
1.5768718573550162,
1.5728471428965465,
1.5586466846873162,
1.8102597129044204,
1.803446388827824,
1.914422326207665,
1.7164203178990496,
1.8396446867554324,
1.8530246502116372,
2.017954820991429,
2.227100542350944,
2.408773096261105,
2.4335380947543936,
2.4235098255507443,
2.3075412044122956,
2.279633657387811,
2.1217956716464283,
2.1913232172214565,
2.1198463262691414,
1.931612495690176,
1.9559136196989106,
2.078282636182041,
1.9938226223730235,
2.1612115960564906,
2.370705893618271,
2.3450801800409264,
2.1413078949071105,
2.340119672547143,
2.0843156858366423,
2.0477795371283762,
1.8980928718092105,
1.6425677460605224,
1.737023852808364,
1.5227057968783038,
1.649936110705342,
1.6830562126314028,
1.56161494511738,
1.389378080867015,
1.4195996376034652,
1.2095771130274813,
1.5481572223545155,
1.8356226536523648,
1.7142966844206298,
1.7750856927403933,
2.066216536872838,
2.038064986506767,
2.3405245572128526,
2.451261853961911,
2.393076441737533,
2.330839501500665,
2.339181198156427,
2.4032092838018615,
2.260601396744095,
2.2449851828825844,
2.446480997280065,
2.780210534684799,
2.441338157618943,
2.389464656010979,
2.3611709938085994,
2.4603811436842666,
3.0020122535419667,
3.0197708703697113,
3.1623438998072517,
3.0636834277890035,
2.926414119336709,
3.346614687101994,
3.2409183385087803,
3.378404836748641,
3.6949334792492565,
3.942897182764178,
3.9056317053865546,
3.4189603372045725,
3.406398187145991,
3.3214984310510385,
2.9725200254748736,
3.075248113638024,
2.8009079170331854,
3.2634578120183706,
3.232611499473245,
3.4785105593285914,
3.592146401267261,
3.1580617752301854,
3.171457826818803,
3.4004321713764405,
3.168409125726677,
3.5835446131374997,
3.781452774007044,
4.1412477672750585,
4.4630854934717235,
4.554246214430452,
4.626916308536677,
4.114418125122196,
3.8492615707693614,
3.8331278553152566,
4.1121255662534475,
3.88572264152637,
3.45784535324503,
3.4632000199829136,
3.7466326927560876,
4.020929987674492,
3.13608002364422,
2.500156369718203,
2.4802151295931933,
2.3853005110716023,
2.2888360691276297,
2.272640682499277,
2.0133965168079526,
2.022239626923897,
2.0257307516573597,
1.977388595113889,
1.878821970534713,
1.7164364060314616,
1.560786406298148,
1.5114896872315493,
1.5701684688499036,
1.5323613576810682,
1.5717799634465326,
1.5116666566880843,
1.4433430396885742,
1.4266381955338334,
1.4598387381219553,
1.3138308924143955,
1.1290855052134907,
1.1105492953191531,
0.9363898992455224,
1.0598260951786667,
1.1217439541226912,
1.2768281878661736,
1.3604757509883714,
1.2689530470503674,
1.2268906248584865,
1.340108175354437,
1.3456183607056398,
1.2805847667844388,
1.2457191024916467,
1.1769986448926337,
1.086186500136172,
1.0001552120615558,
1.0044051603737973,
0.900368570774449,
0.907873684544773,
0.9378002921869979,
0.8971402188703868,
0.8396144200749119,
0.9416560812551387,
0.9682175878677972,
0.9735293529192484,
0.9639408260015354,
0.8874980648446327,
0.8527557429003346,
0.8580004740667349,
0.9011434824856398,
0.8847335874251241,
0.9183658282329754,
0.8662590487050337,
0.8167076008752409,
0.6491202068920223,
0.6316940781341316,
0.6369361279451297,
0.5924095401387693,
0.544550027567667,
0.5279229427195855,
0.5164065212678021,
0.488198662438288,
0.5131754880083377,
0.5358919309744635,
0.5364550156088931,
0.5214903711100795,
0.4726870214374572,
0.48138265700628946,
0.4842195310216531,
0.39978096805585206,
0.4090825899455464,
0.3418422405284624,
0.3735680376454595,
0.32843546351823705,
0.32802253478632204,
0.3962871619669873,
0.4064897192717688,
0.4574059770012025,
0.3555064276572839,
0.3572600340902215,
0.3608825452383843,
0.22959802204345398,
0.3917985730239639,
0.4747060820551973,
0.4870939440126455,
0.4979909723665565,
0.5202462222035305,
0.5244398620523291,
0.5979572644656007,
0.5958121801439646,
0.546563725474603,
0.5641909558876471,
0.5984586779257831,
0.6048778427582788,
0.6847822337392218,
0.6300691767604921,
0.5866419446689703,
0.5912056115632511,
0.5338219246040846,
0.5217880015597064,
0.5229168521839673,
0.5271212174543741,
0.5142587555907638,
0.4690671916446964,
0.45526089267956643,
0.4311286940611609,
0.4442646541757796,
0.47279963836434313,
0.45786717013035433,
0.5056730555934157,
0.5298052542118212,
0.4734753399256586,
0.5165566771703166,
0.4468065790969183,
0.39680734491498404,
0.3383940174814324,
0.2817718354564468,
0.2543737459583504,
0.2757253790248351,
0.2692364989518861,
0.2220419625204909,
0.22774520546064075,
0.12420466661067076,
0.10534937542348982,
0.08198940716087326,
0.09075475797015858,
0.12408132426217666,
0.08844879232439974,
0.08207252917833664,
0.1050946466602956,
0.07262879545233387,
0.0353579553639075,
0.045549787247080836,
0.0987103394480263,
0.09657061783719435,
0.11560555983631218,
0.0706070534791919,
0.12853237422957145,
-0.03623423387069568,
-0.02305269071424207,
-0.042615859727562856,
-0.12933357478510227,
-0.11524841485815955,
-0.047428892674233815,
-0.014512573758728569,
-0.002870128603048886,
-0.022553958609461654,
-0.01691238684355885,
0.03079965118043089,
0.04477487553588985,
0.028697468545227645,
0.056500442709032914,
0.0597502454563115,
0.055738937774852074,
0.03976074093406551,
0.03285625077379947,
0.00791160146857432,
0.016373959117428526,
0.03643317888012763,
0.04263247256965578,
0.048700379844483783,
0.003696510776559414,
0.029893353054539752,
0.048456376502897726,
0.07953864832340411,
0.07665082855540147,
0.06682634236230839,
0.08874106006322269,
0.05439289736302546,
0.03247817966211116,
0.06457132246918852,
0.023141700152190206,
0.004251551344782786,
0.010212204403528966,
0.08443212193213635,
0.07014049763923612,
0.16218338452523698,
0.14399575083316535,
0.1118838385382736,
0.1087573781394891,
0.07816579435755695,
0.12794515739652357,
0.08147994963448468,
0.03411648781276073,
0.04127302538081901,
0.022755584974295702,
0.006935588102229831,
-0.024355829439636004,
-0.054309250635881406,
-0.030740136651905284,
-0.04326206637945568,
-0.07886778476321218,
-0.03255809561449189,
-0.010490540655660975,
0.010415987414084327,
-0.032544688837481614,
-0.07262022667644713,
-0.09039493163660385,
-0.08988279275481327,
-0.11205223921892181,
-0.13271744530248308,
-0.15575833227225633,
-0.16534417783456742,
-0.17329975931243516,
-0.159308446824564,
-0.16125511084644872,
-0.1872964345111104,
-0.14913538442920501,
-0.16064912452558652,
-0.1806413104032345,
-0.182633557466954,
-0.2103668163903061,
-0.21685033375245102,
-0.22599107431802268,
-0.22274931563695016,
-0.23089795470376515,
-0.24725690401164205,
-0.2567730343335,
-0.2707026756471241,
-0.27582942717583425,
-0.27907118585690677,
-0.2801651788609411,
-0.2937918270141341,
-0.298425209148868,
-0.30482560449354956,
-0.3062494042120355,
-0.30758471920225394,
-0.30678299393704245,
-0.3104939898134728,
-0.3163768835655597,
-0.319666906643869,
-0.3228925771925292,
-0.3260887528317669,
-0.32585815626719106,
-0.32722832887763603,
-0.32634080023955914,
-0.31638760898716783,
-0.3137545179823596,
-0.31750573418982064,
-0.3172456427158223,
-0.32434319046503557,
-0.3217959028330928,
-0.32225173325144046,
-0.3381548521409697,
-0.33520536119872013,
-0.33289671419755934,
-0.3432494274048553,
-0.3491457279339524,
-0.34995281590996796,
-0.3624613388605082,
-0.362211972808118,
-0.3616408441074824,
-0.36253105410096137,
-0.3810324063750723,
-0.38354215503138644,
-0.3912778653662865,
-0.3670732701520257,
-0.3645447520078972,
-0.34313412912256736,
-0.3617588237451724,
-0.36858823595418116,
-0.38185826383890215,
-0.3551600081007395,
-0.3268609831875559,
-0.30329455055898186,
-0.30747210227536803,
-0.30798960386796276,
-0.3106468270713894,
-0.3233752211648973,
-0.34458474239507375,
-0.3209110555504179,
-0.33353487678324606,
-0.3101695458098254,
-0.29739825002988474,
-0.2990097446265138,
-0.3003531036829384,
-0.2952880233284753,
-0.30164015427592,
-0.3121430233857305,
-0.3215063164496719,
-0.3213105775053226,
-0.3242332548935517,
-0.331448782280455,
-0.3236969838131427,
-0.32369966516854476,
-0.339302472253045,
-0.3394150891799309,
-0.34973026341159824,
-0.3577582414853211,
-0.3571495738090569,
-0.3584500311790488,
-0.3633729996972035,
-0.3699181882335955,
-0.37008175091312023,
-0.37305805540939024,
-0.3711328422307219,
-0.36881346980795293,
-0.37328060790776,
-0.37535865834434495,
-0.35861091250317145,
-0.3593456038833318,
-0.36775969713494927,
-0.3694382256166294,
-0.36428466053389885,
-0.3689877579090859,
-0.37156722180585317,
-0.3757581802992497,
-0.3818555824835001,
-0.3943989630542669,
-0.3961927898182351,
-0.39392972585890906,
-0.3945598443783896,
-0.3960640847589369,
-0.40170029381403566,
-0.40411351367587617,
-0.3977587013730294,
-0.3922565600880329,
-0.3939082750156927,
-0.40215344287698124,
-0.39984479587582045,
-0.4038480594910737,
-0.3990189384119906,
-0.4182147617352312,
-0.41850971082945615,
-0.41993351054794203,
-0.41901648700044264,
-0.42415664530616304,
-0.4285755190087333,
-0.39875080287178605,
-0.3999145111162737,
-0.3943721495002465,
-0.39821453179137706,
-0.4017780531206949,
-0.37193724885133544,
-0.3388761367441198,
-0.3682718360167398,
-0.37074404569742536,
-0.3757045531912087,
-0.38095464706841303,
-0.3843224294533816,
-0.3816652062499549,
-0.3785950543146133,
-0.39387073604006406,
-0.40006734837419017,
-0.4016681175492111,
-0.4029069037449559,
-0.39599973222928786,
-0.4124203527114118,
-0.4181906295366128,
-0.42771212256927477,
-0.42990547128814766,
-0.42992960348676607,
-0.4305060948982057,
-0.43254124364835794,
-0.4338336569521437,
-0.43343145364183694,
-0.4338282942413396,
-0.4330882401503751,
-0.4352038295625887,
-0.43391141625880303,
-0.4346219754403449,
-0.43605113786963495,
-0.4370030190373609,
-0.4382203543898894,
-0.44031181160348454,
-0.4360243243156145,
-0.43629514121122104,
-0.4356864735349568,
-0.43977554052307555,
-0.44280815348278846,
-0.44557531225769903,
-0.4462724646622307,
-0.4464145764985391,
-0.444682420908818,
-0.44359915332639177,
-0.4440683905217497,
-0.4431218720648278,
-0.4417436553881766,
-0.4444947260306748,
-0.4456772037629767,
-0.4406416183179361,
-0.4412395605725921,
-0.4460204172544385,
-0.4435696584169693,
-0.4509594739050055,
-0.4520239719996173,
-0.4531796361778988,
-0.45304020569699244,
-0.4497233690646627,
-0.45079322987007875,
-0.44863205741603035,
-0.4512651484208386,
-0.4525334295260059,
-0.44969119279983816,
-0.45238059226808935,
-0.45256024308002635,
-0.45693621509616394,
-0.44229601460099793,
-0.4460230986098405,
-0.4550860798687528,
-0.45494933074324856,
-0.4504258841799985,
-0.4569496218731741,
-0.45661177109251644,
-0.46122638373943603,
-0.46650865388146484,
-0.4676669994151483,
-0.4673827757425315,
-0.4669242639687818,
-0.4728017950100646,
-0.4735472118118331,
-0.47308065597187726,
-0.4716541748979892,
-0.47046097174407925,
-0.46982817186919656,
-0.47083636150036556,
-0.4708712191205921,
-0.47150670035087683,
-0.47147184273065024,
-0.4697745447611557,
-0.47604891640194114,
-0.476397492604207,
-0.47583977068058164,
-0.47624733670169245,
-0.4778829634969399,
-0.4775397500054782,
-0.4782958922288549,
-0.47758533304731293,
-0.4777435330160336,
-0.47687209251036894,
-0.47865787520813097,
-0.4794622818287445,
-0.4797170105919388,
-0.4795373597800017,
-0.4791700140899216,
-0.48062062736242794,
-0.48008167492661696,
-0.48027473251556413,
-0.48208464741194457,
-0.481872820335183,
-0.4795668546894243,
-0.47876244806881074,
-0.4780116685562381,
-0.4789447802361498,
-0.4789420988807478,
-0.47960975637585695,
-0.47880803111064557,
-0.47875440400260455,
-0.4792611801735911,
-0.4789394175253457,
-0.4747028759901145,
-0.475150662342256,
-0.47356866265504943,
-0.47699007214805894,
-0.47758533304731293,
-0.4795427224908058,
-0.47787223807533175,
-0.48082441037298346,
-0.4874473582160347,
-0.4883027105892871,
-0.4883375682095137,
-0.48778520899669237,
-0.4882517648366482,
-0.4876618666481983,
-0.48888724606693285,
-0.48662150075220484,
-0.48761628360636355,
-0.4868413718951725,
-0.4857902805775709,
-0.48503681970959617,
-0.4860852296717958,
-0.4859297110584772,
-0.48812842248815413,
-0.4880158055612682,
-0.48791927676679464,
-0.48669389734806007,
-0.48970505946455667,
-0.4877744835750842,
-0.48470165028434054,
-0.4843557554374767,
-0.484310172395642,
-0.4824251795480043,
-0.48470165028434054,
-0.48335292851711187,
-0.48237155243996344,
-0.4832912573428648,
-0.4856267178980461,
-0.4844201079671258,
-0.4882115445056175,
-0.49783492904355725,
-0.47967410890550605,
-0.4738367981952539,
-0.46608768108334375,
-0.4657846879229126,
-0.4656774337068308,
-0.4656908404838411,
-0.4665730064111139,
-0.46557286084615107,
-0.46471214576209463,
-0.4656506201528104,
-0.4664094437315891,
-0.46302825456961033,
-0.4631247833640839,
-0.4612317464502401,
-0.46082418042912926,
-0.459617570498209,
-0.4632856646882066,
-0.4629746274615694,
-0.4645378576609617,
-0.46622979291965205,
-0.46322131215855755,
-0.4674015452303458,
-0.4670073859862452,
-0.46562112524338783,
-0.4630148477926001,
-0.46981476509218634,
-0.45994201450185646,
-0.46233378352048066,
-0.45908666212860405,
-0.46402840013457314,
-0.4529275887701065,
-0.46010289582597913,
-0.46136313286494035,
-0.47049851071970783,
-0.4680826095024653,
-0.46555141000293476,
-0.47072910728428374,
-0.46130414304609535,
-0.46230428861105816,
-0.47272939841420936,
-0.47986180378364923,
-0.46292636306433266,
-0.45341827680868085,
-0.435817859949657,
-0.43843754417745506,
-0.44024209636303135,
-0.4355497244094525,
-0.4545819850531684,
-0.45829029957419665,
-0.45264336509748976,
-0.4601913805542466,
-0.4785211260826267,
-0.48634800250119625,
-0.48711218879077905,
-0.48557040943460317,
-0.4865088838253189,
-0.48461584691147513,
-0.48772621917784736,
-0.4874205446620143,
-0.48877731049544904,
-0.4977276748274755,
-0.4985401255142951,
-0.49947859990501087,
-0.49915415590136347,
-0.5011195894110625,
-0.5016478164252653,
-0.5155855018050955,
-0.519956111110429,
-0.5208892227903407,
-0.522095832721261,
-0.5224497716343309,
-0.5233051240075833,
-0.5222862089548062,
-0.522455134345135,
-0.5244044797224218,
-0.5197979111417084,
-0.5201652568317885,
-0.5197710975876879,
-0.5182132300990997,
-0.5189023384374253,
-0.5191490231344135,
-0.5195512264447202,
-0.5201169924345518,
-0.5205433279434769,
-0.5174919454959496,
-0.5178592911860298,
-0.5180952504614097,
-0.517987996245328,
-0.5212941074560495,
-0.5216426836583153,
-0.5206961652013935,
-0.5222486699791775,
-0.519417158674618,
-0.5202108398736234,
-0.5189237892806418,
-0.5208382770377018,
-0.5225463004288046,
-0.5157678339724346,
-0.5169529930601385,
-0.5174115048338883,
-0.5197630535214818,
-0.5217150802541706,
-0.5206854397797853,
-0.5231764189482851,
-0.5247584186354918,
-0.5263913640753372,
-0.526383320009131,
-0.5257424760680424,
-0.5264020894969453,
-0.5276381943372882,
-0.5278366146370395,
-0.5272413537377855,
-0.5282763569229748,
-0.5284211501146853,
-0.5294776041430911,
-0.529472241432287,
-0.5287992212263737,
-0.528941333062682,
-0.528700011076498,
-0.529474922787689,
-0.5292899092649479,
-0.5293462177283909,
-0.5299548854046551,
-0.5303973090459925,
-0.5312660681962551,
-0.5303007802515189,
-0.5285284043307671,
-0.5279116925882967,
-0.5301452616382003,
-0.5302954175407147,
-0.5312231665098224,
-0.5299951057356858,
-0.5302283836556636,
-0.5314778952730167,
-0.531673634217366,
-0.5319605392453848,
-0.5321080137924973,
-0.5297591464603058,
-0.5303865836243844,
-0.5305635530809193,
-0.5306681259415991,
-0.5313384647921103,
-0.531858647740107,
-0.5294963736309054,
-0.5304107158230027,
-0.5312633868408531,
-0.5316977664159843,
-0.5314215868095737,
-0.5338267626052081,
-0.5357466130730725,
-0.5327247255349676,
-0.5296545735996261,
-0.5292282380907009,
-0.5258255980855057,
-0.5249246626704185,
-0.5256513099843727,
-0.5258148726638975,
-0.5264235403401617,
-0.5283836111390566,
-0.5282763569229748,
-0.5293408550175868,
-0.5246270322207915,
-0.524356215325185,
-0.52465116441941,
-0.5291397533624334,
-0.5290137296585372,
-0.5306198615443622,
-0.5327059560471533,
-0.5349770640726854,
-0.5329285085455231,
-0.5371087416173113,
-0.5395085547021417,
-0.5405328324657228,
-0.5404765240022799,
-0.5420209847138578,
-0.5424339134457729,
-0.5407312527654742,
-0.5412809306228934,
-0.5388516226286406,
-0.5379158295933268,
-0.5430425811220371,
-0.5419539508288067,
-0.542382967693134,
-0.5432892658190251,
-0.5404711612914758,
-0.5404121714726308,
-0.5401628054202406,
-0.5360925079199362,
-0.5369639484256009,
-0.5370014874012294,
-0.533877708357847,
-0.5380472160080271,
-0.5392806394929678,
-0.5321804103883524,
-0.5297242888400792,
-0.5413265136647282,
-0.5387470497679608,
-0.5404711612914758,
-0.5377254533597816,
-0.5460832381479561,
-0.5266434114831294,
-0.5259087201029691,
-0.5255762320331155,
-0.521505934532811,
-0.5212914261006475,
-0.5211868532399677,
-0.5200982229467375,
-0.5188567553955906,
-0.5264181776293577,
-0.5257558828450525,
-0.5256191337195483,
-0.526139316667545,
-0.5252035236322312,
-0.525133808391778,
-0.526557608110264,
-0.5272011334067548,
-0.5256084082979401,
-0.5288126280033839,
-0.5280672112016154,
-0.5294910109201013,
-0.5197228331904511,
-0.5197496467444715,
-0.5233185307845936,
-0.5256003642317338,
-0.5248254525205429,
-0.5233748392480365,
-0.5182614944963365,
-0.5177573996807521,
-0.5198139992741206,
-0.5202242466506335,
-0.5174624505865272,
-0.5228948766310705,
-0.5256244964303524,
-0.5248093643881306,
-0.5204977449016421,
-0.5304911564850641,
-0.52976450917111,
-0.5296170346239973,
-0.5361085960523485,
-0.5380338092310168,
-0.5379158295933268,
-0.5443537639136371,
-0.544946343457489,
-0.545420943363651,
-0.5447023401159029,
-0.5409001781558029,
-0.5421389643515478,
-0.5461609974546154,
-0.5459062686914211,
-0.5474131904273705,
-0.5537385078207948,
-0.5558782294316268,
-0.5553419583512177,
-0.5551515821176726,
-0.5542694161903997,
-0.5555055210307425,
-0.5544276161591204,
-0.5519929454540635,
-0.551724809913859,
-0.5526900978585952,
-0.5553607278390321,
-0.552202091175423,
-0.5513011557603358,
-0.551724809913859,
-0.557969686645222,
-0.551550521812726,
-0.540184256263457,
-0.5417126288426227,
-0.5387685006111772,
-0.5416429136021695,
-0.5381249753146864,
-0.5320141663534257,
-0.5335961660406323,
-0.5440239571991855,
-0.5536098027614966,
-0.5575272630038844,
-0.5537036502005682,
-0.557197456289433,
-0.560412401416485,
-0.5626861907974191,
-0.5649680242445595,
-0.5655391529451951,
-0.5657214851125342,
-0.567204274649865,
-0.5679872304272622,
-0.5698829486965081,
-0.5692474674662235,
-0.5708482366412443,
-0.5708938196830791,
-0.5687835929816697,
-0.5713147924812002,
-0.5735778564405263,
-0.574039049569678,
-0.5746503986013443,
-0.575883822086285,
-0.5751786256155471,
-0.5759696254591503,
-0.5764308185883021,
-0.5768088896999904,
-0.5765246660273737,
-0.5758167882012338,
-0.5773424794249975,
-0.5776320658084184,
-0.5776186590314081,
-0.5780584013173434,
-0.5780423131849312,
-0.5783640758331767,
-0.5784311097182278,
-0.5775998895435939,
-0.5793186383563047,
-0.5790210079066777,
-0.5786992452584323,
-0.5788654892933591,
-0.5802088483497836,
-0.579935350098775,
-0.5809998481933869,
-0.5796779399801788,
-0.5795063332344478,
-0.5792650112482637,
-0.5793829908859537,
-0.580350960186092,
-0.5801176822661142,
-0.5800077466946302,
-0.580058692447269,
-0.5785356825789075,
-0.5773558862020077,
-0.5779940487876944,
-0.5779323776134474,
-0.5764871270517451,
-0.5772459506305239,
-0.577251313341328,
-0.5786670689936076,
-0.5799058551893526,
-0.5810159363257992,
-0.580286607656443,
-0.5807558448518009,
-0.5800774619350835,
-0.5804421262697615,
-0.580115000910712,
-0.5798629535029198,
-0.5814047328590957,
-0.5811339159634892,
-0.5819597734273191,
-0.5853302371676897,
-0.5804903906669984,
-0.5799702077190017,
-0.579514377300654,
-0.5787877299866998,
-0.5809918041271808,
-0.582426329267275,
-0.5729557819872517,
-0.5724490058162652,
-0.5715748839551985,
-0.5705801011010398,
-0.5709823044113466,
-0.5703736367350823,
-0.5690195522570497,
-0.5708535993520484,
-0.5701886232123412,
-0.5716928635928885,
-0.5668878747124237,
-0.5669656340190831,
-0.566129051133645,
-0.5653943597534846,
-0.5666170578168173,
-0.5661692714646758,
-0.5664615392034987,
-0.5654801631263501,
-0.5645953158436753,
-0.5641394854253275,
-0.5626459704663884,
-0.5630615805537055,
-0.5631473839265709,
-0.5642708718400279,
-0.5644263904533464,
-0.5675716203399453,
-0.5674375525698431,
-0.5675903898277596,
-0.5668717865800115,
-0.5680489016015092,
-0.5674858169670798,
-0.5667162679666929,
-0.5670380306149383,
-0.5653434140008459,
-0.5648580886730756,
-0.5633645737141366,
-0.5582485476070346,
-0.5630562178429014,
-0.5650833225268475,
-0.5696201758671077,
-0.5692930505080581,
-0.5705774197456378,
-0.5695692301144688,
-0.5690865861421008,
-0.5720628906383708,
-0.5730523107817255,
-0.5736153954161548,
-0.572497270213502,
-0.5712102196205203,
-0.5728941108130047,
-0.5751544934169287,
-0.5744895172772215,
-0.5767928015675783,
-0.5769429574700927,
-0.5775864827665835,
-0.5763852355464674,
-0.5755861916366579,
-0.5763476965708388,
-0.5759535373267382,
-0.5758999102186972,
-0.575111591730496,
-0.5748488189010955,
-0.5744037139043561,
-0.5784042961642074,
-0.5793132756455006,
-0.5793481332657272,
-0.5804206754265453,
-0.5803616856077002,
-0.5806190957262966,
-0.5804984347332045,
-0.5805198855764209,
-0.5819168717408864,
-0.5814905362319612,
-0.5816272853574656,
-0.5817345395735473,
-0.5813886447266834,
-0.5813913260820855,
-0.5820053564691539,
-0.5802222551267938,
-0.5793266824225107,
-0.5784311097182278,
-0.5783104487251357,
-0.5783077673697338,
-0.5784579232722482,
-0.5782863165265174,
-0.577377337045224,
-0.5777688149339226,
-0.5774765471950998,
-0.5787314215232569,
-0.5790612282377083,
-0.5795840925411071,
-0.5791952960078106,
-0.5783694385439807,
-0.5784740114046605,
-0.5781817436658375,
-0.5782782724603112,
-0.5785839469761443,
-0.5770528930415766,
-0.5768303405432068,
-0.5771762353900707,
-0.5769268693376804,
-0.5763798728356633,
-0.5781361606240029,
-0.5802785635902368,
-0.5784659673384543,
-0.5776642420732429,
-0.5773880624668322,
-0.5786858384814221,
-0.5794366179939947,
-0.5784525605614441,
-0.5814583599671367,
-0.5814476345455285,
-0.5809274515975318,
-0.5826193868562222,
-0.5810695634338401,
-0.5798736789245279,
-0.5786724317044118,
-0.5792113841402229,
-0.5786992452584323,
-0.5815200311413837,
-0.5818793327652577,
-0.5818820141206598,
-0.5819892683367416,
-0.5804260381373494,
-0.5817935293923923,
-0.5826783766750671,
-0.5814235023469101,
-0.5782541402616928,
-0.5781576114672192,
-0.5784606046276503,
-0.5763262457276225,
-0.5758328763336461,
-0.5737709140294734,
-0.5730791243357458,
-0.5718403381400009,
-0.573746781830855,
-0.5736180767715569,
-0.5737387377646489,
-0.5754869814867823,
-0.576122462717067,
-0.5752429781451961,
-0.5766077880448371,
-0.5739720156846269,
-0.5755030696191946,
-0.5749480290509712,
-0.5757524356715847,
-0.5759481746159341,
-0.5702154367663618,
-0.5697006165291691,
-0.5717250398577131,
-0.5713469687460248,
-0.5714166839864778,
-0.5726367006944084,
-0.5650645530390331,
-0.5635549499476817,
-0.5647267022583754,
-0.5658126511962037,
-0.5657992444191935,
-0.5625682111597291,
-0.562316163751937,
-0.5632600008534567,
-0.5641394854253275,
-0.5680783965109317,
-0.5677056881100475,
-0.5686870641871961,
-0.5677137321762536,
-0.5686495252115674,
-0.5659949833635428,
-0.5677566338626864,
-0.5721701448544526,
-0.5734169751164034,
-0.5737306936984428,
-0.5783721198993828,
-0.578082533515962,
-0.5776320658084184,
-0.5777339573136961,
-0.57844719785064,
-0.5759910763023668,
-0.5761653644034996,
-0.5773558862020077,
-0.5782702283941051,
-0.576304794884406,
-0.5790236892620798,
-0.5787930926975039,
-0.5731300700883847,
-0.5785383639343096,
-0.5820992039082254,
-0.5830108647449207,
-0.582726641072304,
-0.5826649698980569,
-0.581890058186866,
-0.5805466991304413,
-0.5821018852636275,
-0.5838286781425445,
-0.5810534753014278,
-0.5806593160573272,
-0.5781790623104356,
-0.5805493804858435,
-0.5833755290795989,
-0.580527929642627,
-0.5789298418230081,
-0.5786456181503913,
-0.5712558026623552,
-0.5683518947619404,
-0.5737011987890203,
-0.5775972081881917,
-0.5789378858892142,
-0.5812653023781894,
-0.581482492165755,
-0.5834961900726909,
-0.581482492165755,
-0.5926127984396441,
-0.5884674229880824,
-0.5871910978167091,
-0.6097734730127325,
-0.5722344973841016,
-0.564461248073573,
-0.5507836541677411,
-0.548102298765696,
-0.5452868755935487,
-0.5413989102605834,
-0.5405945036399699,
-0.540835825626154,
-0.5405945036399699,
-0.5405945036399699,
-0.5427395879616059
]
},
{
"line": {
"color": "rgba(128, 0, 128, 1.0)",
"dash": "solid",
"width": 1.3
},
"mode": "lines",
"name": "close_RS",
"text": "",
"type": "scatter",
"x": [
"2018-04-23",
"2018-04-22",
"2018-04-21",
"2018-04-20",
"2018-04-19",
"2018-04-18",
"2018-04-17",
"2018-04-16",
"2018-04-15",
"2018-04-14",
"2018-04-13",
"2018-04-12",
"2018-04-11",
"2018-04-10",
"2018-04-09",
"2018-04-08",
"2018-04-07",
"2018-04-06",
"2018-04-05",
"2018-04-04",
"2018-04-03",
"2018-04-02",
"2018-04-01",
"2018-03-31",
"2018-03-30",
"2018-03-29",
"2018-03-28",
"2018-03-27",
"2018-03-26",
"2018-03-25",
"2018-03-24",
"2018-03-23",
"2018-03-22",
"2018-03-21",
"2018-03-20",
"2018-03-19",
"2018-03-18",
"2018-03-17",
"2018-03-16",
"2018-03-15",
"2018-03-14",
"2018-03-13",
"2018-03-12",
"2018-03-11",
"2018-03-10",
"2018-03-09",
"2018-03-08",
"2018-03-07",
"2018-03-06",
"2018-03-05",
"2018-03-04",
"2018-03-03",
"2018-03-02",
"2018-03-01",
"2018-02-28",
"2018-02-27",
"2018-02-26",
"2018-02-25",
"2018-02-24",
"2018-02-23",
"2018-02-22",
"2018-02-21",
"2018-02-20",
"2018-02-19",
"2018-02-18",
"2018-02-17",
"2018-02-16",
"2018-02-15",
"2018-02-14",
"2018-02-13",
"2018-02-12",
"2018-02-11",
"2018-02-10",
"2018-02-09",
"2018-02-08",
"2018-02-07",
"2018-02-06",
"2018-02-05",
"2018-02-04",
"2018-02-03",
"2018-02-02",
"2018-02-01",
"2018-01-31",
"2018-01-30",
"2018-01-29",
"2018-01-28",
"2018-01-27",
"2018-01-26",
"2018-01-25",
"2018-01-24",
"2018-01-23",
"2018-01-22",
"2018-01-21",
"2018-01-20",
"2018-01-19",
"2018-01-18",
"2018-01-17",
"2018-01-16",
"2018-01-15",
"2018-01-14",
"2018-01-13",
"2018-01-12",
"2018-01-11",
"2018-01-10",
"2018-01-09",
"2018-01-08",
"2018-01-07",
"2018-01-06",
"2018-01-05",
"2018-01-04",
"2018-01-03",
"2018-01-02",
"2018-01-01",
"2017-12-31",
"2017-12-30",
"2017-12-29",
"2017-12-28",
"2017-12-27",
"2017-12-26",
"2017-12-25",
"2017-12-24",
"2017-12-23",
"2017-12-22",
"2017-12-21",
"2017-12-20",
"2017-12-19",
"2017-12-18",
"2017-12-17",
"2017-12-16",
"2017-12-15",
"2017-12-14",
"2017-12-13",
"2017-12-12",
"2017-12-11",
"2017-12-10",
"2017-12-09",
"2017-12-08",
"2017-12-07",
"2017-12-06",
"2017-12-05",
"2017-12-04",
"2017-12-03",
"2017-12-02",
"2017-12-01",
"2017-11-30",
"2017-11-29",
"2017-11-28",
"2017-11-27",
"2017-11-26",
"2017-11-25",
"2017-11-24",
"2017-11-23",
"2017-11-22",
"2017-11-21",
"2017-11-20",
"2017-11-19",
"2017-11-18",
"2017-11-17",
"2017-11-16",
"2017-11-15",
"2017-11-14",
"2017-11-13",
"2017-11-12",
"2017-11-11",
"2017-11-10",
"2017-11-09",
"2017-11-08",
"2017-11-07",
"2017-11-06",
"2017-11-05",
"2017-11-04",
"2017-11-03",
"2017-11-02",
"2017-11-01",
"2017-10-31",
"2017-10-30",
"2017-10-29",
"2017-10-28",
"2017-10-27",
"2017-10-26",
"2017-10-25",
"2017-10-24",
"2017-10-23",
"2017-10-22",
"2017-10-21",
"2017-10-20",
"2017-10-19",
"2017-10-18",
"2017-10-17",
"2017-10-16",
"2017-10-15",
"2017-10-14",
"2017-10-13",
"2017-10-12",
"2017-10-11",
"2017-10-10",
"2017-10-09",
"2017-10-08",
"2017-10-07",
"2017-10-06",
"2017-10-05",
"2017-10-04",
"2017-10-03",
"2017-10-02",
"2017-10-01",
"2017-09-30",
"2017-09-29",
"2017-09-28",
"2017-09-27",
"2017-09-26",
"2017-09-25",
"2017-09-24",
"2017-09-23",
"2017-09-22",
"2017-09-21",
"2017-09-20",
"2017-09-19",
"2017-09-18",
"2017-09-17",
"2017-09-16",
"2017-09-15",
"2017-09-14",
"2017-09-13",
"2017-09-12",
"2017-09-11",
"2017-09-10",
"2017-09-09",
"2017-09-08",
"2017-09-07",
"2017-09-06",
"2017-09-05",
"2017-09-04",
"2017-09-03",
"2017-09-02",
"2017-09-01",
"2017-08-31",
"2017-08-30",
"2017-08-29",
"2017-08-28",
"2017-08-27",
"2017-08-26",
"2017-08-25",
"2017-08-24",
"2017-08-23",
"2017-08-22",
"2017-08-21",
"2017-08-20",
"2017-08-19",
"2017-08-18",
"2017-08-17",
"2017-08-16",
"2017-08-15",
"2017-08-14",
"2017-08-13",
"2017-08-12",
"2017-08-11",
"2017-08-10",
"2017-08-09",
"2017-08-08",
"2017-08-07",
"2017-08-06",
"2017-08-05",
"2017-08-04",
"2017-08-03",
"2017-08-02",
"2017-08-01",
"2017-07-31",
"2017-07-30",
"2017-07-29",
"2017-07-28",
"2017-07-27",
"2017-07-26",
"2017-07-25",
"2017-07-24",
"2017-07-23",
"2017-07-22",
"2017-07-21",
"2017-07-20",
"2017-07-19",
"2017-07-18",
"2017-07-17",
"2017-07-16",
"2017-07-15",
"2017-07-14",
"2017-07-13",
"2017-07-12",
"2017-07-11",
"2017-07-10",
"2017-07-09",
"2017-07-08",
"2017-07-07",
"2017-07-06",
"2017-07-05",
"2017-07-04",
"2017-07-03",
"2017-07-02",
"2017-07-01",
"2017-06-30",
"2017-06-29",
"2017-06-28",
"2017-06-27",
"2017-06-26",
"2017-06-25",
"2017-06-24",
"2017-06-23",
"2017-06-22",
"2017-06-21",
"2017-06-20",
"2017-06-19",
"2017-06-18",
"2017-06-17",
"2017-06-16",
"2017-06-15",
"2017-06-14",
"2017-06-13",
"2017-06-12",
"2017-06-11",
"2017-06-10",
"2017-06-09",
"2017-06-08",
"2017-06-07",
"2017-06-06",
"2017-06-05",
"2017-06-04",
"2017-06-03",
"2017-06-02",
"2017-06-01",
"2017-05-31",
"2017-05-30",
"2017-05-29",
"2017-05-28",
"2017-05-27",
"2017-05-26",
"2017-05-25",
"2017-05-24",
"2017-05-23",
"2017-05-22",
"2017-05-21",
"2017-05-20",
"2017-05-19",
"2017-05-18",
"2017-05-17",
"2017-05-16",
"2017-05-15",
"2017-05-14",
"2017-05-13",
"2017-05-12",
"2017-05-11",
"2017-05-10",
"2017-05-09",
"2017-05-08",
"2017-05-07",
"2017-05-06",
"2017-05-05",
"2017-05-04",
"2017-05-03",
"2017-05-02",
"2017-05-01",
"2017-04-30",
"2017-04-29",
"2017-04-28",
"2017-04-27",
"2017-04-26",
"2017-04-25",
"2017-04-24",
"2017-04-23",
"2017-04-22",
"2017-04-21",
"2017-04-20",
"2017-04-19",
"2017-04-18",
"2017-04-17",
"2017-04-16",
"2017-04-15",
"2017-04-14",
"2017-04-13",
"2017-04-12",
"2017-04-11",
"2017-04-10",
"2017-04-09",
"2017-04-08",
"2017-04-07",
"2017-04-06",
"2017-04-05",
"2017-04-04",
"2017-04-03",
"2017-04-02",
"2017-04-01",
"2017-03-31",
"2017-03-30",
"2017-03-29",
"2017-03-28",
"2017-03-27",
"2017-03-26",
"2017-03-25",
"2017-03-24",
"2017-03-23",
"2017-03-22",
"2017-03-21",
"2017-03-20",
"2017-03-19",
"2017-03-18",
"2017-03-17",
"2017-03-16",
"2017-03-15",
"2017-03-14",
"2017-03-13",
"2017-03-12",
"2017-03-11",
"2017-03-10",
"2017-03-09",
"2017-03-08",
"2017-03-07",
"2017-03-06",
"2017-03-05",
"2017-03-04",
"2017-03-03",
"2017-03-02",
"2017-03-01",
"2017-02-28",
"2017-02-27",
"2017-02-26",
"2017-02-25",
"2017-02-24",
"2017-02-23",
"2017-02-22",
"2017-02-21",
"2017-02-20",
"2017-02-19",
"2017-02-18",
"2017-02-17",
"2017-02-16",
"2017-02-15",
"2017-02-14",
"2017-02-13",
"2017-02-12",
"2017-02-11",
"2017-02-10",
"2017-02-09",
"2017-02-08",
"2017-02-07",
"2017-02-06",
"2017-02-05",
"2017-02-04",
"2017-02-03",
"2017-02-02",
"2017-02-01",
"2017-01-31",
"2017-01-30",
"2017-01-29",
"2017-01-28",
"2017-01-27",
"2017-01-26",
"2017-01-25",
"2017-01-24",
"2017-01-23",
"2017-01-22",
"2017-01-21",
"2017-01-20",
"2017-01-19",
"2017-01-18",
"2017-01-17",
"2017-01-16",
"2017-01-15",
"2017-01-14",
"2017-01-13",
"2017-01-12",
"2017-01-11",
"2017-01-10",
"2017-01-09",
"2017-01-08",
"2017-01-07",
"2017-01-06",
"2017-01-05",
"2017-01-04",
"2017-01-03",
"2017-01-02",
"2017-01-01",
"2016-12-31",
"2016-12-30",
"2016-12-29",
"2016-12-28",
"2016-12-27",
"2016-12-26",
"2016-12-25",
"2016-12-24",
"2016-12-23",
"2016-12-22",
"2016-12-21",
"2016-12-20",
"2016-12-19",
"2016-12-18",
"2016-12-17",
"2016-12-16",
"2016-12-15",
"2016-12-14",
"2016-12-13",
"2016-12-12",
"2016-12-11",
"2016-12-10",
"2016-12-09",
"2016-12-08",
"2016-12-07",
"2016-12-06",
"2016-12-05",
"2016-12-04",
"2016-12-03",
"2016-12-02",
"2016-12-01",
"2016-11-30",
"2016-11-29",
"2016-11-28",
"2016-11-27",
"2016-11-26",
"2016-11-25",
"2016-11-24",
"2016-11-23",
"2016-11-22",
"2016-11-21",
"2016-11-20",
"2016-11-19",
"2016-11-18",
"2016-11-17",
"2016-11-16",
"2016-11-15",
"2016-11-14",
"2016-11-13",
"2016-11-12",
"2016-11-11",
"2016-11-10",
"2016-11-09",
"2016-11-08",
"2016-11-07",
"2016-11-06",
"2016-11-05",
"2016-11-04",
"2016-11-03",
"2016-11-02",
"2016-11-01",
"2016-10-31",
"2016-10-30",
"2016-10-29",
"2016-10-28",
"2016-10-27",
"2016-10-26",
"2016-10-25",
"2016-10-24",
"2016-10-23",
"2016-10-22",
"2016-10-21",
"2016-10-20",
"2016-10-19",
"2016-10-18",
"2016-10-17",
"2016-10-16",
"2016-10-15",
"2016-10-14",
"2016-10-13",
"2016-10-12",
"2016-10-11",
"2016-10-10",
"2016-10-09",
"2016-10-08",
"2016-10-07",
"2016-10-06",
"2016-10-05",
"2016-10-04",
"2016-10-03",
"2016-10-02",
"2016-10-01",
"2016-09-30",
"2016-09-29",
"2016-09-28",
"2016-09-27",
"2016-09-26",
"2016-09-25",
"2016-09-24",
"2016-09-23",
"2016-09-22",
"2016-09-21",
"2016-09-20",
"2016-09-19",
"2016-09-18",
"2016-09-17",
"2016-09-16",
"2016-09-15",
"2016-09-14",
"2016-09-13",
"2016-09-12",
"2016-09-11",
"2016-09-10",
"2016-09-09",
"2016-09-08",
"2016-09-07",
"2016-09-06",
"2016-09-05",
"2016-09-04",
"2016-09-03",
"2016-09-02",
"2016-09-01",
"2016-08-31",
"2016-08-30",
"2016-08-29",
"2016-08-28",
"2016-08-27",
"2016-08-26",
"2016-08-25",
"2016-08-24",
"2016-08-23",
"2016-08-22",
"2016-08-21",
"2016-08-20",
"2016-08-19",
"2016-08-18",
"2016-08-17",
"2016-08-16",
"2016-08-15",
"2016-08-14",
"2016-08-13",
"2016-08-12",
"2016-08-11",
"2016-08-10",
"2016-08-09",
"2016-08-08",
"2016-08-07",
"2016-08-06",
"2016-08-05",
"2016-08-04",
"2016-08-03",
"2016-08-02",
"2016-08-01",
"2016-07-31",
"2016-07-30",
"2016-07-29",
"2016-07-28",
"2016-07-27",
"2016-07-26",
"2016-07-25",
"2016-07-24",
"2016-07-23",
"2016-07-22",
"2016-07-21",
"2016-07-20",
"2016-07-19",
"2016-07-18",
"2016-07-17",
"2016-07-16",
"2016-07-15",
"2016-07-14",
"2016-07-13",
"2016-07-12",
"2016-07-11",
"2016-07-10",
"2016-07-09",
"2016-07-08",
"2016-07-07",
"2016-07-06",
"2016-07-05",
"2016-07-04",
"2016-07-03",
"2016-07-02",
"2016-07-01",
"2016-06-30",
"2016-06-29",
"2016-06-28",
"2016-06-27",
"2016-06-26",
"2016-06-25",
"2016-06-24",
"2016-06-23",
"2016-06-22",
"2016-06-21",
"2016-06-20",
"2016-06-19",
"2016-06-18",
"2016-06-17",
"2016-06-16",
"2016-06-15",
"2016-06-14",
"2016-06-13",
"2016-06-12",
"2016-06-11",
"2016-06-10",
"2016-06-09",
"2016-06-08",
"2016-06-07",
"2016-06-06",
"2016-06-05",
"2016-06-04",
"2016-06-03",
"2016-06-02",
"2016-06-01",
"2016-05-31",
"2016-05-30",
"2016-05-29",
"2016-05-28",
"2016-05-27",
"2016-05-26",
"2016-05-25",
"2016-05-24",
"2016-05-23",
"2016-05-22",
"2016-05-21",
"2016-05-20",
"2016-05-19",
"2016-05-18",
"2016-05-17",
"2016-05-16",
"2016-05-15",
"2016-05-14",
"2016-05-13",
"2016-05-12",
"2016-05-11",
"2016-05-10",
"2016-05-09",
"2016-05-08",
"2016-05-07",
"2016-05-06",
"2016-05-05",
"2016-05-04",
"2016-05-03",
"2016-05-02",
"2016-05-01",
"2016-04-30",
"2016-04-29",
"2016-04-28",
"2016-04-27",
"2016-04-26",
"2016-04-25",
"2016-04-24",
"2016-04-23",
"2016-04-22",
"2016-04-21",
"2016-04-20",
"2016-04-19",
"2016-04-18",
"2016-04-17",
"2016-04-16",
"2016-04-15",
"2016-04-14",
"2016-04-13",
"2016-04-12",
"2016-04-11",
"2016-04-10",
"2016-04-09",
"2016-04-08",
"2016-04-07",
"2016-04-06",
"2016-04-05",
"2016-04-04",
"2016-04-03",
"2016-04-02",
"2016-04-01",
"2016-03-31",
"2016-03-30",
"2016-03-29",
"2016-03-28",
"2016-03-27",
"2016-03-26",
"2016-03-25",
"2016-03-24",
"2016-03-23",
"2016-03-22",
"2016-03-21",
"2016-03-20",
"2016-03-19",
"2016-03-18",
"2016-03-17",
"2016-03-16",
"2016-03-15",
"2016-03-14",
"2016-03-13",
"2016-03-12",
"2016-03-11",
"2016-03-10",
"2016-03-09",
"2016-03-08",
"2016-03-07",
"2016-03-06",
"2016-03-05",
"2016-03-04",
"2016-03-03",
"2016-03-02",
"2016-03-01",
"2016-02-29",
"2016-02-28",
"2016-02-27",
"2016-02-26",
"2016-02-25",
"2016-02-24",
"2016-02-23",
"2016-02-22",
"2016-02-21",
"2016-02-20",
"2016-02-19",
"2016-02-18",
"2016-02-17",
"2016-02-16",
"2016-02-15",
"2016-02-14",
"2016-02-13",
"2016-02-12",
"2016-02-11",
"2016-02-10",
"2016-02-09",
"2016-02-08",
"2016-02-07",
"2016-02-06",
"2016-02-05",
"2016-02-04",
"2016-02-03",
"2016-02-02",
"2016-02-01",
"2016-01-31",
"2016-01-30",
"2016-01-29",
"2016-01-28",
"2016-01-27",
"2016-01-26",
"2016-01-25",
"2016-01-24",
"2016-01-23",
"2016-01-22",
"2016-01-21",
"2016-01-20",
"2016-01-19",
"2016-01-18",
"2016-01-17",
"2016-01-16",
"2016-01-15",
"2016-01-14",
"2016-01-13",
"2016-01-12",
"2016-01-11",
"2016-01-10",
"2016-01-09",
"2016-01-08",
"2016-01-07",
"2016-01-06",
"2016-01-05",
"2016-01-04",
"2016-01-03",
"2016-01-02",
"2016-01-01",
"2015-12-31",
"2015-12-30",
"2015-12-29",
"2015-12-28",
"2015-12-27",
"2015-12-26",
"2015-12-25",
"2015-12-24",
"2015-12-23",
"2015-12-22",
"2015-12-21",
"2015-12-20",
"2015-12-19",
"2015-12-18",
"2015-12-17",
"2015-12-16",
"2015-12-15",
"2015-12-14",
"2015-12-13",
"2015-12-12",
"2015-12-11",
"2015-12-10",
"2015-12-09",
"2015-12-08",
"2015-12-07",
"2015-12-06",
"2015-12-05",
"2015-12-04",
"2015-12-03",
"2015-12-02",
"2015-12-01",
"2015-11-30",
"2015-11-29",
"2015-11-28",
"2015-11-27",
"2015-11-26",
"2015-11-25",
"2015-11-24",
"2015-11-23",
"2015-11-22",
"2015-11-21",
"2015-11-20",
"2015-11-19",
"2015-11-18",
"2015-11-17",
"2015-11-16",
"2015-11-15",
"2015-11-14",
"2015-11-13",
"2015-11-12",
"2015-11-11",
"2015-11-10",
"2015-11-09",
"2015-11-08",
"2015-11-07",
"2015-11-06",
"2015-11-05",
"2015-11-04",
"2015-11-03",
"2015-11-02",
"2015-11-01",
"2015-10-31",
"2015-10-30",
"2015-10-29",
"2015-10-28",
"2015-10-27",
"2015-10-26",
"2015-10-25",
"2015-10-24",
"2015-10-23",
"2015-10-22",
"2015-10-21",
"2015-10-20",
"2015-10-19",
"2015-10-18",
"2015-10-17",
"2015-10-16",
"2015-10-15",
"2015-10-14",
"2015-10-13",
"2015-10-12",
"2015-10-11",
"2015-10-10",
"2015-10-09",
"2015-10-08",
"2015-10-07",
"2015-10-06",
"2015-10-05",
"2015-10-04",
"2015-10-03",
"2015-10-02",
"2015-10-01",
"2015-09-30",
"2015-09-29",
"2015-09-28",
"2015-09-27",
"2015-09-26",
"2015-09-25",
"2015-09-24",
"2015-09-23",
"2015-09-22",
"2015-09-21",
"2015-09-20",
"2015-09-19",
"2015-09-18",
"2015-09-17",
"2015-09-16",
"2015-09-15",
"2015-09-14",
"2015-09-13",
"2015-09-12",
"2015-09-11",
"2015-09-10",
"2015-09-09",
"2015-09-08",
"2015-09-07",
"2015-09-06",
"2015-09-05",
"2015-09-04",
"2015-09-03",
"2015-09-02",
"2015-09-01",
"2015-08-31",
"2015-08-30",
"2015-08-29",
"2015-08-28",
"2015-08-27",
"2015-08-26",
"2015-08-25",
"2015-08-24",
"2015-08-23",
"2015-08-22",
"2015-08-21",
"2015-08-20",
"2015-08-19",
"2015-08-18",
"2015-08-17",
"2015-08-16",
"2015-08-15",
"2015-08-14",
"2015-08-13",
"2015-08-12",
"2015-08-11",
"2015-08-10",
"2015-08-09",
"2015-08-08",
"2015-08-07",
"2015-08-06",
"2015-08-05",
"2015-08-04",
"2015-08-03",
"2015-08-02",
"2015-08-01",
"2015-07-31",
"2015-07-30",
"2015-07-29",
"2015-07-28",
"2015-07-27",
"2015-07-26",
"2015-07-25",
"2015-07-24",
"2015-07-23",
"2015-07-22",
"2015-07-21",
"2015-07-20",
"2015-07-19",
"2015-07-18",
"2015-07-17",
"2015-07-16",
"2015-07-15",
"2015-07-14",
"2015-07-13",
"2015-07-12",
"2015-07-11",
"2015-07-10",
"2015-07-09",
"2015-07-08",
"2015-07-07",
"2015-07-06",
"2015-07-05",
"2015-07-04",
"2015-07-03",
"2015-07-02",
"2015-07-01",
"2015-06-30",
"2015-06-29",
"2015-06-28",
"2015-06-27",
"2015-06-26",
"2015-06-25",
"2015-06-24",
"2015-06-23",
"2015-06-22",
"2015-06-21",
"2015-06-20",
"2015-06-19",
"2015-06-18",
"2015-06-17",
"2015-06-16",
"2015-06-15",
"2015-06-14",
"2015-06-13",
"2015-06-12",
"2015-06-11",
"2015-06-10",
"2015-06-09",
"2015-06-08",
"2015-06-07",
"2015-06-06",
"2015-06-05",
"2015-06-04",
"2015-06-03",
"2015-06-02",
"2015-06-01",
"2015-05-31",
"2015-05-30",
"2015-05-29",
"2015-05-28",
"2015-05-27",
"2015-05-26",
"2015-05-25",
"2015-05-24",
"2015-05-23",
"2015-05-22",
"2015-05-21",
"2015-05-20",
"2015-05-19",
"2015-05-18",
"2015-05-17",
"2015-05-16",
"2015-05-15",
"2015-05-14",
"2015-05-13",
"2015-05-12",
"2015-05-11",
"2015-05-10",
"2015-05-09",
"2015-05-08",
"2015-05-07",
"2015-05-06",
"2015-05-05",
"2015-05-04",
"2015-05-03",
"2015-05-02",
"2015-05-01",
"2015-04-30",
"2015-04-29",
"2015-04-28",
"2015-04-27",
"2015-04-26",
"2015-04-25",
"2015-04-24",
"2015-04-23",
"2015-04-22",
"2015-04-21",
"2015-04-20",
"2015-04-19",
"2015-04-18",
"2015-04-17",
"2015-04-16",
"2015-04-15",
"2015-04-14",
"2015-04-13",
"2015-04-12",
"2015-04-11",
"2015-04-10",
"2015-04-09",
"2015-04-08",
"2015-04-07",
"2015-04-06",
"2015-04-05",
"2015-04-04",
"2015-04-03",
"2015-04-02",
"2015-04-01",
"2015-03-31",
"2015-03-30",
"2015-03-29",
"2015-03-28",
"2015-03-27",
"2015-03-26",
"2015-03-25",
"2015-03-24",
"2015-03-23",
"2015-03-22",
"2015-03-21",
"2015-03-20",
"2015-03-19",
"2015-03-18",
"2015-03-17",
"2015-03-16",
"2015-03-15",
"2015-03-14",
"2015-03-13",
"2015-03-12",
"2015-03-11",
"2015-03-10",
"2015-03-09",
"2015-03-08",
"2015-03-07",
"2015-03-06",
"2015-03-05",
"2015-03-04",
"2015-03-03",
"2015-03-02",
"2015-03-01",
"2015-02-28",
"2015-02-27",
"2015-02-26",
"2015-02-25",
"2015-02-24",
"2015-02-23",
"2015-02-22",
"2015-02-21",
"2015-02-20",
"2015-02-19",
"2015-02-18",
"2015-02-17",
"2015-02-16",
"2015-02-15",
"2015-02-14",
"2015-02-13",
"2015-02-12",
"2015-02-11",
"2015-02-10",
"2015-02-09",
"2015-02-08",
"2015-02-07",
"2015-02-06",
"2015-02-05",
"2015-02-04",
"2015-02-03",
"2015-02-02",
"2015-02-01",
"2015-01-31",
"2015-01-30",
"2015-01-29",
"2015-01-28",
"2015-01-27",
"2015-01-26",
"2015-01-25",
"2015-01-24",
"2015-01-23",
"2015-01-22",
"2015-01-21",
"2015-01-20",
"2015-01-19",
"2015-01-17",
"2015-01-16",
"2015-01-15",
"2015-01-14",
"2015-01-13",
"2015-01-08",
"2014-12-18",
"2014-12-12",
"2014-12-10",
"2014-12-08",
"2014-12-06",
"2014-12-04",
"2014-12-03",
"2014-12-02",
"2014-12-01"
],
"y": [
3.7661665180926738,
3.7111471428311535,
3.7659118198191646,
3.743557498135245,
3.474182236614696,
3.418717139374534,
3.3004871104480875,
3.371816271581131,
3.51113622719086,
3.350976494987902,
3.3009828624447395,
3.3113572689067987,
2.868814470500482,
2.8151459057252533,
2.7906493896337805,
2.903844579474958,
2.846537467935307,
2.7214624229082904,
2.7973443156803177,
2.7999959066348903,
3.087995979405825,
2.9152150381137774,
2.8110616369821897,
2.8622241526734222,
2.8256158240398785,
2.9311245838412137,
3.3235100150999695,
3.2556920515945933,
3.415510670038387,
3.5555765277348224,
3.59122518965925,
3.771224098095221,
3.6747980606545747,
3.7551735586806627,
3.7588985209307406,
3.5759705823494095,
3.436887132279368,
3.288170629650518,
3.474637054960249,
3.4678102315935018,
3.4437230520130266,
3.8705154911128496,
3.8589585569523535,
4.047198773809741,
3.7113427147197413,
3.9203590336019793,
3.9430544690450633,
4.222813233394582,
4.577571542925756,
4.885729164771591,
4.927736187166846,
4.910725981043171,
4.714017046591591,
4.666679553186458,
4.39895073407681,
4.516885131078647,
4.395644204704642,
4.076357177943129,
4.117577364600579,
4.325142812960504,
4.181879582294831,
4.46580903087307,
4.821158604253461,
4.777691614968981,
4.432047865082686,
4.7692774755762555,
4.335376225735441,
4.273402677970418,
4.019500336565576,
3.5860720978041374,
3.7462909563920177,
3.3827592009751304,
3.5985705059399278,
3.654749667982608,
3.4487578910982957,
3.156605326832463,
3.207867902559718,
2.8516223370385867,
3.425930558335001,
3.913536758418688,
3.7077405534229633,
3.810852420543235,
4.304675987410628,
4.256924609311041,
4.76996425127804,
4.957799679807885,
4.859104098822931,
4.753536212636673,
4.7676856113668205,
4.87629168410137,
4.634396547019121,
4.607907926574127,
4.949690268706679,
5.515770826132043,
4.940966852838976,
4.852977695708335,
4.804985263885604,
4.973268051740136,
5.891996561573308,
5.922119180599269,
6.163955191296597,
5.996604781050449,
5.763765077228155,
6.476520002910838,
6.297235159277385,
6.530443265959576,
7.067347226517729,
7.4879495879345805,
7.424738934269652,
6.599234540724435,
6.577926301235287,
6.433917168482909,
5.8419710917459575,
6.0162210962941405,
5.550878254225263,
6.335467189404552,
6.28314488693216,
6.700245147088253,
6.892997161933524,
6.156691742318118,
6.179414466861936,
6.567806593046737,
6.174243182273,
6.878406589408191,
7.214103462077246,
7.824396910873798,
8.370306274673895,
8.524935415794934,
8.648200283806649,
7.778887787217785,
7.32912247348409,
7.30175605363218,
7.77499909036331,
7.390968672112358,
6.6651922971965005,
6.674275019557189,
7.155040751723762,
7.620310822857351,
6.1194057343497015,
5.040735805119436,
5.006910964760674,
4.8459143668019,
4.682288918805829,
4.654817890734441,
4.215081321520185,
4.230081230556515,
4.236002965415613,
4.154003765895901,
3.9868125420706972,
3.711370003820474,
3.4473525024105376,
3.3637341495806576,
3.4632665963214295,
3.3991372095984866,
3.4660000545782017,
3.3640343296887223,
3.248142067058417,
3.2198068841304783,
3.276122491676824,
3.0284602579729656,
2.715090417887096,
2.6836488256590316,
2.3882352138555865,
2.597610839230811,
2.7026374915858606,
2.9656953262866814,
3.1075804573653283,
2.952337311477796,
2.8809899576109306,
3.0730324558371387,
3.0823789728382485,
2.972067331307876,
2.912927301835647,
2.7963619080539233,
2.6423240307821056,
2.496395564611494,
2.503604435388506,
2.3271349173140248,
2.3398652828060476,
2.3906275583531937,
2.3216589044335696,
2.2240821765786745,
2.397167846162243,
2.442222151472702,
2.4512321028981026,
2.434967798861135,
2.305303636727491,
2.2463728236942164,
2.2552690705332292,
2.3284493423326724,
2.3006144595848417,
2.357662324667528,
2.269277475576255,
2.1852270453181,
1.900961031164153,
1.8714023868866776,
1.8802940855422345,
1.8047669510797386,
1.723586424582022,
1.6953831389742935,
1.6758486910328014,
1.6280018010806485,
1.6703681299688904,
1.7089003402041225,
1.7098554587297836,
1.6844720468644823,
1.6016905597904196,
1.6164403187366967,
1.621252296832645,
1.4780254516346172,
1.4938031000418437,
1.3797483035275713,
1.4335624101733768,
1.357007386249932,
1.3563069659977807,
1.4720991685920646,
1.4894050066403481,
1.5757704622773665,
1.4029258464169412,
1.4059003583968563,
1.4120449542452747,
1.1893567958957194,
1.4644855094875109,
1.6051153419324324,
1.6261279494969711,
1.644611767060236,
1.6823616897411173,
1.689475048665563,
1.8141771426492261,
1.8105385958848037,
1.7270021103571236,
1.7569018683937636,
1.8150276529554097,
1.8259160041479432,
1.9614518711226736,
1.8686461877126275,
1.794983808466898,
1.8027248167082068,
1.705389142576455,
1.6849768952280457,
1.6868916804628231,
1.6940232321210908,
1.6722055960849236,
1.595550512125457,
1.572131915512944,
1.5311982644131934,
1.5534798151618243,
1.6018815834955518,
1.5765527498317173,
1.6576423126603237,
1.6985759637600744,
1.603027725726345,
1.6761033893063113,
1.5577914930776648,
1.4729815161824367,
1.3738993396037624,
1.2778553495733806,
1.2313820110247968,
1.2675991958811652,
1.256592591918788,
1.1765400149180418,
1.1862140011279494,
1.010585896992741,
0.9786030709334693,
0.9389792966689107,
0.9538473083850311,
1.0103766805537868,
0.9499358706132769,
0.9391202903560318,
0.9781709935051943,
0.9231015882256627,
0.8598818381938254,
0.8771694835082868,
0.9673417686975823,
0.9637123183000712,
0.9959998726508634,
0.9196722579001947,
1.0179266650899632,
0.7384453399312314,
0.7608042097986065,
0.7276206633070752,
0.5805278621718486,
0.6044194698637364,
0.7194566740044026,
0.7752901741044628,
0.7950383866683648,
0.7616501719213348,
0.7712195499117653,
0.852149926319428,
0.8758550584896394,
0.8485841504902942,
0.8957442647406627,
0.9012566630887624,
0.8944525806392928,
0.8673499554278021,
0.8556383830298179,
0.8133266323430423,
0.8276806993286883,
0.8617056597594921,
0.8722210599086725,
0.8825135990685321,
0.8061768879509524,
0.8506126403114598,
0.8820997143740791,
0.934822256990558,
0.9299238634089544,
0.9132593192279004,
0.9504316226099295,
0.8921693925446178,
0.8549970891625885,
0.9094342969418016,
0.8391603143704405,
0.8071183619262468,
0.8172289737478852,
0.9431226917968963,
0.9188808739789329,
1.075006367456838,
1.0441560390779925,
0.9896869940145907,
0.9843838121054452,
0.9324935870613278,
1.0169306129132025,
0.9381151418123601,
0.8577760292539162,
0.86991513089672,
0.8385053759528444,
0.81167109356523,
0.7585937926392199,
0.7077860352575182,
0.7477645678316082,
0.726524551094293,
0.6661292229883384,
0.7446808994487601,
0.7821124492877546,
0.8175746356905051,
0.7447036403660379,
0.6767264904397184,
0.6465765823130243,
0.64744528535303,
0.6098409045427257,
0.5747880546509725,
0.5357055142176216,
0.5194457583641094,
0.5059512980515583,
0.5296837193225027,
0.5263817381337894,
0.48220978041370277,
0.5469395273527754,
0.5274096275947388,
0.493498371750323,
0.49011907144286576,
0.44307720996234107,
0.43207970236687476,
0.4165749449669802,
0.42207369876471346,
0.40825176924336426,
0.38050330198118876,
0.36436179889752035,
0.3407339858460531,
0.3320378590790839,
0.3265391052813506,
0.32468344643149527,
0.3015695781105027,
0.2937103170993506,
0.2828538031910055,
0.2804387177761202,
0.2781737224152674,
0.2795336292684702,
0.27323894336601967,
0.26326022886459155,
0.25767960776465887,
0.2522081430676588,
0.2467867083886696,
0.24717785216584495,
0.24485373042007025,
0.24635917914384994,
0.2632420361307694,
0.2677083522840978,
0.26134544362981427,
0.2617866174250005,
0.24974757581821821,
0.2540683501009697,
0.25329515891352994,
0.2263198828387942,
0.23132288463987485,
0.2352388705950843,
0.21767833427329128,
0.2076768788545855,
0.20630787563447162,
0.1850905998144341,
0.18551358087579822,
0.1864823439518257,
0.18497234704459037,
0.15358988120144818,
0.1493327814870741,
0.13621127221787618,
0.17726772427092624,
0.18155666126948897,
0.217873906161879,
0.18628222387978244,
0.17469800061855298,
0.1521890406971456,
0.19747530336383648,
0.24547683155347752,
0.2854508159441119,
0.2783647461203996,
0.2774869467134827,
0.2729796969090545,
0.25138947004566375,
0.21541333891243838,
0.2555692506412939,
0.23415640293266873,
0.27378927356413846,
0.2954522713628177,
0.2927188131060455,
0.290440173194826,
0.2990316917423181,
0.2882570451361727,
0.27044181054087,
0.2545595539141667,
0.2548915713064202,
0.2499340513398949,
0.2376948896610694,
0.2508436880310005,
0.25083913984754497,
0.2243732603198283,
0.2241822366146961,
0.20668537486128039,
0.19306811359543005,
0.19410055123983486,
0.1918946822639038,
0.18354421743955468,
0.17244210162461113,
0.17216466243382392,
0.16711617879818805,
0.170381774519257,
0.1743159532082886,
0.16673867957137922,
0.1632138373933451,
0.19162179125657217,
0.19037558898975754,
0.1761033893063111,
0.17325622646315067,
0.18199783506467518,
0.1740203212836793,
0.1696449687994615,
0.16253615805847146,
0.1521935888806011,
0.13091718667564178,
0.1278744519438936,
0.13171311878035916,
0.1306442956683101,
0.12809276474975895,
0.11853248312623939,
0.11443911801626432,
0.12521831280586537,
0.13455118525660853,
0.13174950424800333,
0.11776384012225516,
0.12167982607746465,
0.11488938817836158,
0.12308066658176725,
0.09052022122364327,
0.09001992104353519,
0.08760483562864993,
0.08916031437044043,
0.08044144668619355,
0.07294604035148362,
0.12353548492732004,
0.12156157330762093,
0.13096266851019706,
0.12444512161842561,
0.11840058580602911,
0.16901731948259865,
0.22509642148925718,
0.17523468626630523,
0.1710412611203086,
0.16262712172758204,
0.15372177852165847,
0.14800926010151544,
0.1525165099059436,
0.15772417996252297,
0.13181317881638077,
0.12130232685065588,
0.11858706132770573,
0.11648580057125185,
0.12820192115269163,
0.100348845671039,
0.09056115487474303,
0.0744105554241636,
0.07069014135754179,
0.07064920770644206,
0.06967134826350359,
0.06621927702075793,
0.06402705259519348,
0.06470928011352266,
0.06403614896210452,
0.06529144759583026,
0.06170293084941873,
0.06389515527498318,
0.0626898866592683,
0.06026570487747194,
0.05865109975075957,
0.056586224461949886,
0.053038641366638176,
0.06031118671202723,
0.05985182018301892,
0.06088425782742374,
0.05394827805774374,
0.04880428256954176,
0.04411055724343698,
0.042928029544999725,
0.042686975821856765,
0.045625102334127775,
0.047462568450161016,
0.04666663634544364,
0.04827214510524497,
0.05060991140138628,
0.0459434751760147,
0.04393772627212692,
0.052479214801608234,
0.05146496989102552,
0.04335555878981937,
0.04751259846817183,
0.03497780486473701,
0.03317217603289249,
0.031211908963559958,
0.031448414503247396,
0.03707451743773536,
0.035259792238979744,
0.038925628104135225,
0.03445931195080684,
0.032308021176342155,
0.0371290956392017,
0.032567267633307265,
0.03226253934178692,
0.024839903942365425,
0.04967298560954757,
0.04335101060636384,
0.02797815052667964,
0.028210107882911558,
0.035882893372387065,
0.024817163025087807,
0.025390234140484313,
0.017562810413520844,
0.008602889006130935,
0.0066380737533429275,
0.007120181199628857,
0.007897920570524138,
-0.0020716975639929187,
-0.003336092564629704,
-0.0025447086433678513,
-0.00012507504502700588,
0.001898866592682862,
0.0029722378881874437,
0.0012621209089089716,
0.0012029945239871113,
0.00012507504502700588,
0.00018420142994886603,
0.0030632015572980217,
-0.007579547728637166,
-0.008170811577855819,
-0.007224789419106006,
-0.007916113304346233,
-0.010690505212218239,
-0.010108337729910684,
-0.011390925464369513,
-0.01018565684865464,
-0.010453999672530799,
-0.008975840049484244,
-0.012004930230865785,
-0.013369385267524143,
-0.013801462695799311,
-0.01349673440427891,
-0.012873633270871591,
-0.015334200520312202,
-0.014420015645751107,
-0.014747484854549074,
-0.01781750868703038,
-0.017458202194043697,
-0.013546764422289723,
-0.012182309385631366,
-0.010908818018083584,
-0.012491585860607288,
-0.012487037677151765,
-0.013619535357578155,
-0.012259628504375371,
-0.012168664835264794,
-0.013028271508359553,
-0.01248248949369619,
-0.005296359633962188,
-0.0060559062710353224,
-0.0033724780322738936,
-0.009175960121527441,
-0.01018565684865464,
-0.013505830771189959,
-0.010672312478396144,
-0.015679862462932317,
-0.026913875598086105,
-0.02836474612039952,
-0.028423872505321378,
-0.02748694671348261,
-0.028278330634744466,
-0.027277730274528365,
-0.02935625011370457,
-0.025513035093783557,
-0.02720041115578436,
-0.025885986137136812,
-0.02410309822256991,
-0.022825058671566555,
-0.024603398402677983,
-0.02433960376225735,
-0.028069114195790217,
-0.027878090490658015,
-0.027714355886259007,
-0.0256358360470828,
-0.0307434460676406,
-0.027468753979660518,
-0.02225653573962557,
-0.021669820073862492,
-0.021592500955118537,
-0.01839512798588241,
-0.02225653573962557,
-0.019968799461495067,
-0.018304164316771884,
-0.01986419124201792,
-0.023825659031782704,
-0.021778976476795164,
-0.028210107882911558,
-0.04453353830480105,
-0.013728691760510827,
-0.0038272963778266797,
0.009316953808648833,
0.00983089853912348,
0.010012825877344584,
0.009990084960066965,
0.008493732603198263,
0.010190205032110164,
0.011650171921334624,
0.010058307711899871,
0.008771171793985469,
0.014506431131406108,
0.0143426965270071,
0.017553714046609797,
0.018245037931850023,
0.020291720486837563,
0.014069805519675469,
0.014597394800516687,
0.011945803845943924,
0.009075900085505868,
0.014178961922608091,
0.00708834391544019,
0.007756926883402799,
0.010108337729910684,
0.01452917204868378,
0.002994978805465114,
0.019741390288718675,
0.01568441064638784,
0.021192260811032086,
0.012809958702494208,
0.0316394382083796,
0.019468499281387046,
0.017330853057288927,
0.001835192024305478,
0.005933105317736078,
0.010226590499754405,
0.0014440482471300756,
0.017430913093310553,
0.015734440664398653,
-0.0019488966106936745,
-0.0140470646023978,
0.014679262102716166,
0.03080712063601798,
0.060661396838102864,
0.05621782160205215,
0.05315689413648189,
0.061116215183655655,
0.028833209016318875,
0.022543071297323875,
0.03212154565466553,
0.019318409227354606,
-0.011772972874633868,
-0.025049120381319723,
-0.026345352666145124,
-0.023730147179216603,
-0.025322011388651353,
-0.022110993869048707,
-0.027386886677461038,
-0.026868393763530868,
-0.029169774592027943,
-0.04435161096657995,
-0.04572971055360488,
-0.04732157476303963,
-0.04677124456492079,
-0.05010506303782268,
-0.05100105517856168,
-0.07464251278039552,
-0.08205605181290591,
-0.08363881965542962,
-0.08568550221041715,
-0.08628586242654683,
-0.08773673294886022,
-0.08600842323575965,
-0.0862949587934579,
-0.08960148816562666,
-0.08178770898902979,
-0.0824108101224371,
-0.08174222715447449,
-0.07909973256681281,
-0.08026861571488349,
-0.08068704859279204,
-0.08136927611112121,
-0.0823289428202376,
-0.08305210398966655,
-0.0778762712172758,
-0.07849937235068313,
-0.07889961249476958,
-0.07871768515654848,
-0.08432559535721432,
-0.08491685920643295,
-0.08331135044663163,
-0.08594474866738225,
-0.08114186693834483,
-0.08248812924118108,
-0.0803050011825277,
-0.0835524041697746,
-0.08644959703094585,
-0.07495178925537142,
-0.07696208634271472,
-0.07773982571360999,
-0.08172858260410792,
-0.08503966015973219,
-0.08329315771280951,
-0.0875184201429949,
-0.09020184838175632,
-0.09297169210617279,
-0.09295804755580621,
-0.09187103170993506,
-0.0929898848399949,
-0.09508659741299326,
-0.09542316298870232,
-0.09441346626157512,
-0.09616906507540889,
-0.0964146669820074,
-0.09820665126348538,
-0.09819755489657431,
-0.09705596084923682,
-0.0972970145723798,
-0.09688767806138228,
-0.09820210308002983,
-0.0978882784215984,
-0.09798379027416451,
-0.09901622791856933,
-0.09976667818873143,
-0.10124028962832245,
-0.09960294358433243,
-0.0965965943202285,
-0.0955505121254571,
-0.0993391489439118,
-0.09959384721742136,
-0.10116751869303402,
-0.09908445067040225,
-0.09948014263103316,
-0.10159959612130916,
-0.1019316135135627,
-0.10241826914330417,
-0.1026684192333582,
-0.09868421052631578,
-0.09974848545490932,
-0.10004866556297413,
-0.10022604471773974,
-0.10136309058162171,
-0.10224543817199412,
-0.09823848854767407,
-0.09978941910600905,
-0.10123574144486693,
-0.10197254716466243,
-0.10150408426874308,
-0.10558380482835156,
-0.10884030418250952,
-0.1037145014281296,
-0.0985068313715502,
-0.09778367020212128,
-0.09201202539705643,
-0.09048383575599905,
-0.0917163934724471,
-0.0919938326632343,
-0.09302627030763912,
-0.09635099241362999,
-0.09616906507540889,
-0.09797469390725344,
-0.08997898739243546,
-0.08951962086342714,
-0.09001992104353522,
-0.09763358014808884,
-0.09741981552567905,
-0.10014417741554024,
-0.10368266414394091,
-0.10753497553077301,
-0.10406016337074973,
-0.11115078137791766,
-0.1152214055706151,
-0.11695881165062674,
-0.11686329979806066,
-0.1194830534684447,
-0.120183473720596,
-0.1172953772263358,
-0.11822775483471902,
-0.11410710062401078,
-0.11251978459803155,
-0.12121591136500082,
-0.11936934888205651,
-0.12009705823494098,
-0.12163434424290939,
-0.1168542034311496,
-0.11675414339512799,
-0.1163311623337639,
-0.10942701984827259,
-0.11090517947131916,
-0.11096885403969656,
-0.10567022031400658,
-0.11274264558735242,
-0.11483480997689524,
-0.10279122018665746,
-0.09862508414139393,
-0.118305073953463,
-0.1139297214692452,
-0.1168542034311496,
-0.11219686357268907,
-0.12637355140356943,
-0.09339922135099243,
-0.09215301908417779,
-0.09158904433569233,
-0.08468490185020103,
-0.0843210471737588,
-0.08414366801899321,
-0.08229710553604891,
-0.08019129659613951,
-0.09301717394072807,
-0.09189377262721271,
-0.09166181527098076,
-0.09254416286135317,
-0.09095684683537396,
-0.09083859406553021,
-0.09325367948041552,
-0.09434524350974222,
-0.09164362253715867,
-0.09707870176651445,
-0.0958143067658777,
-0.098229392180763,
-0.08166035985227502,
-0.08170584168683027,
-0.08775947386613786,
-0.09162997798679207,
-0.09031555296814453,
-0.08785498571870394,
-0.07918159986901231,
-0.07832654137937307,
-0.08181499808976295,
-0.0825108701584587,
-0.07782624119926503,
-0.08704086088016447,
-0.09167091163789183,
-0.09028826386741136,
-0.08297478487092257,
-0.0999258646096749,
-0.09869330689322685,
-0.09844315680317282,
-0.10945430894900576,
-0.11271990467007477,
-0.11251978459803155,
-0.12343997307475393,
-0.12444512161842561,
-0.12525015009005402,
-0.12403123692397257,
-0.11758191278403406,
-0.11968317354048794,
-0.12650544872377972,
-0.12607337129550458,
-0.12862945039751125,
-0.13935861516910145,
-0.1429880655666127,
-0.14207842887550712,
-0.14175550785016466,
-0.14025915549329598,
-0.14235586806629433,
-0.14052749831717212,
-0.13639774773955282,
-0.13594292939400004,
-0.1375802754379901,
-0.14211026615969582,
-0.136752506049084,
-0.13522431640802665,
-0.13594292939400004,
-0.14653564866192445,
-0.13564729746939075,
-0.11636754780140814,
-0.118960012371059,
-0.11396610693688941,
-0.11884175960121529,
-0.11287454290756273,
-0.10250923281241472,
-0.10519266105117615,
-0.12288054650972403,
-0.13914030236323613,
-0.14578519839176232,
-0.1392994887841796,
-0.1452257718267324,
-0.15067904378991032,
-0.15453590336019793,
-0.15840640748085213,
-0.15937517055687958,
-0.15968444703185547,
-0.1621995924827624,
-0.16352766205177655,
-0.16674322775483474,
-0.16566530827587464,
-0.16838057379882476,
-0.16845789291756874,
-0.1648784725380683,
-0.1691719577200866,
-0.1730106245565521,
-0.17379291211090292,
-0.17482989793876327,
-0.1769220623283061,
-0.17572589007950226,
-0.17706760419888298,
-0.17784989175323376,
-0.1784911856204632,
-0.17800907817417724,
-0.1768083577419179,
-0.17939627412811324,
-0.17988747794131024,
-0.17986473702403263,
-0.18061063911073919,
-0.180583350010006,
-0.18112913202466938,
-0.18124283661105756,
-0.1798328997398439,
-0.18274828533483725,
-0.18224343697127368,
-0.18169765495661033,
-0.18197964233085306,
-0.18425828224207252,
-0.1837943675296087,
-0.18559999636145325,
-0.18335774191787801,
-0.18306665817672424,
-0.18265732166572674,
-0.18285744173776994,
-0.1844993359652155,
-0.18410364400458457,
-0.18391716848290793,
-0.18400358396856298,
-0.18142021576582315,
-0.1794190150453909,
-0.18050148270780653,
-0.18039687448832936,
-0.17794540360579986,
-0.17923253952371423,
-0.1792416358906253,
-0.18164307675514402,
-0.18374433751159788,
-0.1856272854621864,
-0.18439017956228282,
-0.1851861116670002,
-0.18403542125275166,
-0.18465397420270346,
-0.18409909582112904,
-0.18367156657630943,
-0.18628677206323796,
-0.18582740553422963,
-0.18722824603853222,
-0.19294531264213075,
-0.18473584150490294,
-0.18385349391453057,
-0.1830803027270908,
-0.18184774501064277,
-0.18558635181108665,
-0.18801962995979407,
-0.17195544599486964,
-0.17109583932177488,
-0.16961313151527282,
-0.16792575545327196,
-0.16860798297160115,
-0.16757554532719632,
-0.16527871268215474,
-0.16838967016573583,
-0.1672617206687649,
-0.16981325158731606,
-0.1616629068350101,
-0.16179480415522043,
-0.16037577091709573,
-0.15912956865028108,
-0.16120354030600179,
-0.16044399366892864,
-0.1609397456655812,
-0.15927511052085797,
-0.1577742099805338,
-0.15700101879309405,
-0.15446768060836502,
-0.15517264904397185,
-0.15531819091454874,
-0.15722387978241492,
-0.15748767442283554,
-0.16282269361616972,
-0.16259528444339333,
-0.1628545309003584,
-0.16163561773427693,
-0.16363227027125365,
-0.16267715174559283,
-0.16137182309385634,
-0.16191760510851966,
-0.15904315316462606,
-0.15821993195917552,
-0.1556865937744465,
-0.1470086597412993,
-0.15516355267706078,
-0.15860197936943984,
-0.16629750577619298,
-0.1657426273946186,
-0.16792120726981644,
-0.16621109029053796,
-0.16539241726854295,
-0.17044090090417888,
-0.17211918059926867,
-0.1730742991249295,
-0.1711777066239744,
-0.16899457856532102,
-0.1718508377753925,
-0.1756849564284025,
-0.17455700693143159,
-0.17846389651973002,
-0.1787185947932396,
-0.1798101588225663,
-0.1777725726344898,
-0.1764172139647425,
-0.17770889806611243,
-0.1770403150981498,
-0.17694935142903923,
-0.17561218549311408,
-0.17516646351447232,
-0.17441146506085473,
-0.18119735477650228,
-0.1827391889679262,
-0.18279831535284807,
-0.1846175887350592,
-0.18451752869903762,
-0.18495415431076828,
-0.18474948605526953,
-0.18478587152291376,
-0.1871554751032438,
-0.18643231393381485,
-0.18666427129004676,
-0.18684619862826787,
-0.18625948296250477,
-0.1862640311459603,
-0.1873055651572762,
-0.18428102315935016,
-0.18276192988520384,
-0.18124283661105756,
-0.18103816835555878,
-0.18103362017210325,
-0.18128831844561286,
-0.18099723470445905,
-0.1794554005130351,
-0.18011943529754215,
-0.17962368330088965,
-0.18175223315807668,
-0.18231165972310662,
-0.1831985554969345,
-0.182539068895883,
-0.18113822839158042,
-0.18131560754634599,
-0.18081985554969346,
-0.18098359015409246,
-0.18150208306802265,
-0.17890507031491623,
-0.1785275710881074,
-0.1791142867538705,
-0.17869130569250644,
-0.17776347626757877,
-0.18074253643094948,
-0.18437653501191625,
-0.18130196299597942,
-0.17994205614277659,
-0.17947359324685722,
-0.1816749140393327,
-0.1829484054068805,
-0.18127922207870178,
-0.1863777357323485,
-0.18635954299852642,
-0.18547719540815397,
-0.18834709916859207,
-0.18571824913129698,
-0.18368975931013154,
-0.18165217312205506,
-0.18256635799661616,
-0.18169765495661033,
-0.18648234395182564,
-0.1870918005348664,
-0.18709634871832193,
-0.187278276056543,
-0.18462668510197028,
-0.1869462586642895,
-0.1884471592046137,
-0.18631860934742664,
-0.1809426565029927,
-0.18077892189859374,
-0.18129286662906838,
-0.17767251259846817,
-0.17683564684265105,
-0.17333809376535014,
-0.17216466243382392,
-0.17006340167737005,
-0.17329716011425036,
-0.17307884730838502,
-0.1732835155638838,
-0.17624893117688795,
-0.17732685065584805,
-0.17583504648243495,
-0.1781500718612986,
-0.17367920752451474,
-0.17627622027762113,
-0.17533474630232687,
-0.17669920133898523,
-0.17703121873123875,
-0.1673072025033202,
-0.16643395127985883,
-0.16986782978878237,
-0.16922653592155293,
-0.16934478869139666,
-0.17141421216366184,
-0.15857014208525116,
-0.15600951479978897,
-0.15799707096985466,
-0.15983908526934343,
-0.1598163443520658,
-0.15433578328815473,
-0.1539082540433351,
-0.1555092146196809,
-0.15700101879309405,
-0.16368230028926448,
-0.1630501027889461,
-0.16471473793366928,
-0.16306374733931267,
-0.16465106336529192,
-0.16014836174431935,
-0.16313651827460113,
-0.1706228282424,
-0.17273773354922042,
-0.17326987101351723,
-0.18114277657503594,
-0.18065157276183894,
-0.17988747794131024,
-0.18006030891262031,
-0.1812701257117907,
-0.17710398966652718,
-0.1773996215911365,
-0.1794190150453909,
-0.18096994560372587,
-0.17763612713082397,
-0.1822479851547292,
-0.18185684137755384,
-0.17225107791947897,
-0.18142476394927867,
-0.18746475157821965,
-0.18901113395309915,
-0.1885290265068132,
-0.18842441828733603,
-0.1871099932686885,
-0.18483135335746903,
-0.1874692997616752,
-0.19039832990703515,
-0.1856909600305638,
-0.1850223770626012,
-0.1808153073662379,
-0.18483590154092455,
-0.18962968690305093,
-0.18479951607328035,
-0.18208879873378575,
-0.18160669128749976,
-0.169071897684065,
-0.1641462150017283,
-0.1732198409955064,
-0.17982835155638838,
-0.18210244328415232,
-0.1860502665235505,
-0.18641866938344825,
-0.18983435515854968,
-0.18641866938344825,
-0.20529817890734442,
-0.19826668728509833,
-0.19610175196026708,
-0.23440655302272273,
-0.17073198464533265,
-0.15754680080775738,
-0.13434651700110975,
-0.1297983335455819,
-0.12502274091727764,
-0.11842787490676224,
-0.11706341987010388,
-0.11747275638110138,
-0.11706341987010388,
-0.11706341987010388,
-0.12070196663452618
]
}
],
"layout": {
"legend": {
"bgcolor": "#F5F6F9",
"font": {
"color": "#4D5663"
}
},
"paper_bgcolor": "#F5F6F9",
"plot_bgcolor": "#F5F6F9",
"titlefont": {
"color": "#4D5663"
},
"xaxis1": {
"gridcolor": "#E1E5ED",
"showgrid": true,
"tickfont": {
"color": "#4D5663"
},
"title": "",
"titlefont": {
"color": "#4D5663"
},
"zerolinecolor": "#E1E5ED"
},
"yaxis1": {
"gridcolor": "#E1E5ED",
"showgrid": true,
"tickfont": {
"color": "#4D5663"
},
"title": "",
"titlefont": {
"color": "#4D5663"
},
"zerolinecolor": "#E1E5ED"
},
"yaxis2": {
"anchor": "x1",
"gridcolor": "#E1E5ED",
"overlaying": "y1",
"showgrid": true,
"side": "right",
"tickfont": {
"color": "#4D5663"
},
"title": "",
"titlefont": {
"color": "#4D5663"
},
"zerolinecolor": "#E1E5ED"
}
}
},
"text/html": [
""
],
"text/vnd.plotly.v1+html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
" \n",
"df.set_index('time')[[c for c in df.columns if c.startswith('close')]].iplot(secondary_y='close')"
]
},
{
"cell_type": "code",
"execution_count": 94,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:10.296392Z",
"start_time": "2018-04-23T17:23:10.232283Z"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"data": {
"application/javascript": [
"/* Put everything inside the global mpl namespace */\n",
"window.mpl = {};\n",
"\n",
"\n",
"mpl.get_websocket_type = function() {\n",
" if (typeof(WebSocket) !== 'undefined') {\n",
" return WebSocket;\n",
" } else if (typeof(MozWebSocket) !== 'undefined') {\n",
" return MozWebSocket;\n",
" } else {\n",
" alert('Your browser does not have WebSocket support.' +\n",
" 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
" 'Firefox 4 and 5 are also supported but you ' +\n",
" 'have to enable WebSockets in about:config.');\n",
" };\n",
"}\n",
"\n",
"mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
" this.id = figure_id;\n",
"\n",
" this.ws = websocket;\n",
"\n",
" this.supports_binary = (this.ws.binaryType != undefined);\n",
"\n",
" if (!this.supports_binary) {\n",
" var warnings = document.getElementById(\"mpl-warnings\");\n",
" if (warnings) {\n",
" warnings.style.display = 'block';\n",
" warnings.textContent = (\n",
" \"This browser does not support binary websocket messages. \" +\n",
" \"Performance may be slow.\");\n",
" }\n",
" }\n",
"\n",
" this.imageObj = new Image();\n",
"\n",
" this.context = undefined;\n",
" this.message = undefined;\n",
" this.canvas = undefined;\n",
" this.rubberband_canvas = undefined;\n",
" this.rubberband_context = undefined;\n",
" this.format_dropdown = undefined;\n",
"\n",
" this.image_mode = 'full';\n",
"\n",
" this.root = $('');\n",
" this._root_extra_style(this.root)\n",
" this.root.attr('style', 'display: inline-block');\n",
"\n",
" $(parent_element).append(this.root);\n",
"\n",
" this._init_header(this);\n",
" this._init_canvas(this);\n",
" this._init_toolbar(this);\n",
"\n",
" var fig = this;\n",
"\n",
" this.waiting = false;\n",
"\n",
" this.ws.onopen = function () {\n",
" fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
" fig.send_message(\"send_image_mode\", {});\n",
" if (mpl.ratio != 1) {\n",
" fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n",
" }\n",
" fig.send_message(\"refresh\", {});\n",
" }\n",
"\n",
" this.imageObj.onload = function() {\n",
" if (fig.image_mode == 'full') {\n",
" // Full images could contain transparency (where diff images\n",
" // almost always do), so we need to clear the canvas so that\n",
" // there is no ghosting.\n",
" fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
" }\n",
" fig.context.drawImage(fig.imageObj, 0, 0);\n",
" };\n",
"\n",
" this.imageObj.onunload = function() {\n",
" fig.ws.close();\n",
" }\n",
"\n",
" this.ws.onmessage = this._make_on_message_function(this);\n",
"\n",
" this.ondownload = ondownload;\n",
"}\n",
"\n",
"mpl.figure.prototype._init_header = function() {\n",
" var titlebar = $(\n",
" '');\n",
" var titletext = $(\n",
" '');\n",
" titlebar.append(titletext)\n",
" this.root.append(titlebar);\n",
" this.header = titletext[0];\n",
"}\n",
"\n",
"\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._init_canvas = function() {\n",
" var fig = this;\n",
"\n",
" var canvas_div = $('');\n",
"\n",
" canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
"\n",
" function canvas_keyboard_event(event) {\n",
" return fig.key_event(event, event['data']);\n",
" }\n",
"\n",
" canvas_div.keydown('key_press', canvas_keyboard_event);\n",
" canvas_div.keyup('key_release', canvas_keyboard_event);\n",
" this.canvas_div = canvas_div\n",
" this._canvas_extra_style(canvas_div)\n",
" this.root.append(canvas_div);\n",
"\n",
" var canvas = $('');\n",
" canvas.addClass('mpl-canvas');\n",
" canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
"\n",
" this.canvas = canvas[0];\n",
" this.context = canvas[0].getContext(\"2d\");\n",
"\n",
" var backingStore = this.context.backingStorePixelRatio ||\n",
"\tthis.context.webkitBackingStorePixelRatio ||\n",
"\tthis.context.mozBackingStorePixelRatio ||\n",
"\tthis.context.msBackingStorePixelRatio ||\n",
"\tthis.context.oBackingStorePixelRatio ||\n",
"\tthis.context.backingStorePixelRatio || 1;\n",
"\n",
" mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
"\n",
" var rubberband = $('');\n",
" rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
"\n",
" var pass_mouse_events = true;\n",
"\n",
" canvas_div.resizable({\n",
" start: function(event, ui) {\n",
" pass_mouse_events = false;\n",
" },\n",
" resize: function(event, ui) {\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" stop: function(event, ui) {\n",
" pass_mouse_events = true;\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" });\n",
"\n",
" function mouse_event_fn(event) {\n",
" if (pass_mouse_events)\n",
" return fig.mouse_event(event, event['data']);\n",
" }\n",
"\n",
" rubberband.mousedown('button_press', mouse_event_fn);\n",
" rubberband.mouseup('button_release', mouse_event_fn);\n",
" // Throttle sequential mouse events to 1 every 20ms.\n",
" rubberband.mousemove('motion_notify', mouse_event_fn);\n",
"\n",
" rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
" rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
"\n",
" canvas_div.on(\"wheel\", function (event) {\n",
" event = event.originalEvent;\n",
" event['data'] = 'scroll'\n",
" if (event.deltaY < 0) {\n",
" event.step = 1;\n",
" } else {\n",
" event.step = -1;\n",
" }\n",
" mouse_event_fn(event);\n",
" });\n",
"\n",
" canvas_div.append(canvas);\n",
" canvas_div.append(rubberband);\n",
"\n",
" this.rubberband = rubberband;\n",
" this.rubberband_canvas = rubberband[0];\n",
" this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
" this.rubberband_context.strokeStyle = \"#000000\";\n",
"\n",
" this._resize_canvas = function(width, height) {\n",
" // Keep the size of the canvas, canvas container, and rubber band\n",
" // canvas in synch.\n",
" canvas_div.css('width', width)\n",
" canvas_div.css('height', height)\n",
"\n",
" canvas.attr('width', width * mpl.ratio);\n",
" canvas.attr('height', height * mpl.ratio);\n",
" canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n",
"\n",
" rubberband.attr('width', width);\n",
" rubberband.attr('height', height);\n",
" }\n",
"\n",
" // Set the figure to an initial 600x600px, this will subsequently be updated\n",
" // upon first draw.\n",
" this._resize_canvas(600, 600);\n",
"\n",
" // Disable right mouse context menu.\n",
" $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
" return false;\n",
" });\n",
"\n",
" function set_focus () {\n",
" canvas.focus();\n",
" canvas_div.focus();\n",
" }\n",
"\n",
" window.setTimeout(set_focus, 100);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" // put a spacer in here.\n",
" continue;\n",
" }\n",
" var button = $('');\n",
" button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
" 'ui-button-icon-only');\n",
" button.attr('role', 'button');\n",
" button.attr('aria-disabled', 'false');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
"\n",
" var icon_img = $('');\n",
" icon_img.addClass('ui-button-icon-primary ui-icon');\n",
" icon_img.addClass(image);\n",
" icon_img.addClass('ui-corner-all');\n",
"\n",
" var tooltip_span = $('');\n",
" tooltip_span.addClass('ui-button-text');\n",
" tooltip_span.html(tooltip);\n",
"\n",
" button.append(icon_img);\n",
" button.append(tooltip_span);\n",
"\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" var fmt_picker_span = $('');\n",
"\n",
" var fmt_picker = $('');\n",
" fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
" fmt_picker_span.append(fmt_picker);\n",
" nav_element.append(fmt_picker_span);\n",
" this.format_dropdown = fmt_picker[0];\n",
"\n",
" for (var ind in mpl.extensions) {\n",
" var fmt = mpl.extensions[ind];\n",
" var option = $(\n",
" '', {selected: fmt === mpl.default_extension}).html(fmt);\n",
" fmt_picker.append(option)\n",
" }\n",
"\n",
" // Add hover states to the ui-buttons\n",
" $( \".ui-button\" ).hover(\n",
" function() { $(this).addClass(\"ui-state-hover\");},\n",
" function() { $(this).removeClass(\"ui-state-hover\");}\n",
" );\n",
"\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"}\n",
"\n",
"mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
" // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
" // which will in turn request a refresh of the image.\n",
" this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
"}\n",
"\n",
"mpl.figure.prototype.send_message = function(type, properties) {\n",
" properties['type'] = type;\n",
" properties['figure_id'] = this.id;\n",
" this.ws.send(JSON.stringify(properties));\n",
"}\n",
"\n",
"mpl.figure.prototype.send_draw_message = function() {\n",
" if (!this.waiting) {\n",
" this.waiting = true;\n",
" this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
" }\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" var format_dropdown = fig.format_dropdown;\n",
" var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
" fig.ondownload(fig, format);\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
" var size = msg['size'];\n",
" if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
" fig._resize_canvas(size[0], size[1]);\n",
" fig.send_message(\"refresh\", {});\n",
" };\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
" var x0 = msg['x0'] / mpl.ratio;\n",
" var y0 = (fig.canvas.height - msg['y0']) / mpl.ratio;\n",
" var x1 = msg['x1'] / mpl.ratio;\n",
" var y1 = (fig.canvas.height - msg['y1']) / mpl.ratio;\n",
" x0 = Math.floor(x0) + 0.5;\n",
" y0 = Math.floor(y0) + 0.5;\n",
" x1 = Math.floor(x1) + 0.5;\n",
" y1 = Math.floor(y1) + 0.5;\n",
" var min_x = Math.min(x0, x1);\n",
" var min_y = Math.min(y0, y1);\n",
" var width = Math.abs(x1 - x0);\n",
" var height = Math.abs(y1 - y0);\n",
"\n",
" fig.rubberband_context.clearRect(\n",
" 0, 0, fig.canvas.width, fig.canvas.height);\n",
"\n",
" fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
" // Updates the figure title.\n",
" fig.header.textContent = msg['label'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
" var cursor = msg['cursor'];\n",
" switch(cursor)\n",
" {\n",
" case 0:\n",
" cursor = 'pointer';\n",
" break;\n",
" case 1:\n",
" cursor = 'default';\n",
" break;\n",
" case 2:\n",
" cursor = 'crosshair';\n",
" break;\n",
" case 3:\n",
" cursor = 'move';\n",
" break;\n",
" }\n",
" fig.rubberband_canvas.style.cursor = cursor;\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_message = function(fig, msg) {\n",
" fig.message.textContent = msg['message'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
" // Request the server to send over a new figure.\n",
" fig.send_draw_message();\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
" fig.image_mode = msg['mode'];\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Called whenever the canvas gets updated.\n",
" this.send_message(\"ack\", {});\n",
"}\n",
"\n",
"// A function to construct a web socket function for onmessage handling.\n",
"// Called in the figure constructor.\n",
"mpl.figure.prototype._make_on_message_function = function(fig) {\n",
" return function socket_on_message(evt) {\n",
" if (evt.data instanceof Blob) {\n",
" /* FIXME: We get \"Resource interpreted as Image but\n",
" * transferred with MIME type text/plain:\" errors on\n",
" * Chrome. But how to set the MIME type? It doesn't seem\n",
" * to be part of the websocket stream */\n",
" evt.data.type = \"image/png\";\n",
"\n",
" /* Free the memory for the previous frames */\n",
" if (fig.imageObj.src) {\n",
" (window.URL || window.webkitURL).revokeObjectURL(\n",
" fig.imageObj.src);\n",
" }\n",
"\n",
" fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
" evt.data);\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
" else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
" fig.imageObj.src = evt.data;\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
"\n",
" var msg = JSON.parse(evt.data);\n",
" var msg_type = msg['type'];\n",
"\n",
" // Call the \"handle_{type}\" callback, which takes\n",
" // the figure and JSON message as its only arguments.\n",
" try {\n",
" var callback = fig[\"handle_\" + msg_type];\n",
" } catch (e) {\n",
" console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
" return;\n",
" }\n",
"\n",
" if (callback) {\n",
" try {\n",
" // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
" callback(fig, msg);\n",
" } catch (e) {\n",
" console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
" }\n",
" }\n",
" };\n",
"}\n",
"\n",
"// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
"mpl.findpos = function(e) {\n",
" //this section is from http://www.quirksmode.org/js/events_properties.html\n",
" var targ;\n",
" if (!e)\n",
" e = window.event;\n",
" if (e.target)\n",
" targ = e.target;\n",
" else if (e.srcElement)\n",
" targ = e.srcElement;\n",
" if (targ.nodeType == 3) // defeat Safari bug\n",
" targ = targ.parentNode;\n",
"\n",
" // jQuery normalizes the pageX and pageY\n",
" // pageX,Y are the mouse positions relative to the document\n",
" // offset() returns the position of the element relative to the document\n",
" var x = e.pageX - $(targ).offset().left;\n",
" var y = e.pageY - $(targ).offset().top;\n",
"\n",
" return {\"x\": x, \"y\": y};\n",
"};\n",
"\n",
"/*\n",
" * return a copy of an object with only non-object keys\n",
" * we need this to avoid circular references\n",
" * http://stackoverflow.com/a/24161582/3208463\n",
" */\n",
"function simpleKeys (original) {\n",
" return Object.keys(original).reduce(function (obj, key) {\n",
" if (typeof original[key] !== 'object')\n",
" obj[key] = original[key]\n",
" return obj;\n",
" }, {});\n",
"}\n",
"\n",
"mpl.figure.prototype.mouse_event = function(event, name) {\n",
" var canvas_pos = mpl.findpos(event)\n",
"\n",
" if (name === 'button_press')\n",
" {\n",
" this.canvas.focus();\n",
" this.canvas_div.focus();\n",
" }\n",
"\n",
" var x = canvas_pos.x * mpl.ratio;\n",
" var y = canvas_pos.y * mpl.ratio;\n",
"\n",
" this.send_message(name, {x: x, y: y, button: event.button,\n",
" step: event.step,\n",
" guiEvent: simpleKeys(event)});\n",
"\n",
" /* This prevents the web browser from automatically changing to\n",
" * the text insertion cursor when the button is pressed. We want\n",
" * to control all of the cursor setting manually through the\n",
" * 'cursor' event from matplotlib */\n",
" event.preventDefault();\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" // Handle any extra behaviour associated with a key event\n",
"}\n",
"\n",
"mpl.figure.prototype.key_event = function(event, name) {\n",
"\n",
" // Prevent repeat events\n",
" if (name == 'key_press')\n",
" {\n",
" if (event.which === this._key)\n",
" return;\n",
" else\n",
" this._key = event.which;\n",
" }\n",
" if (name == 'key_release')\n",
" this._key = null;\n",
"\n",
" var value = '';\n",
" if (event.ctrlKey && event.which != 17)\n",
" value += \"ctrl+\";\n",
" if (event.altKey && event.which != 18)\n",
" value += \"alt+\";\n",
" if (event.shiftKey && event.which != 16)\n",
" value += \"shift+\";\n",
"\n",
" value += 'k';\n",
" value += event.which.toString();\n",
"\n",
" this._key_event_extra(event, name);\n",
"\n",
" this.send_message(name, {key: value,\n",
" guiEvent: simpleKeys(event)});\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
" if (name == 'download') {\n",
" this.handle_save(this, null);\n",
" } else {\n",
" this.send_message(\"toolbar_button\", {name: name});\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
" this.message.textContent = tooltip;\n",
"};\n",
"mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
"\n",
"mpl.extensions = [\"eps\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\"];\n",
"\n",
"mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
" // Create a \"websocket\"-like object which calls the given IPython comm\n",
" // object with the appropriate methods. Currently this is a non binary\n",
" // socket, so there is still some room for performance tuning.\n",
" var ws = {};\n",
"\n",
" ws.close = function() {\n",
" comm.close()\n",
" };\n",
" ws.send = function(m) {\n",
" //console.log('sending', m);\n",
" comm.send(m);\n",
" };\n",
" // Register the callback with on_msg.\n",
" comm.on_msg(function(msg) {\n",
" //console.log('receiving', msg['content']['data'], msg);\n",
" // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
" ws.onmessage(msg['content']['data'])\n",
" });\n",
" return ws;\n",
"}\n",
"\n",
"mpl.mpl_figure_comm = function(comm, msg) {\n",
" // This is the function which gets called when the mpl process\n",
" // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
"\n",
" var id = msg.content.data.id;\n",
" // Get hold of the div created by the display call when the Comm\n",
" // socket was opened in Python.\n",
" var element = $(\"#\" + id);\n",
" var ws_proxy = comm_websocket_adapter(comm)\n",
"\n",
" function ondownload(figure, format) {\n",
" window.open(figure.imageObj.src);\n",
" }\n",
"\n",
" var fig = new mpl.figure(id, ws_proxy,\n",
" ondownload,\n",
" element.get(0));\n",
"\n",
" // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
" // web socket which is closed, not our websocket->open comm proxy.\n",
" ws_proxy.onopen();\n",
"\n",
" fig.parent_element = element.get(0);\n",
" fig.cell_info = mpl.find_output_cell(\"\");\n",
" if (!fig.cell_info) {\n",
" console.error(\"Failed to find cell for figure\", id, fig);\n",
" return;\n",
" }\n",
"\n",
" var output_index = fig.cell_info[2]\n",
" var cell = fig.cell_info[0];\n",
"\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_close = function(fig, msg) {\n",
" var width = fig.canvas.width/mpl.ratio\n",
" fig.root.unbind('remove')\n",
"\n",
" // Update the output cell to use the data from the current canvas.\n",
" fig.push_to_output();\n",
" var dataURL = fig.canvas.toDataURL();\n",
" // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
" // the notebook keyboard shortcuts fail.\n",
" IPython.keyboard_manager.enable()\n",
" $(fig.parent_element).html('');\n",
" fig.close_ws(fig, msg);\n",
"}\n",
"\n",
"mpl.figure.prototype.close_ws = function(fig, msg){\n",
" fig.send_message('closing', msg);\n",
" // fig.ws.close()\n",
"}\n",
"\n",
"mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
" // Turn the data on the canvas into data in the output cell.\n",
" var width = this.canvas.width/mpl.ratio\n",
" var dataURL = this.canvas.toDataURL();\n",
" this.cell_info[1]['text/html'] = '';\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Tell IPython that the notebook contents must change.\n",
" IPython.notebook.set_dirty(true);\n",
" this.send_message(\"ack\", {});\n",
" var fig = this;\n",
" // Wait a second, then push the new image to the DOM so\n",
" // that it is saved nicely (might be nice to debounce this).\n",
" setTimeout(function () { fig.push_to_output() }, 1000);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items){\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) { continue; };\n",
"\n",
" var button = $('');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" // Add the status bar.\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"\n",
" // Add the close button to the window.\n",
" var buttongrp = $('');\n",
" var button = $('');\n",
" button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
" button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
" buttongrp.append(button);\n",
" var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
" titlebar.prepend(buttongrp);\n",
"}\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(el){\n",
" var fig = this\n",
" el.on(\"remove\", function(){\n",
"\tfig.close_ws(fig, {});\n",
" });\n",
"}\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(el){\n",
" // this is important to make the div 'focusable\n",
" el.attr('tabindex', 0)\n",
" // reach out to IPython and tell the keyboard manager to turn it's self\n",
" // off when our div gets focus\n",
"\n",
" // location in version 3\n",
" if (IPython.notebook.keyboard_manager) {\n",
" IPython.notebook.keyboard_manager.register_events(el);\n",
" }\n",
" else {\n",
" // location in version 2\n",
" IPython.keyboard_manager.register_events(el);\n",
" }\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" var manager = IPython.notebook.keyboard_manager;\n",
" if (!manager)\n",
" manager = IPython.keyboard_manager;\n",
"\n",
" // Check for shift+enter\n",
" if (event.shiftKey && event.which == 13) {\n",
" this.canvas_div.blur();\n",
" event.shiftKey = false;\n",
" // Send a \"J\" for go to next cell\n",
" event.which = 74;\n",
" event.keyCode = 74;\n",
" manager.command_mode();\n",
" manager.handle_keydown(event);\n",
" }\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" fig.ondownload(fig, null);\n",
"}\n",
"\n",
"\n",
"mpl.find_output_cell = function(html_output) {\n",
" // Return the cell and output element which can be found *uniquely* in the notebook.\n",
" // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
" // IPython event is triggered only after the cells have been serialised, which for\n",
" // our purposes (turning an active figure into a static one), is too late.\n",
" var cells = IPython.notebook.get_cells();\n",
" var ncells = cells.length;\n",
" for (var i=0; i= 3 moved mimebundle to data attribute of output\n",
" data = data.data;\n",
" }\n",
" if (data['text/html'] == html_output) {\n",
" return [cell, data, j];\n",
" }\n",
" }\n",
" }\n",
" }\n",
"}\n",
"\n",
"// Register the function which deals with the matplotlib target/channel.\n",
"// The kernel may be null if the page has been refreshed.\n",
"if (IPython.notebook.kernel != null) {\n",
" IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
"}\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
""
]
},
"execution_count": 94,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#df.set_index('time')[[c for c in df.columns if c.startswith('close')]].describe()\n",
"df.set_index('time')[[c for c in df.columns if c.startswith('close_')]].plot.box()"
]
},
{
"cell_type": "code",
"execution_count": 95,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:10.302336Z",
"start_time": "2018-04-23T17:23:10.299102Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [],
"source": [
"# create a static mmscaler and show that you can fit/transform the close valuse\n",
"# *and* get the original back from the scaled using nverse_transform "
]
},
{
"cell_type": "code",
"execution_count": 96,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:10.314987Z",
"start_time": "2018-04-23T17:23:10.304350Z"
},
"nbpresent": {
"id": "718da564-137e-4ecb-ad27-970a7b082a96"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(1206,)\n",
"(1206, 1)\n"
]
},
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 96,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from sklearn.preprocessing import MinMaxScaler\n",
"import numpy as np\n",
"scaler = MinMaxScaler(feature_range=(-1,1))\n",
"X = df.close.values\n",
"print(X.shape)\n",
"X = X.reshape(len(X),1)\n",
"print(X.shape)\n",
"scaler = scaler.fit(X)\n",
"scaled_X = scaler.transform(X)\n",
"inverted_X = scaler.inverse_transform(scaled_X)\n",
"np.allclose(X,inverted_X) "
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"### Hold your horses hotshot, it's not that simple;\n",
"A few other things to bear in mind;\n",
"* Predictive modeling means it's 'Supervised' learning but we don't have any labels?\n",
"* We want to 'predict' the future value based on the past\n",
"* The 'past' of bitcoin as had significant shifts in scale (almost logish)\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"### Sidebar: What is 'stationarity'?\n",
"![](stationary.png)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"### The Fixes\n",
"* Transform the dataset so we use the 'future' as a label for the 'past'\n",
"* Make the data timeseries stationary to correct for relative scaling\n",
"* Rescale again\n"
]
},
{
"cell_type": "code",
"execution_count": 149,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:08:53.502379Z",
"start_time": "2018-04-23T19:08:53.481476Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/plain": [
"time\n",
"2014-12-01 370.00\n",
"2014-12-02 378.00\n",
"2014-12-03 378.00\n",
"2014-12-04 377.10\n",
"2014-12-06 378.00\n",
"2014-12-08 375.00\n",
"2014-12-10 360.50\n",
"2014-12-12 350.00\n",
"2014-12-18 340.00\n",
"2015-01-08 288.99\n",
"2015-01-13 260.00\n",
"2015-01-14 120.00\n",
"2015-01-15 204.22\n",
"2015-01-16 199.46\n",
"2015-01-17 184.00\n",
"2015-01-19 225.51\n",
"2015-01-20 218.00\n",
"2015-01-21 225.51\n",
"2015-01-22 226.32\n",
"2015-01-23 235.00\n",
"2015-01-24 240.00\n",
"2015-01-25 254.53\n",
"2015-01-26 274.48\n",
"2015-01-27 263.65\n",
"2015-01-28 236.09\n",
"2015-01-29 235.03\n",
"2015-01-30 229.07\n",
"2015-01-31 218.45\n",
"2015-02-01 228.99\n",
"2015-02-02 237.83\n",
" ... \n",
"2018-03-25 8453.00\n",
"2018-03-26 8145.00\n",
"2018-03-27 7793.61\n",
"2018-03-28 7942.72\n",
"2018-03-29 7079.99\n",
"2018-03-30 6848.01\n",
"2018-03-31 6928.50\n",
"2018-04-01 6816.01\n",
"2018-04-02 7045.01\n",
"2018-04-03 7424.90\n",
"2018-04-04 6791.68\n",
"2018-04-05 6785.85\n",
"2018-04-06 6619.01\n",
"2018-04-07 6894.01\n",
"2018-04-08 7020.01\n",
"2018-04-09 6771.13\n",
"2018-04-10 6824.99\n",
"2018-04-11 6942.99\n",
"2018-04-12 7916.00\n",
"2018-04-13 7893.19\n",
"2018-04-14 8003.11\n",
"2018-04-15 8355.25\n",
"2018-04-16 8048.93\n",
"2018-04-17 7892.10\n",
"2018-04-18 8152.05\n",
"2018-04-19 8274.00\n",
"2018-04-20 8866.27\n",
"2018-04-21 8915.42\n",
"2018-04-22 8795.01\n",
"2018-04-23 8888.33\n",
"Name: close, Length: 1206, dtype: float64"
]
},
"execution_count": 149,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Need to order the data ascending for supervisfication\n",
"X=df.set_index('time').close.sort_index()\n",
"X"
]
},
{
"cell_type": "code",
"execution_count": 98,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:10.358224Z",
"start_time": "2018-04-23T17:23:10.321713Z"
},
"slideshow": {
"slide_type": "notes"
}
},
"outputs": [
{
"data": {
"text/plain": [
"time\n",
"2014-12-01 370.0\n",
"2014-12-02 378.0\n",
"2014-12-03 378.0\n",
"2014-12-04 377.1\n",
"2014-12-06 378.0\n",
"Name: close, dtype: float64"
]
},
"execution_count": 98,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"X = df.set_index('time')['close'].sort_index()\n",
"X.head()"
]
},
{
"cell_type": "code",
"execution_count": 150,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:09:08.684097Z",
"start_time": "2018-04-23T19:09:08.671865Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" today | \n",
" tomorrow | \n",
"
\n",
" \n",
" time | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" 2014-12-02 | \n",
" 370.0 | \n",
" 378.0 | \n",
"
\n",
" \n",
" 2014-12-03 | \n",
" 378.0 | \n",
" 378.0 | \n",
"
\n",
" \n",
" 2014-12-04 | \n",
" 378.0 | \n",
" 377.1 | \n",
"
\n",
" \n",
" 2014-12-06 | \n",
" 377.1 | \n",
" 378.0 | \n",
"
\n",
" \n",
" 2014-12-08 | \n",
" 378.0 | \n",
" 375.0 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" today tomorrow\n",
"time \n",
"2014-12-02 370.0 378.0\n",
"2014-12-03 378.0 378.0\n",
"2014-12-04 378.0 377.1\n",
"2014-12-06 377.1 378.0\n",
"2014-12-08 378.0 375.0"
]
},
"execution_count": 150,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Folks, we all know this live coding is a faff, lets get a move on.\n",
"def ts_df_to_supervised(df, lag=1):\n",
" columns = [df.shift(i) for i in range(1, lag+1)]\n",
" columns.append(df)\n",
" _df = pd.concat(columns, axis=1)\n",
" _df.dropna(inplace=True)\n",
" _df.columns = ['today','tomorrow']\n",
" return _df\n",
"\n",
"sup_df = ts_df_to_supervised(X)\n",
"sup_df.head()"
]
},
{
"cell_type": "code",
"execution_count": 151,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:09:40.128968Z",
"start_time": "2018-04-23T19:09:40.119785Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"
\n",
" \n",
" \n",
" | \n",
" today | \n",
" tomorrow | \n",
"
\n",
" \n",
" time | \n",
" | \n",
" | \n",
"
\n",
" \n",
" \n",
" \n",
" 2014-12-03 | \n",
" 8.0 | \n",
" 0.0 | \n",
"
\n",
" \n",
" 2014-12-04 | \n",
" 0.0 | \n",
" -0.9 | \n",
"
\n",
" \n",
" 2014-12-06 | \n",
" -0.9 | \n",
" 0.9 | \n",
"
\n",
" \n",
" 2014-12-08 | \n",
" 0.9 | \n",
" -3.0 | \n",
"
\n",
" \n",
" 2014-12-10 | \n",
" -3.0 | \n",
" -14.5 | \n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" today tomorrow\n",
"time \n",
"2014-12-03 8.0 0.0\n",
"2014-12-04 0.0 -0.9\n",
"2014-12-06 -0.9 0.9\n",
"2014-12-08 0.9 -3.0\n",
"2014-12-10 -3.0 -14.5"
]
},
"execution_count": 151,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"## now make the values stationary\n",
"def difference(X, lag=1):\n",
" return X.diff(lag).dropna()\n",
"difference(sup_df).head()"
]
},
{
"cell_type": "code",
"execution_count": 152,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:10:22.620125Z",
"start_time": "2018-04-23T19:10:22.577282Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/plain": [
"0.0"
]
},
"execution_count": 152,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def inverse_difference(history, yhat, interval=1):\n",
" return yhat + history[-interval]\n",
"\n",
"differenced = difference(X)\n",
"undifferenced = pd.Series(\n",
" [inverse_difference(X, differenced[i], len(X)-i) \n",
" for i in range(len(differenced))],\n",
" index = X.index[1:]\n",
") \n",
"(undifferenced-X).sum()"
]
},
{
"cell_type": "code",
"execution_count": 102,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:10.499744Z",
"start_time": "2018-04-23T17:23:10.446325Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/plain": [
"time\n",
"2014-12-01 370.0\n",
"2014-12-02 378.0\n",
"2014-12-03 378.0\n",
"2014-12-04 377.1\n",
"2014-12-06 378.0\n",
"Name: close, dtype: float64"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"time\n",
"2014-12-01 -0.974398\n",
"2014-12-02 -0.973579\n",
"2014-12-03 -0.973579\n",
"2014-12-04 -0.973671\n",
"2014-12-06 -0.973579\n",
"dtype: float64"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"time\n",
"2014-12-01 370.0\n",
"2014-12-02 378.0\n",
"2014-12-03 378.0\n",
"2014-12-04 377.1\n",
"2014-12-06 378.0\n",
"dtype: float64"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from sklearn.preprocessing import MinMaxScaler\n",
"display(X.head())\n",
"_X = X.values.reshape(len(X), 1)\n",
"\n",
"scaler = MinMaxScaler(feature_range=(-1, 1))\n",
"scaler = scaler.fit(_X)\n",
"scaled_X = scaler.transform(_X)\n",
"scaled_series = pd.Series(scaled_X[:, 0], index=X.index)\n",
"display(scaled_series.head())\n",
"# invert transform to validate\n",
"inverted_X = scaler.inverse_transform(scaled_X)\n",
"inverted_series = pd.Series(inverted_X[:, 0], index=X.index)\n",
"display(inverted_series.head())"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# *FINALLY*: We can start doing some actual ML\n",
"We have:\n",
"* Methods to scale/invert data to -1,1\n",
"* Methods to transform / invert data to stationary\n",
"* Methods to transform data to supervised with configurable 'lag'"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"## Keras LSTM Cavaets \n",
"* LSTM must be 'stateful' (i.e. doesn't forget between batches) and must be manually cleared\n",
"* Expected input to be sample/timestep/feature 3-matrix (we only have one feature atm so that's easy)\n"
]
},
{
"cell_type": "code",
"execution_count": 103,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:10.512946Z",
"start_time": "2018-04-23T17:23:10.501813Z"
},
"slideshow": {
"slide_type": "fragment"
}
},
"outputs": [
{
"data": {
"text/plain": [
"array([[[ 8. , 0. ]],\n",
"\n",
" [[ 0. , -0.9 ]],\n",
"\n",
" [[ -0.9 , 0.9 ]],\n",
"\n",
" ...,\n",
"\n",
" [[ 592.27, 49.15]],\n",
"\n",
" [[ 49.15, -120.41]],\n",
"\n",
" [[-120.41, 120.97]]])"
]
},
"execution_count": 103,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def twodim_to_threedim(X):\n",
" return X.values.reshape(X.shape[0],1,X.shape[1])\n",
"twodim_to_threedim(difference(ts_df_to_supervised(X)))"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Splitting Training / Test Datasets\n",
"Important to remove bias / overfitting\n"
]
},
{
"cell_type": "code",
"execution_count": 153,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:13:00.612375Z",
"start_time": "2018-04-23T19:13:00.604660Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [],
"source": [
"raw_X = df.set_index('time')['close'].sort_index() # Sort Closes\n",
"dX = difference(raw_X) # Stationarise\n",
"sup_dX = ts_df_to_supervised(dX) # Supervise\n",
"i_split = 2*sup_dX.shape[0]//3\n",
"sup_dX_train = sup_dX.iloc[:i_split] # Training Set\n",
"sup_dX_test = sup_dX.iloc[i_split:] # Test Set\n",
"batch_size=2 # Use online learning \n",
"n_epoch = 600\n",
"n_neurons = 10"
]
},
{
"cell_type": "code",
"execution_count": 154,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:13:23.767995Z",
"start_time": "2018-04-23T19:13:23.763381Z"
},
"nbpresent": {
"id": "d60a69d5-c528-4bd4-a7cb-6ca420be7e52"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [],
"source": [
" \n",
"def scale(train, test):\n",
" # fit scaler to both sets\n",
" scaler = MinMaxScaler(feature_range=(-1, 1))\n",
" scaler = scaler.fit(train.values)\n",
" # transform train\n",
" train = train.values.reshape(train.shape[0], train.shape[1])\n",
" train_scaled = scaler.transform(train)\n",
" # transform test\n",
" test = test.values.reshape(test.shape[0], test.shape[1])\n",
" test_scaled = scaler.transform(test)\n",
" return scaler, train_scaled, test_scaled\n",
"\n",
"def invert_scale(scaler, X, value):\n",
" new_row = [x for x in X] + [value]\n",
" array = np.array(new_row)\n",
" array = array.reshape(1, len(array))\n",
" inverted = scaler.inverse_transform(array)\n",
" return inverted[0, -1]"
]
},
{
"cell_type": "code",
"execution_count": 155,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:13:28.843314Z",
"start_time": "2018-04-23T19:13:28.839797Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [],
"source": [
"scaler, train_scaled, test_scaled = scale(sup_dX_train, sup_dX_test)"
]
},
{
"cell_type": "markdown",
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:12:02.673473Z",
"start_time": "2018-04-23T17:12:02.665234Z"
},
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# FIRST BIT OF ACTUAL ML\n",
"**Yes Jase, Tensorflow is in the background ☹️**\n",
"\n",
"* And there's no way in fuck I'm doing this bit live\n",
"* Single layer 10 stage LSTM with 200 epochs on diffed scaled single-memory input"
]
},
{
"cell_type": "code",
"execution_count": 156,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:13:50.669295Z",
"start_time": "2018-04-23T19:13:50.665965Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [],
"source": [
"from keras.layers.core import Dense, Activation, Dropout, Flatten\n",
"from keras.layers.recurrent import LSTM\n",
"from keras.models import Sequential, load_model\n",
"import time\n",
"from keras_tqdm import TQDMNotebookCallback\n",
"import tqdm"
]
},
{
"cell_type": "code",
"execution_count": 157,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:16:09.086907Z",
"start_time": "2018-04-23T19:16:09.081607Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [],
"source": [
"def fit_lstm(train, batch_size, nb_epoch, neurons):\n",
" X, y = train[:, 0:-1], train[:, -1]\n",
" X = X.reshape(X.shape[0], 1, X.shape[1])\n",
" model = Sequential()\n",
" model.add(LSTM(neurons, activation='sigmoid', batch_input_shape=(batch_size, X.shape[1], X.shape[2]), stateful=True))\n",
" model.add(Dense(1))\n",
" model.compile(loss='mean_squared_error', optimizer='adam')\n",
" \n",
" model.fit(X, y, epochs=200, batch_size=batch_size, \n",
" verbose=0, shuffle=False, \n",
" callbacks=[TQDMNotebookCallback(leave_inner=False,leave_outer=False)]\n",
" )\n",
" model.reset_states()\n",
" return model\n",
"\n",
"def forecast(model, batch_size, X):\n",
" X = X.reshape( len(X),1, 1,)\n",
" yhat = model.predict(X, batch_size=batch_size)\n",
" return yhat[0,0]"
]
},
{
"cell_type": "code",
"execution_count": 158,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:16:23.917172Z",
"start_time": "2018-04-23T19:16:12.585716Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "5c5fe132b04d4f40b974066a58a97074",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(IntProgress(value=0, description='Training', max=200), HTML(value='')))"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8bbb4fbb31c24a46b6feb43aa2c38b0d",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(IntProgress(value=0, description='Epoch 0', max=802), HTML(value='')))"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "35a7540950ac45928dc02cbe26738a99",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(IntProgress(value=0, description='Epoch 1', max=802), HTML(value='')))"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "184420dbfb20469581dede918c3deca5",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(IntProgress(value=0, description='Epoch 2', max=802), HTML(value='')))"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "ee1a83ecd1ee4c7993868988bfbd7715",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(IntProgress(value=0, description='Epoch 3', max=802), HTML(value='')))"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4776eedfb7764bf1b06e2d089b60cadc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(IntProgress(value=0, description='Epoch 4', max=802), HTML(value='')))"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "cfe3ad029e8749f18489e729e3df7335",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(IntProgress(value=0, description='Epoch 5', max=802), HTML(value='')))"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e1dfd78af5fc4d2fb8166bb577135e49",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(IntProgress(value=0, description='Epoch 6', max=802), HTML(value='')))"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mlstm\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfit_lstm\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtrain_scaled\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbatch_size\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn_epoch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mn_neurons\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m\u001b[0m in \u001b[0;36mfit_lstm\u001b[0;34m(train, batch_size, nb_epoch, neurons)\u001b[0m\n\u001b[1;32m 9\u001b[0m model.fit(X, y, epochs=200, batch_size=batch_size, \n\u001b[1;32m 10\u001b[0m \u001b[0mverbose\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mshuffle\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 11\u001b[0;31m \u001b[0mcallbacks\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mTQDMNotebookCallback\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mleave_inner\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mleave_outer\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 12\u001b[0m )\n\u001b[1;32m 13\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreset_states\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda3/envs/bash/lib/python3.6/site-packages/keras/models.py\u001b[0m in \u001b[0;36mfit\u001b[0;34m(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)\u001b[0m\n\u001b[1;32m 961\u001b[0m \u001b[0minitial_epoch\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0minitial_epoch\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 962\u001b[0m \u001b[0msteps_per_epoch\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msteps_per_epoch\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 963\u001b[0;31m validation_steps=validation_steps)\n\u001b[0m\u001b[1;32m 964\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 965\u001b[0m def evaluate(self, x=None, y=None,\n",
"\u001b[0;32m~/anaconda3/envs/bash/lib/python3.6/site-packages/keras/engine/training.py\u001b[0m in \u001b[0;36mfit\u001b[0;34m(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)\u001b[0m\n\u001b[1;32m 1703\u001b[0m \u001b[0minitial_epoch\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0minitial_epoch\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1704\u001b[0m \u001b[0msteps_per_epoch\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msteps_per_epoch\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1705\u001b[0;31m validation_steps=validation_steps)\n\u001b[0m\u001b[1;32m 1706\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1707\u001b[0m def evaluate(self, x=None, y=None,\n",
"\u001b[0;32m~/anaconda3/envs/bash/lib/python3.6/site-packages/keras/engine/training.py\u001b[0m in \u001b[0;36m_fit_loop\u001b[0;34m(self, f, ins, out_labels, batch_size, epochs, verbose, callbacks, val_f, val_ins, shuffle, callback_metrics, initial_epoch, steps_per_epoch, validation_steps)\u001b[0m\n\u001b[1;32m 1233\u001b[0m \u001b[0mins_batch\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mins_batch\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mi\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtoarray\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1234\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1235\u001b[0;31m \u001b[0mouts\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mins_batch\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1236\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mouts\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlist\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1237\u001b[0m \u001b[0mouts\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mouts\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda3/envs/bash/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, inputs)\u001b[0m\n\u001b[1;32m 2476\u001b[0m \u001b[0msession\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_session\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2477\u001b[0m updated = session.run(fetches=fetches, feed_dict=feed_dict,\n\u001b[0;32m-> 2478\u001b[0;31m **self.session_kwargs)\n\u001b[0m\u001b[1;32m 2479\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mupdated\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0moutputs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2480\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda3/envs/bash/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self, fetches, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m 776\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 777\u001b[0m result = self._run(None, fetches, feed_dict, options_ptr,\n\u001b[0;32m--> 778\u001b[0;31m run_metadata_ptr)\n\u001b[0m\u001b[1;32m 779\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mrun_metadata\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 780\u001b[0m \u001b[0mproto_data\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mtf_session\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTF_GetBuffer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrun_metadata_ptr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda3/envs/bash/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_run\u001b[0;34m(self, handle, fetches, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m 980\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mfinal_fetches\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mfinal_targets\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 981\u001b[0m results = self._do_run(handle, final_targets, final_fetches,\n\u001b[0;32m--> 982\u001b[0;31m feed_dict_string, options, run_metadata)\n\u001b[0m\u001b[1;32m 983\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 984\u001b[0m \u001b[0mresults\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda3/envs/bash/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_do_run\u001b[0;34m(self, handle, target_list, fetch_list, feed_dict, options, run_metadata)\u001b[0m\n\u001b[1;32m 1030\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mhandle\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1031\u001b[0m return self._do_call(_run_fn, self._session, feed_dict, fetch_list,\n\u001b[0;32m-> 1032\u001b[0;31m target_list, options, run_metadata)\n\u001b[0m\u001b[1;32m 1033\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1034\u001b[0m return self._do_call(_prun_fn, self._session, handle, feed_dict,\n",
"\u001b[0;32m~/anaconda3/envs/bash/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_do_call\u001b[0;34m(self, fn, *args)\u001b[0m\n\u001b[1;32m 1037\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_do_call\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1038\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1039\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1040\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0merrors\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mOpError\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1041\u001b[0m \u001b[0mmessage\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcompat\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mas_text\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0me\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmessage\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m~/anaconda3/envs/bash/lib/python3.6/site-packages/tensorflow/python/client/session.py\u001b[0m in \u001b[0;36m_run_fn\u001b[0;34m(session, feed_dict, fetch_list, target_list, options, run_metadata)\u001b[0m\n\u001b[1;32m 1019\u001b[0m return tf_session.TF_Run(session, options,\n\u001b[1;32m 1020\u001b[0m \u001b[0mfeed_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfetch_list\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtarget_list\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1021\u001b[0;31m status, run_metadata)\n\u001b[0m\u001b[1;32m 1022\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1023\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_prun_fn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msession\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhandle\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfeed_dict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfetch_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
}
],
"source": [
"lstm = fit_lstm(train_scaled, batch_size, n_epoch, n_neurons)"
]
},
{
"cell_type": "code",
"execution_count": 159,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:17:12.006160Z",
"start_time": "2018-04-23T19:17:10.667817Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [],
"source": [
"## THIS TAKES A LONG TIME SO HERES ONE I MADE (a few) EARLIER\n",
"#lstm.save(f'lstm_{batch_size}_{n_epoch}_{n_neurons}.h5')\n",
"#lstm = load_model('lstm_batchwise_2.h5')\n",
"#lstm.save('lstm_batchwise_2.h5')\n",
"lstm = load_model(f'lstm_1_3000_4.h5')\n",
"lstm.reset_states()"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# Model / Structure Validation\n",
"\"Walk the line\"\n",
"\n",
"* Does the model map test data at all?\n",
"* Model has been trained on the first 2/3 of data\n",
"* Functionally; model is a 1-1 mapping of diff->next diff, not to value\n",
"\n",
"But first, what's the data actually look like between training and test sets?\n"
]
},
{
"cell_type": "code",
"execution_count": 160,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:17:48.550576Z",
"start_time": "2018-04-23T19:17:48.478311Z"
},
"scrolled": false,
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"application/javascript": [
"/* Put everything inside the global mpl namespace */\n",
"window.mpl = {};\n",
"\n",
"\n",
"mpl.get_websocket_type = function() {\n",
" if (typeof(WebSocket) !== 'undefined') {\n",
" return WebSocket;\n",
" } else if (typeof(MozWebSocket) !== 'undefined') {\n",
" return MozWebSocket;\n",
" } else {\n",
" alert('Your browser does not have WebSocket support.' +\n",
" 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
" 'Firefox 4 and 5 are also supported but you ' +\n",
" 'have to enable WebSockets in about:config.');\n",
" };\n",
"}\n",
"\n",
"mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
" this.id = figure_id;\n",
"\n",
" this.ws = websocket;\n",
"\n",
" this.supports_binary = (this.ws.binaryType != undefined);\n",
"\n",
" if (!this.supports_binary) {\n",
" var warnings = document.getElementById(\"mpl-warnings\");\n",
" if (warnings) {\n",
" warnings.style.display = 'block';\n",
" warnings.textContent = (\n",
" \"This browser does not support binary websocket messages. \" +\n",
" \"Performance may be slow.\");\n",
" }\n",
" }\n",
"\n",
" this.imageObj = new Image();\n",
"\n",
" this.context = undefined;\n",
" this.message = undefined;\n",
" this.canvas = undefined;\n",
" this.rubberband_canvas = undefined;\n",
" this.rubberband_context = undefined;\n",
" this.format_dropdown = undefined;\n",
"\n",
" this.image_mode = 'full';\n",
"\n",
" this.root = $('');\n",
" this._root_extra_style(this.root)\n",
" this.root.attr('style', 'display: inline-block');\n",
"\n",
" $(parent_element).append(this.root);\n",
"\n",
" this._init_header(this);\n",
" this._init_canvas(this);\n",
" this._init_toolbar(this);\n",
"\n",
" var fig = this;\n",
"\n",
" this.waiting = false;\n",
"\n",
" this.ws.onopen = function () {\n",
" fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
" fig.send_message(\"send_image_mode\", {});\n",
" if (mpl.ratio != 1) {\n",
" fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n",
" }\n",
" fig.send_message(\"refresh\", {});\n",
" }\n",
"\n",
" this.imageObj.onload = function() {\n",
" if (fig.image_mode == 'full') {\n",
" // Full images could contain transparency (where diff images\n",
" // almost always do), so we need to clear the canvas so that\n",
" // there is no ghosting.\n",
" fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
" }\n",
" fig.context.drawImage(fig.imageObj, 0, 0);\n",
" };\n",
"\n",
" this.imageObj.onunload = function() {\n",
" fig.ws.close();\n",
" }\n",
"\n",
" this.ws.onmessage = this._make_on_message_function(this);\n",
"\n",
" this.ondownload = ondownload;\n",
"}\n",
"\n",
"mpl.figure.prototype._init_header = function() {\n",
" var titlebar = $(\n",
" '');\n",
" var titletext = $(\n",
" '');\n",
" titlebar.append(titletext)\n",
" this.root.append(titlebar);\n",
" this.header = titletext[0];\n",
"}\n",
"\n",
"\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._init_canvas = function() {\n",
" var fig = this;\n",
"\n",
" var canvas_div = $('');\n",
"\n",
" canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
"\n",
" function canvas_keyboard_event(event) {\n",
" return fig.key_event(event, event['data']);\n",
" }\n",
"\n",
" canvas_div.keydown('key_press', canvas_keyboard_event);\n",
" canvas_div.keyup('key_release', canvas_keyboard_event);\n",
" this.canvas_div = canvas_div\n",
" this._canvas_extra_style(canvas_div)\n",
" this.root.append(canvas_div);\n",
"\n",
" var canvas = $('');\n",
" canvas.addClass('mpl-canvas');\n",
" canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
"\n",
" this.canvas = canvas[0];\n",
" this.context = canvas[0].getContext(\"2d\");\n",
"\n",
" var backingStore = this.context.backingStorePixelRatio ||\n",
"\tthis.context.webkitBackingStorePixelRatio ||\n",
"\tthis.context.mozBackingStorePixelRatio ||\n",
"\tthis.context.msBackingStorePixelRatio ||\n",
"\tthis.context.oBackingStorePixelRatio ||\n",
"\tthis.context.backingStorePixelRatio || 1;\n",
"\n",
" mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
"\n",
" var rubberband = $('');\n",
" rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
"\n",
" var pass_mouse_events = true;\n",
"\n",
" canvas_div.resizable({\n",
" start: function(event, ui) {\n",
" pass_mouse_events = false;\n",
" },\n",
" resize: function(event, ui) {\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" stop: function(event, ui) {\n",
" pass_mouse_events = true;\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" });\n",
"\n",
" function mouse_event_fn(event) {\n",
" if (pass_mouse_events)\n",
" return fig.mouse_event(event, event['data']);\n",
" }\n",
"\n",
" rubberband.mousedown('button_press', mouse_event_fn);\n",
" rubberband.mouseup('button_release', mouse_event_fn);\n",
" // Throttle sequential mouse events to 1 every 20ms.\n",
" rubberband.mousemove('motion_notify', mouse_event_fn);\n",
"\n",
" rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
" rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
"\n",
" canvas_div.on(\"wheel\", function (event) {\n",
" event = event.originalEvent;\n",
" event['data'] = 'scroll'\n",
" if (event.deltaY < 0) {\n",
" event.step = 1;\n",
" } else {\n",
" event.step = -1;\n",
" }\n",
" mouse_event_fn(event);\n",
" });\n",
"\n",
" canvas_div.append(canvas);\n",
" canvas_div.append(rubberband);\n",
"\n",
" this.rubberband = rubberband;\n",
" this.rubberband_canvas = rubberband[0];\n",
" this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
" this.rubberband_context.strokeStyle = \"#000000\";\n",
"\n",
" this._resize_canvas = function(width, height) {\n",
" // Keep the size of the canvas, canvas container, and rubber band\n",
" // canvas in synch.\n",
" canvas_div.css('width', width)\n",
" canvas_div.css('height', height)\n",
"\n",
" canvas.attr('width', width * mpl.ratio);\n",
" canvas.attr('height', height * mpl.ratio);\n",
" canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n",
"\n",
" rubberband.attr('width', width);\n",
" rubberband.attr('height', height);\n",
" }\n",
"\n",
" // Set the figure to an initial 600x600px, this will subsequently be updated\n",
" // upon first draw.\n",
" this._resize_canvas(600, 600);\n",
"\n",
" // Disable right mouse context menu.\n",
" $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
" return false;\n",
" });\n",
"\n",
" function set_focus () {\n",
" canvas.focus();\n",
" canvas_div.focus();\n",
" }\n",
"\n",
" window.setTimeout(set_focus, 100);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" // put a spacer in here.\n",
" continue;\n",
" }\n",
" var button = $('');\n",
" button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
" 'ui-button-icon-only');\n",
" button.attr('role', 'button');\n",
" button.attr('aria-disabled', 'false');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
"\n",
" var icon_img = $('');\n",
" icon_img.addClass('ui-button-icon-primary ui-icon');\n",
" icon_img.addClass(image);\n",
" icon_img.addClass('ui-corner-all');\n",
"\n",
" var tooltip_span = $('');\n",
" tooltip_span.addClass('ui-button-text');\n",
" tooltip_span.html(tooltip);\n",
"\n",
" button.append(icon_img);\n",
" button.append(tooltip_span);\n",
"\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" var fmt_picker_span = $('');\n",
"\n",
" var fmt_picker = $('');\n",
" fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
" fmt_picker_span.append(fmt_picker);\n",
" nav_element.append(fmt_picker_span);\n",
" this.format_dropdown = fmt_picker[0];\n",
"\n",
" for (var ind in mpl.extensions) {\n",
" var fmt = mpl.extensions[ind];\n",
" var option = $(\n",
" '', {selected: fmt === mpl.default_extension}).html(fmt);\n",
" fmt_picker.append(option)\n",
" }\n",
"\n",
" // Add hover states to the ui-buttons\n",
" $( \".ui-button\" ).hover(\n",
" function() { $(this).addClass(\"ui-state-hover\");},\n",
" function() { $(this).removeClass(\"ui-state-hover\");}\n",
" );\n",
"\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"}\n",
"\n",
"mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
" // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
" // which will in turn request a refresh of the image.\n",
" this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
"}\n",
"\n",
"mpl.figure.prototype.send_message = function(type, properties) {\n",
" properties['type'] = type;\n",
" properties['figure_id'] = this.id;\n",
" this.ws.send(JSON.stringify(properties));\n",
"}\n",
"\n",
"mpl.figure.prototype.send_draw_message = function() {\n",
" if (!this.waiting) {\n",
" this.waiting = true;\n",
" this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
" }\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" var format_dropdown = fig.format_dropdown;\n",
" var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
" fig.ondownload(fig, format);\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
" var size = msg['size'];\n",
" if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
" fig._resize_canvas(size[0], size[1]);\n",
" fig.send_message(\"refresh\", {});\n",
" };\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
" var x0 = msg['x0'] / mpl.ratio;\n",
" var y0 = (fig.canvas.height - msg['y0']) / mpl.ratio;\n",
" var x1 = msg['x1'] / mpl.ratio;\n",
" var y1 = (fig.canvas.height - msg['y1']) / mpl.ratio;\n",
" x0 = Math.floor(x0) + 0.5;\n",
" y0 = Math.floor(y0) + 0.5;\n",
" x1 = Math.floor(x1) + 0.5;\n",
" y1 = Math.floor(y1) + 0.5;\n",
" var min_x = Math.min(x0, x1);\n",
" var min_y = Math.min(y0, y1);\n",
" var width = Math.abs(x1 - x0);\n",
" var height = Math.abs(y1 - y0);\n",
"\n",
" fig.rubberband_context.clearRect(\n",
" 0, 0, fig.canvas.width, fig.canvas.height);\n",
"\n",
" fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
" // Updates the figure title.\n",
" fig.header.textContent = msg['label'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
" var cursor = msg['cursor'];\n",
" switch(cursor)\n",
" {\n",
" case 0:\n",
" cursor = 'pointer';\n",
" break;\n",
" case 1:\n",
" cursor = 'default';\n",
" break;\n",
" case 2:\n",
" cursor = 'crosshair';\n",
" break;\n",
" case 3:\n",
" cursor = 'move';\n",
" break;\n",
" }\n",
" fig.rubberband_canvas.style.cursor = cursor;\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_message = function(fig, msg) {\n",
" fig.message.textContent = msg['message'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
" // Request the server to send over a new figure.\n",
" fig.send_draw_message();\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
" fig.image_mode = msg['mode'];\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Called whenever the canvas gets updated.\n",
" this.send_message(\"ack\", {});\n",
"}\n",
"\n",
"// A function to construct a web socket function for onmessage handling.\n",
"// Called in the figure constructor.\n",
"mpl.figure.prototype._make_on_message_function = function(fig) {\n",
" return function socket_on_message(evt) {\n",
" if (evt.data instanceof Blob) {\n",
" /* FIXME: We get \"Resource interpreted as Image but\n",
" * transferred with MIME type text/plain:\" errors on\n",
" * Chrome. But how to set the MIME type? It doesn't seem\n",
" * to be part of the websocket stream */\n",
" evt.data.type = \"image/png\";\n",
"\n",
" /* Free the memory for the previous frames */\n",
" if (fig.imageObj.src) {\n",
" (window.URL || window.webkitURL).revokeObjectURL(\n",
" fig.imageObj.src);\n",
" }\n",
"\n",
" fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
" evt.data);\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
" else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
" fig.imageObj.src = evt.data;\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
"\n",
" var msg = JSON.parse(evt.data);\n",
" var msg_type = msg['type'];\n",
"\n",
" // Call the \"handle_{type}\" callback, which takes\n",
" // the figure and JSON message as its only arguments.\n",
" try {\n",
" var callback = fig[\"handle_\" + msg_type];\n",
" } catch (e) {\n",
" console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
" return;\n",
" }\n",
"\n",
" if (callback) {\n",
" try {\n",
" // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
" callback(fig, msg);\n",
" } catch (e) {\n",
" console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
" }\n",
" }\n",
" };\n",
"}\n",
"\n",
"// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
"mpl.findpos = function(e) {\n",
" //this section is from http://www.quirksmode.org/js/events_properties.html\n",
" var targ;\n",
" if (!e)\n",
" e = window.event;\n",
" if (e.target)\n",
" targ = e.target;\n",
" else if (e.srcElement)\n",
" targ = e.srcElement;\n",
" if (targ.nodeType == 3) // defeat Safari bug\n",
" targ = targ.parentNode;\n",
"\n",
" // jQuery normalizes the pageX and pageY\n",
" // pageX,Y are the mouse positions relative to the document\n",
" // offset() returns the position of the element relative to the document\n",
" var x = e.pageX - $(targ).offset().left;\n",
" var y = e.pageY - $(targ).offset().top;\n",
"\n",
" return {\"x\": x, \"y\": y};\n",
"};\n",
"\n",
"/*\n",
" * return a copy of an object with only non-object keys\n",
" * we need this to avoid circular references\n",
" * http://stackoverflow.com/a/24161582/3208463\n",
" */\n",
"function simpleKeys (original) {\n",
" return Object.keys(original).reduce(function (obj, key) {\n",
" if (typeof original[key] !== 'object')\n",
" obj[key] = original[key]\n",
" return obj;\n",
" }, {});\n",
"}\n",
"\n",
"mpl.figure.prototype.mouse_event = function(event, name) {\n",
" var canvas_pos = mpl.findpos(event)\n",
"\n",
" if (name === 'button_press')\n",
" {\n",
" this.canvas.focus();\n",
" this.canvas_div.focus();\n",
" }\n",
"\n",
" var x = canvas_pos.x * mpl.ratio;\n",
" var y = canvas_pos.y * mpl.ratio;\n",
"\n",
" this.send_message(name, {x: x, y: y, button: event.button,\n",
" step: event.step,\n",
" guiEvent: simpleKeys(event)});\n",
"\n",
" /* This prevents the web browser from automatically changing to\n",
" * the text insertion cursor when the button is pressed. We want\n",
" * to control all of the cursor setting manually through the\n",
" * 'cursor' event from matplotlib */\n",
" event.preventDefault();\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" // Handle any extra behaviour associated with a key event\n",
"}\n",
"\n",
"mpl.figure.prototype.key_event = function(event, name) {\n",
"\n",
" // Prevent repeat events\n",
" if (name == 'key_press')\n",
" {\n",
" if (event.which === this._key)\n",
" return;\n",
" else\n",
" this._key = event.which;\n",
" }\n",
" if (name == 'key_release')\n",
" this._key = null;\n",
"\n",
" var value = '';\n",
" if (event.ctrlKey && event.which != 17)\n",
" value += \"ctrl+\";\n",
" if (event.altKey && event.which != 18)\n",
" value += \"alt+\";\n",
" if (event.shiftKey && event.which != 16)\n",
" value += \"shift+\";\n",
"\n",
" value += 'k';\n",
" value += event.which.toString();\n",
"\n",
" this._key_event_extra(event, name);\n",
"\n",
" this.send_message(name, {key: value,\n",
" guiEvent: simpleKeys(event)});\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
" if (name == 'download') {\n",
" this.handle_save(this, null);\n",
" } else {\n",
" this.send_message(\"toolbar_button\", {name: name});\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
" this.message.textContent = tooltip;\n",
"};\n",
"mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
"\n",
"mpl.extensions = [\"eps\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\"];\n",
"\n",
"mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
" // Create a \"websocket\"-like object which calls the given IPython comm\n",
" // object with the appropriate methods. Currently this is a non binary\n",
" // socket, so there is still some room for performance tuning.\n",
" var ws = {};\n",
"\n",
" ws.close = function() {\n",
" comm.close()\n",
" };\n",
" ws.send = function(m) {\n",
" //console.log('sending', m);\n",
" comm.send(m);\n",
" };\n",
" // Register the callback with on_msg.\n",
" comm.on_msg(function(msg) {\n",
" //console.log('receiving', msg['content']['data'], msg);\n",
" // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
" ws.onmessage(msg['content']['data'])\n",
" });\n",
" return ws;\n",
"}\n",
"\n",
"mpl.mpl_figure_comm = function(comm, msg) {\n",
" // This is the function which gets called when the mpl process\n",
" // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
"\n",
" var id = msg.content.data.id;\n",
" // Get hold of the div created by the display call when the Comm\n",
" // socket was opened in Python.\n",
" var element = $(\"#\" + id);\n",
" var ws_proxy = comm_websocket_adapter(comm)\n",
"\n",
" function ondownload(figure, format) {\n",
" window.open(figure.imageObj.src);\n",
" }\n",
"\n",
" var fig = new mpl.figure(id, ws_proxy,\n",
" ondownload,\n",
" element.get(0));\n",
"\n",
" // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
" // web socket which is closed, not our websocket->open comm proxy.\n",
" ws_proxy.onopen();\n",
"\n",
" fig.parent_element = element.get(0);\n",
" fig.cell_info = mpl.find_output_cell(\"\");\n",
" if (!fig.cell_info) {\n",
" console.error(\"Failed to find cell for figure\", id, fig);\n",
" return;\n",
" }\n",
"\n",
" var output_index = fig.cell_info[2]\n",
" var cell = fig.cell_info[0];\n",
"\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_close = function(fig, msg) {\n",
" var width = fig.canvas.width/mpl.ratio\n",
" fig.root.unbind('remove')\n",
"\n",
" // Update the output cell to use the data from the current canvas.\n",
" fig.push_to_output();\n",
" var dataURL = fig.canvas.toDataURL();\n",
" // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
" // the notebook keyboard shortcuts fail.\n",
" IPython.keyboard_manager.enable()\n",
" $(fig.parent_element).html('');\n",
" fig.close_ws(fig, msg);\n",
"}\n",
"\n",
"mpl.figure.prototype.close_ws = function(fig, msg){\n",
" fig.send_message('closing', msg);\n",
" // fig.ws.close()\n",
"}\n",
"\n",
"mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
" // Turn the data on the canvas into data in the output cell.\n",
" var width = this.canvas.width/mpl.ratio\n",
" var dataURL = this.canvas.toDataURL();\n",
" this.cell_info[1]['text/html'] = '';\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Tell IPython that the notebook contents must change.\n",
" IPython.notebook.set_dirty(true);\n",
" this.send_message(\"ack\", {});\n",
" var fig = this;\n",
" // Wait a second, then push the new image to the DOM so\n",
" // that it is saved nicely (might be nice to debounce this).\n",
" setTimeout(function () { fig.push_to_output() }, 1000);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items){\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) { continue; };\n",
"\n",
" var button = $('');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" // Add the status bar.\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"\n",
" // Add the close button to the window.\n",
" var buttongrp = $('');\n",
" var button = $('');\n",
" button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
" button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
" buttongrp.append(button);\n",
" var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
" titlebar.prepend(buttongrp);\n",
"}\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(el){\n",
" var fig = this\n",
" el.on(\"remove\", function(){\n",
"\tfig.close_ws(fig, {});\n",
" });\n",
"}\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(el){\n",
" // this is important to make the div 'focusable\n",
" el.attr('tabindex', 0)\n",
" // reach out to IPython and tell the keyboard manager to turn it's self\n",
" // off when our div gets focus\n",
"\n",
" // location in version 3\n",
" if (IPython.notebook.keyboard_manager) {\n",
" IPython.notebook.keyboard_manager.register_events(el);\n",
" }\n",
" else {\n",
" // location in version 2\n",
" IPython.keyboard_manager.register_events(el);\n",
" }\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" var manager = IPython.notebook.keyboard_manager;\n",
" if (!manager)\n",
" manager = IPython.keyboard_manager;\n",
"\n",
" // Check for shift+enter\n",
" if (event.shiftKey && event.which == 13) {\n",
" this.canvas_div.blur();\n",
" event.shiftKey = false;\n",
" // Send a \"J\" for go to next cell\n",
" event.which = 74;\n",
" event.keyCode = 74;\n",
" manager.command_mode();\n",
" manager.handle_keydown(event);\n",
" }\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" fig.ondownload(fig, null);\n",
"}\n",
"\n",
"\n",
"mpl.find_output_cell = function(html_output) {\n",
" // Return the cell and output element which can be found *uniquely* in the notebook.\n",
" // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
" // IPython event is triggered only after the cells have been serialised, which for\n",
" // our purposes (turning an active figure into a static one), is too late.\n",
" var cells = IPython.notebook.get_cells();\n",
" var ncells = cells.length;\n",
" for (var i=0; i= 3 moved mimebundle to data attribute of output\n",
" data = data.data;\n",
" }\n",
" if (data['text/html'] == html_output) {\n",
" return [cell, data, j];\n",
" }\n",
" }\n",
" }\n",
" }\n",
"}\n",
"\n",
"// Register the function which deals with the matplotlib target/channel.\n",
"// The kernel may be null if the page has been refreshed.\n",
"if (IPython.notebook.kernel != null) {\n",
" IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
"}\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
""
]
},
"execution_count": 160,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%matplotlib nbagg\n",
"sup_dX_train.iloc[0:,0].plot()\n",
"sup_dX_test.iloc[0:,0].plot()"
]
},
{
"cell_type": "code",
"execution_count": 161,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:18:18.673907Z",
"start_time": "2018-04-23T19:18:18.085186Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Day=1, Predicted=1145.414933, Expected=1175.110000\n",
"Day=2, Predicted=1072.023637, Expected=1069.570000\n",
"Day=3, Predicted=1031.286891, Expected=970.000000\n",
"Day=4, Predicted=1056.892778, Expected=1019.490000\n",
"Day=5, Predicted=1119.638865, Expected=1044.960000\n",
"Day=6, Predicted=989.077785, Expected=1114.420000\n",
"Day=7, Predicted=1049.893891, Expected=1034.570000\n",
"Day=8, Predicted=954.035492, Expected=1025.140000\n",
"Day=9, Predicted=980.269689, Expected=934.870000\n",
"Day=10, Predicted=991.228337, Expected=963.720000\n",
"Day=11, Predicted=1058.290810, Expected=973.080000\n",
"Day=12, Predicted=1063.636146, Expected=1042.080000\n",
"Day=13, Predicted=1060.670082, Expected=1045.400000\n",
"Day=14, Predicted=1059.919691, Expected=1043.270000\n",
"Day=15, Predicted=1105.561472, Expected=1042.340000\n",
"Day=16, Predicted=1109.670684, Expected=1088.990000\n",
"Day=17, Predicted=1130.716002, Expected=1092.000000\n",
"Day=18, Predicted=1169.323573, Expected=1113.990000\n",
"Day=19, Predicted=1161.514553, Expected=1152.600000\n",
"Day=20, Predicted=1150.233271, Expected=1143.990000\n",
"Day=21, Predicted=1208.372951, Expected=1132.990000\n",
"Day=22, Predicted=1211.410066, Expected=1192.300000\n",
"Day=23, Predicted=1201.614343, Expected=1194.000000\n",
"Day=24, Predicted=1227.407582, Expected=1184.500000\n",
"Day=25, Predicted=1227.067474, Expected=1210.970000\n",
"Day=26, Predicted=1240.433854, Expected=1210.000000\n",
"Day=27, Predicted=1231.244233, Expected=1223.990000\n",
"Day=28, Predicted=1211.653618, Expected=1214.170000\n",
"Day=29, Predicted=1181.072530, Expected=1177.050000\n",
"Day=30, Predicted=1188.588764, Expected=1173.740000\n",
"Day=31, Predicted=1193.364115, Expected=1178.850000\n",
"Day=32, Predicted=1204.840758, Expected=1177.990000\n",
"Day=33, Predicted=1216.988701, Expected=1189.910000\n",
"Day=34, Predicted=1229.255227, Expected=1201.940000\n",
"Day=35, Predicted=1250.922171, Expected=1214.210000\n",
"Day=36, Predicted=1264.899806, Expected=1236.150000\n",
"Day=37, Predicted=1262.427555, Expected=1249.990000\n",
"Day=38, Predicted=1267.351764, Expected=1247.000000\n",
"Day=39, Predicted=1272.781805, Expected=1251.980000\n",
"Day=40, Predicted=1296.194925, Expected=1257.290000\n",
"Day=41, Predicted=1313.539452, Expected=1281.160000\n",
"Day=42, Predicted=1364.002792, Expected=1298.440000\n",
"Day=43, Predicted=1368.816864, Expected=1349.260000\n",
"Day=44, Predicted=1380.650969, Expected=1353.340000\n",
"Day=45, Predicted=1399.609198, Expected=1365.430000\n",
"Day=46, Predicted=1451.254539, Expected=1384.550000\n",
"Day=47, Predicted=1486.845221, Expected=1436.500000\n",
"Day=48, Predicted=1547.583521, Expected=1471.990000\n",
"Day=49, Predicted=1578.149315, Expected=1533.000000\n",
"Day=50, Predicted=1567.035634, Expected=1563.390000\n",
"Day=51, Predicted=1600.290507, Expected=1551.300000\n",
"Day=52, Predicted=1624.518539, Expected=1585.390000\n",
"Day=53, Predicted=1718.747964, Expected=1609.570000\n",
"Day=54, Predicted=1737.670068, Expected=1713.000000\n",
"Day=55, Predicted=1810.014106, Expected=1720.430000\n",
"Day=56, Predicted=1853.992253, Expected=1794.990000\n",
"Day=57, Predicted=1595.546283, Expected=1837.930000\n",
"Day=58, Predicted=1786.918341, Expected=1695.610000\n",
"Day=59, Predicted=1813.310876, Expected=1792.730000\n",
"Day=60, Predicted=1755.946364, Expected=1799.990000\n",
"Day=61, Predicted=1794.039907, Expected=1747.810000\n",
"Day=62, Predicted=1831.839039, Expected=1777.480000\n",
"Day=63, Predicted=1915.500492, Expected=1813.230000\n",
"Day=64, Predicted=1993.919279, Expected=1899.160000\n",
"Day=65, Predicted=2075.788826, Expected=1976.230000\n",
"Day=66, Predicted=2076.341009, Expected=2058.910000\n",
"Day=67, Predicted=2139.726507, Expected=2057.000000\n",
"Day=68, Predicted=2272.928173, Expected=2123.290000\n",
"Day=69, Predicted=2425.039988, Expected=2272.750000\n",
"Day=70, Predicted=2365.160100, Expected=2432.970000\n",
"Day=71, Predicted=2203.118203, Expected=2355.000000\n",
"Day=72, Predicted=2019.899789, Expected=2272.700000\n",
"Day=73, Predicted=2263.448578, Expected=2099.990000\n",
"Day=74, Predicted=2293.129505, Expected=2232.780000\n",
"Day=75, Predicted=2120.128204, Expected=2279.480000\n",
"Day=76, Predicted=2367.707131, Expected=2191.580000\n",
"Day=77, Predicted=2431.786891, Expected=2303.290000\n",
"Day=78, Predicted=2498.155168, Expected=2419.990000\n",
"Day=79, Predicted=2563.868803, Expected=2478.990000\n",
"Day=80, Predicted=2540.501432, Expected=2548.050000\n",
"Day=81, Predicted=2695.833498, Expected=2521.360000\n",
"Day=82, Predicted=2856.136998, Expected=2698.000000\n",
"Day=83, Predicted=2590.985427, Expected=2871.290000\n",
"Day=84, Predicted=2859.705242, Expected=2685.640000\n",
"Day=85, Predicted=2823.186891, Expected=2799.730000\n",
"Day=86, Predicted=2939.324016, Expected=2811.390000\n",
"Day=87, Predicted=3016.082284, Expected=2931.150000\n",
"Day=88, Predicted=2559.177148, Expected=2998.980000\n",
"Day=89, Predicted=2763.267491, Expected=2655.710000\n",
"Day=90, Predicted=2354.911801, Expected=2709.010000\n",
"Day=91, Predicted=2455.291338, Expected=2432.210000\n",
"Day=92, Predicted=2492.226891, Expected=2409.980000\n",
"Day=93, Predicted=2632.023345, Expected=2480.430000\n",
"Day=94, Predicted=2460.842393, Expected=2634.940000\n",
"Day=95, Predicted=2637.056518, Expected=2515.250000\n",
"Day=96, Predicted=2736.876891, Expected=2596.980000\n",
"Day=97, Predicted=2570.951052, Expected=2725.080000\n",
"Day=98, Predicted=2726.566866, Expected=2643.350000\n",
"Day=99, Predicted=2702.556891, Expected=2679.990000\n",
"Day=100, Predicted=2478.573804, Expected=2690.760000\n",
"Day=101, Predicted=2528.775449, Expected=2574.840000\n",
"Day=102, Predicted=2404.966025, Expected=2505.610000\n",
"Day=103, Predicted=2578.015081, Expected=2407.910000\n",
"Day=104, Predicted=2569.365020, Expected=2575.750000\n",
"Day=105, Predicted=2551.928374, Expected=2553.120000\n",
"Day=106, Predicted=2479.809034, Expected=2530.000000\n",
"Day=107, Predicted=2457.090947, Expected=2455.190000\n",
"Day=108, Predicted=2528.932857, Expected=2423.630000\n",
"Day=109, Predicted=2563.040619, Expected=2516.660000\n",
"Day=110, Predicted=2617.827040, Expected=2542.410000\n",
"Day=111, Predicted=2636.030239, Expected=2602.000000\n",
"Day=112, Predicted=2622.916735, Expected=2616.960000\n",
"Day=113, Predicted=2453.608491, Expected=2604.840000\n",
"Day=114, Predicted=2585.952860, Expected=2501.150000\n",
"Day=115, Predicted=2543.592592, Expected=2561.110000\n",
"Day=116, Predicted=2261.269493, Expected=2508.990000\n",
"Day=117, Predicted=2357.241762, Expected=2331.050000\n",
"Day=118, Predicted=2395.216891, Expected=2310.010000\n",
"Day=119, Predicted=2341.436656, Expected=2383.420000\n",
"Day=120, Predicted=2176.684982, Expected=2340.000000\n",
"Day=121, Predicted=1888.404456, Expected=2217.240000\n",
"Day=122, Predicted=1939.006977, Expected=1964.310000\n",
"Day=123, Predicted=2256.571939, Expected=1911.780000\n",
"Day=124, Predicted=2325.476601, Expected=2235.190000\n",
"Day=125, Predicted=2278.478424, Expected=2308.150000\n",
"Day=126, Predicted=2829.428473, Expected=2258.990000\n",
"Day=127, Predicted=2610.881451, Expected=2873.480000\n",
"Day=128, Predicted=2826.786765, Expected=2657.450000\n",
"Day=129, Predicted=2765.798945, Expected=2825.270000\n",
"Day=130, Predicted=2774.056891, Expected=2754.280000\n",
"Day=131, Predicted=2505.784398, Expected=2762.260000\n",
"Day=132, Predicted=2566.596497, Expected=2564.000000\n",
"Day=133, Predicted=2676.786891, Expected=2525.990000\n",
"Day=134, Predicted=2790.835471, Expected=2664.990000\n",
"Day=135, Predicted=2693.486170, Expected=2786.070000\n",
"Day=136, Predicted=2727.705015, Expected=2700.210000\n",
"Day=137, Predicted=2845.938246, Expected=2723.990000\n",
"Day=138, Predicted=2635.269790, Expected=2856.880000\n",
"Day=139, Predicted=2726.499387, Expected=2732.590000\n",
"Day=140, Predicted=2798.816891, Expected=2699.900000\n",
"Day=141, Predicted=2863.936665, Expected=2787.020000\n",
"Day=142, Predicted=3195.168223, Expected=2857.340000\n",
"Day=143, Predicted=3236.741289, Expected=3243.490000\n",
"Day=144, Predicted=3398.839768, Expected=3222.220000\n",
"Day=145, Predicted=3442.449519, Expected=3398.230000\n",
"Day=146, Predicted=3332.806482, Expected=3422.430000\n",
"Day=147, Predicted=3435.991960, Expected=3342.800000\n",
"Day=148, Predicted=3633.446213, Expected=3444.980000\n",
"Day=149, Predicted=3840.699465, Expected=3656.150000\n",
"Day=150, Predicted=4033.970635, Expected=3874.000000\n",
"Day=151, Predicted=4280.833422, Expected=4060.470000\n",
"Day=152, Predicted=4086.554909, Expected=4320.600000\n",
"Day=153, Predicted=4349.237983, Expected=4159.930000\n",
"Day=154, Predicted=4286.676262, Expected=4370.010000\n",
"Day=155, Predicted=3999.198426, Expected=4280.010000\n",
"Day=156, Predicted=4222.632917, Expected=4101.720000\n",
"Day=157, Predicted=4056.586251, Expected=4157.410000\n",
"Day=158, Predicted=4039.043048, Expected=4050.990000\n",
"Day=159, Predicted=4103.796891, Expected=4002.000000\n",
"Day=160, Predicted=4160.625089, Expected=4092.000000\n",
"Day=161, Predicted=4311.340314, Expected=4143.490000\n",
"Day=162, Predicted=4376.026316, Expected=4312.030000\n",
"Day=163, Predicted=4362.329991, Expected=4360.000000\n",
"Day=164, Predicted=4358.288040, Expected=4344.320000\n",
"Day=165, Predicted=4401.992021, Expected=4340.110000\n",
"Day=166, Predicted=4584.039420, Expected=4384.990000\n",
"Day=167, Predicted=4605.092588, Expected=4599.000000\n",
"Day=168, Predicted=4750.599442, Expected=4581.980000\n",
"Day=169, Predicted=4927.125702, Expected=4743.940000\n",
"Day=170, Predicted=4558.742035, Expected=4947.990000\n",
"Day=171, Predicted=4645.380709, Expected=4649.990000\n",
"Day=172, Predicted=4412.941336, Expected=4626.050000\n",
"Day=173, Predicted=4426.486492, Expected=4498.250000\n",
"Day=174, Predicted=4638.479355, Expected=4432.510000\n",
"Day=175, Predicted=4639.609913, Expected=4616.180000\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Day=176, Predicted=4265.616735, Expected=4624.180000\n",
"Day=177, Predicted=4364.642342, Expected=4350.000000\n",
"Day=178, Predicted=4275.973012, Expected=4334.360000\n",
"Day=179, Predicted=4246.466743, Expected=4251.360000\n",
"Day=180, Predicted=4197.167053, Expected=4210.720000\n",
"Day=181, Predicted=3789.932549, Expected=4164.520000\n",
"Day=182, Predicted=3203.840192, Expected=3855.320000\n",
"Day=183, Predicted=3745.369716, Expected=3250.400000\n",
"Day=184, Predicted=3749.248821, Expected=3740.020000\n",
"Day=185, Predicted=3736.599597, Expected=3726.510000\n",
"Day=186, Predicted=4049.593571, Expected=3719.970000\n",
"Day=187, Predicted=3835.692642, Expected=4100.000000\n",
"Day=188, Predicted=3888.713087, Expected=3910.110000\n",
"Day=189, Predicted=3520.276753, Expected=3872.060000\n",
"Day=190, Predicted=3673.776126, Expected=3617.470000\n",
"Day=191, Predicted=3799.126891, Expected=3619.010000\n",
"Day=192, Predicted=3571.983451, Expected=3787.330000\n",
"Day=193, Predicted=3997.124159, Expected=3669.010000\n",
"Day=194, Predicted=3896.886137, Expected=3919.780000\n",
"Day=195, Predicted=4188.312416, Expected=3885.090000\n",
"Day=196, Predicted=4208.062216, Expected=4200.000000\n",
"Day=197, Predicted=4186.598951, Expected=4189.420000\n",
"Day=198, Predicted=4350.796891, Expected=4156.990000\n",
"Day=199, Predicted=4408.014815, Expected=4339.000000\n",
"Day=200, Predicted=4409.935427, Expected=4394.810000\n",
"Day=201, Predicted=4292.506990, Expected=4392.710000\n",
"Day=202, Predicted=4252.870909, Expected=4307.990000\n",
"Day=203, Predicted=4331.836891, Expected=4214.840000\n",
"Day=204, Predicted=4382.584289, Expected=4320.040000\n",
"Day=205, Predicted=4440.915141, Expected=4362.990000\n",
"Day=206, Predicted=4595.883277, Expected=4425.000000\n",
"Day=207, Predicted=4757.122020, Expected=4603.490000\n",
"Day=208, Predicted=4771.613566, Expected=4769.550000\n",
"Day=209, Predicted=4830.354995, Expected=4750.000000\n",
"Day=210, Predicted=5388.987672, Expected=4814.990000\n",
"Day=211, Predicted=5591.395561, Expected=5440.000000\n",
"Day=212, Predicted=5799.660009, Expected=5624.800000\n",
"Day=213, Predicted=5648.409014, Expected=5819.130000\n",
"Day=214, Predicted=5763.280653, Expected=5693.700000\n",
"Day=215, Predicted=5550.222736, Expected=5754.900000\n",
"Day=216, Predicted=5614.143804, Expected=5594.000000\n",
"Day=217, Predicted=5715.806891, Expected=5574.440000\n",
"Day=218, Predicted=5961.804688, Expected=5704.010000\n",
"Day=219, Predicted=6038.622159, Expected=5989.100000\n",
"Day=220, Predicted=6022.755022, Expected=6024.860000\n",
"Day=221, Predicted=5857.893805, Expected=6005.050000\n",
"Day=222, Predicted=5456.416511, Expected=5905.990000\n",
"Day=223, Predicted=5759.565018, Expected=5525.430000\n",
"Day=224, Predicted=5899.309142, Expected=5739.970000\n",
"Day=225, Predicted=5689.118419, Expected=5891.610000\n",
"Day=226, Predicted=5778.064712, Expected=5780.000000\n",
"Day=227, Predicted=6172.850303, Expected=5752.010000\n",
"Day=228, Predicted=6128.297918, Expected=6140.010000\n",
"Day=229, Predicted=6438.638662, Expected=6124.160000\n",
"Day=230, Predicted=6742.044101, Expected=6445.010000\n",
"Day=231, Predicted=6995.437835, Expected=6783.690000\n",
"Day=232, Predicted=7157.806920, Expected=7039.980000\n",
"Day=233, Predicted=7385.529732, Expected=7170.010000\n",
"Day=234, Predicted=7416.171340, Expected=7412.550000\n",
"Day=235, Predicted=6886.349040, Expected=7392.000000\n",
"Day=236, Predicted=7166.637974, Expected=6969.760000\n",
"Day=237, Predicted=7488.406568, Expected=7126.630000\n",
"Day=238, Predicted=7063.754815, Expected=7467.960000\n",
"Day=239, Predicted=6503.642208, Expected=7156.000000\n",
"Day=240, Predicted=6299.191724, Expected=6577.620000\n",
"Day=241, Predicted=5868.508248, Expected=6346.700000\n",
"Day=242, Predicted=6525.301948, Expected=5886.350000\n",
"Day=243, Predicted=6612.486631, Expected=6535.870000\n",
"Day=244, Predicted=7244.304108, Expected=6605.000000\n",
"Day=245, Predicted=7788.321910, Expected=7294.000000\n",
"Day=246, Predicted=7714.027408, Expected=7838.530000\n",
"Day=247, Predicted=7780.953733, Expected=7714.710000\n",
"Day=248, Predicted=7993.395186, Expected=7777.010000\n",
"Day=249, Predicted=8210.236894, Expected=8031.820000\n",
"Day=250, Predicted=8056.334067, Expected=8256.010000\n",
"Day=251, Predicted=8242.313298, Expected=8109.000000\n",
"Day=252, Predicted=7934.900782, Expected=8250.000000\n",
"Day=253, Predicted=8290.886670, Expected=8031.160000\n",
"Day=254, Predicted=8822.010656, Expected=8215.010000\n",
"Day=255, Predicted=9372.592563, Expected=8795.500000\n",
"Day=256, Predicted=9724.990441, Expected=9401.110000\n",
"Day=257, Predicted=9923.373194, Expected=9768.710000\n",
"Day=258, Predicted=9957.448268, Expected=9949.000000\n",
"Day=259, Predicted=9933.106929, Expected=9935.980000\n",
"Day=260, Predicted=10818.847081, Expected=9903.000000\n",
"Day=261, Predicted=10927.262554, Expected=10869.840000\n",
"Day=262, Predicted=11246.051091, Expected=10930.240000\n",
"Day=263, Predicted=11598.085138, Expected=11290.000000\n",
"Day=264, Predicted=11719.223965, Expected=11643.980000\n",
"Day=265, Predicted=14038.987054, Expected=11718.350000\n",
"Day=266, Predicted=17338.997054, Expected=14090.000000\n",
"Day=267, Predicted=16314.188955, Expected=17390.010000\n",
"Day=268, Predicted=15255.082826, Expected=16367.030000\n",
"Day=269, Predicted=15312.118895, Expected=15309.980000\n",
"Day=270, Predicted=16891.994649, Expected=15290.010000\n",
"Day=271, Predicted=17691.892885, Expected=16885.760000\n",
"Day=272, Predicted=16636.431690, Expected=17730.120000\n",
"Day=273, Predicted=16770.524764, Expected=16689.610000\n",
"Day=274, Predicted=17707.775912, Expected=16749.780000\n",
"Day=275, Predicted=19602.157518, Expected=17738.670000\n",
"Day=276, Predicted=19325.434215, Expected=19650.010000\n",
"Day=277, Predicted=19046.705693, Expected=19378.990000\n",
"Day=278, Predicted=17856.221246, Expected=19039.010000\n",
"Day=279, Predicted=16513.346702, Expected=17838.730000\n",
"Day=280, Predicted=15764.101731, Expected=16496.890000\n",
"Day=281, Predicted=14232.556180, Expected=15758.800000\n",
"Day=282, Predicted=15039.851282, Expected=14210.570000\n",
"Day=283, Predicted=14165.077511, Expected=15075.890000\n",
"Day=284, Predicted=14183.234196, Expected=14221.940000\n",
"Day=285, Predicted=15800.962907, Expected=14171.980000\n",
"Day=286, Predicted=15299.562032, Expected=15790.880000\n",
"Day=287, Predicted=14398.042686, Expected=15367.080000\n",
"Day=288, Predicted=14583.640555, Expected=14450.010000\n",
"Day=289, Predicted=12795.872324, Expected=14565.050000\n",
"Day=290, Predicted=13827.091282, Expected=12839.990000\n",
"Day=291, Predicted=13418.188640, Expected=13863.130000\n",
"Day=292, Predicted=14745.471282, Expected=13480.010000\n",
"Day=293, Predicted=15054.549540, Expected=14781.510000\n",
"Day=294, Predicted=15153.311992, Expected=15098.140000\n",
"Day=295, Predicted=16909.052627, Expected=15144.990000\n",
"Day=296, Predicted=17076.809976, Expected=16960.010000\n",
"Day=297, Predicted=16092.833432, Expected=17098.990000\n",
"Day=298, Predicted=14921.175359, Expected=16174.220000\n",
"Day=299, Predicted=14408.547851, Expected=14993.740000\n",
"Day=300, Predicted=14875.873046, Expected=14480.990000\n",
"Day=301, Predicted=13241.258409, Expected=14875.180000\n",
"Day=302, Predicted=13783.961505, Expected=13308.060000\n",
"Day=303, Predicted=14142.411403, Expected=13820.000000\n",
"Day=304, Predicted=13578.834105, Expected=14187.950000\n",
"Day=305, Predicted=13605.902042, Expected=13656.230000\n",
"Day=306, Predicted=11494.665436, Expected=13590.000000\n",
"Day=307, Predicted=11120.305567, Expected=11570.010000\n",
"Day=308, Predicted=11348.016272, Expected=11200.010000\n",
"Day=309, Predicted=11510.786891, Expected=11305.530000\n",
"Day=310, Predicted=12759.496514, Expected=11498.990000\n",
"Day=311, Predicted=11467.059432, Expected=12762.800000\n",
"Day=312, Predicted=10705.295634, Expected=11518.170000\n",
"Day=313, Predicted=10851.979664, Expected=10766.700000\n",
"Day=314, Predicted=11355.018088, Expected=10824.940000\n",
"Day=315, Predicted=11067.072148, Expected=11356.790000\n",
"Day=316, Predicted=11106.705883, Expected=11118.000000\n",
"Day=317, Predicted=11341.956063, Expected=11086.890000\n",
"Day=318, Predicted=11532.006562, Expected=11319.000000\n",
"Day=319, Predicted=11031.981257, Expected=11536.000000\n",
"Day=320, Predicted=9920.584160, Expected=11123.010000\n",
"Day=321, Predicted=10122.109961, Expected=9995.000000\n",
"Day=322, Predicted=8958.746961, Expected=10099.990000\n",
"Day=323, Predicted=8827.811328, Expected=9014.230000\n",
"Day=324, Predicted=9243.252519, Expected=8787.520000\n",
"Day=325, Predicted=8113.153701, Expected=9240.000000\n",
"Day=326, Predicted=6854.156246, Expected=8167.910000\n",
"Day=327, Predicted=7652.421282, Expected=6905.190000\n",
"Day=328, Predicted=7571.887943, Expected=7688.460000\n",
"Day=329, Predicted=8180.645152, Expected=7575.750000\n",
"Day=330, Predicted=8624.127130, Expected=8218.100000\n",
"Day=331, Predicted=8548.441608, Expected=8671.010000\n",
"Day=332, Predicted=8016.978143, Expected=8547.490000\n",
"Day=333, Predicted=8858.130988, Expected=8072.990000\n",
"Day=334, Predicted=8455.376578, Expected=8872.280000\n",
"Day=335, Predicted=9437.930129, Expected=8520.010000\n",
"Day=336, Predicted=9982.644097, Expected=9472.980000\n",
"Day=337, Predicted=10146.591131, Expected=10031.230000\n",
"Day=338, Predicted=11070.532897, Expected=10167.490000\n",
"Day=339, Predicted=10321.810828, Expected=11121.500000\n",
"Day=340, Predicted=11103.961282, Expected=10380.040000\n",
"Day=341, Predicted=11228.784842, Expected=11140.000000\n",
"Day=342, Predicted=10369.544627, Expected=11235.570000\n",
"Day=343, Predicted=9754.547711, Expected=10454.270000\n",
"Day=344, Predicted=10127.351351, Expected=9830.000000\n",
"Day=345, Predicted=9601.311517, Expected=10144.990000\n",
"Day=346, Predicted=9617.787028, Expected=9688.620000\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Day=347, Predicted=10311.780302, Expected=9597.990000\n",
"Day=348, Predicted=10543.506886, Expected=10300.000000\n",
"Day=349, Predicted=10232.733021, Expected=10566.570000\n",
"Day=350, Predicted=10871.681571, Expected=10307.270000\n",
"Day=351, Predicted=10999.922046, Expected=10895.920000\n",
"Day=352, Predicted=11382.009445, Expected=11000.000000\n",
"Day=353, Predicted=11472.734797, Expected=11432.500000\n",
"Day=354, Predicted=11383.543619, Expected=11469.900000\n",
"Day=355, Predicted=10622.088313, Expected=11377.540000\n",
"Day=356, Predicted=9849.706684, Expected=10700.000000\n",
"Day=357, Predicted=9237.079436, Expected=9920.000000\n",
"Day=358, Predicted=9270.235960, Expected=9304.900000\n",
"Day=359, Predicted=8703.579619, Expected=9255.000000\n",
"Day=360, Predicted=9524.324304, Expected=8795.440000\n",
"Day=361, Predicted=9053.399642, Expected=9533.880000\n",
"Day=362, Predicted=9178.474940, Expected=9120.000000\n",
"Day=363, Predicted=8149.625942, Expected=9145.410000\n",
"Day=364, Predicted=8288.812356, Expected=8207.030000\n",
"Day=365, Predicted=8289.461508, Expected=8259.990000\n",
"Day=366, Predicted=7770.995014, Expected=8275.000000\n",
"Day=367, Predicted=8174.956255, Expected=7865.020000\n",
"Day=368, Predicted=8461.118322, Expected=8192.000000\n",
"Day=369, Predicted=8852.178199, Expected=8497.800000\n",
"Day=370, Predicted=8909.157852, Expected=8900.000000\n",
"Day=371, Predicted=8653.555479, Expected=8891.810000\n",
"Day=372, Predicted=8954.141580, Expected=8715.090000\n",
"Day=373, Predicted=8446.590039, Expected=8927.100000\n",
"Day=374, Predicted=8474.241704, Expected=8531.340000\n",
"Day=375, Predicted=8047.228856, Expected=8453.000000\n",
"Day=376, Predicted=7733.378346, Expected=8145.000000\n",
"Day=377, Predicted=7961.712574, Expected=7793.610000\n",
"Day=378, Predicted=6995.940436, Expected=7942.720000\n",
"Day=379, Predicted=6781.322123, Expected=7079.990000\n",
"Day=380, Predicted=6957.171936, Expected=6848.010000\n",
"Day=381, Predicted=6804.514098, Expected=6928.500000\n",
"Day=382, Predicted=7060.510191, Expected=6816.010000\n",
"Day=383, Predicted=7405.089404, Expected=7045.010000\n",
"Day=384, Predicted=6718.649055, Expected=7424.900000\n",
"Day=385, Predicted=6814.231034, Expected=6791.680000\n",
"Day=386, Predicted=6536.876798, Expected=6785.850000\n",
"Day=387, Predicted=6961.234960, Expected=6619.010000\n",
"Day=388, Predicted=7031.806891, Expected=6894.010000\n",
"Day=389, Predicted=6680.952446, Expected=7020.010000\n",
"Day=390, Predicted=6877.338561, Expected=6771.130000\n",
"Day=391, Predicted=6954.786891, Expected=6824.990000\n",
"Day=392, Predicted=7899.233303, Expected=6942.990000\n",
"Day=393, Predicted=7917.595351, Expected=7916.000000\n",
"Day=394, Predicted=8015.971720, Expected=7893.190000\n",
"Day=395, Predicted=8305.786542, Expected=8003.110000\n",
"Day=396, Predicted=7971.297661, Expected=8355.250000\n",
"Day=397, Predicted=7890.112991, Expected=8048.930000\n",
"Day=398, Predicted=8163.991735, Expected=7892.100000\n",
"Day=399, Predicted=8279.162879, Expected=8152.050000\n",
"Day=400, Predicted=8817.661079, Expected=8274.000000\n",
"Day=401, Predicted=8916.104731, Expected=8866.270000\n",
"Day=402, Predicted=8793.735333, Expected=8915.420000\n"
]
}
],
"source": [
"# walk-forward validation on the test data\n",
"## NOTE: THIS LOOKS AWESOME BUT IS JUST MAKING SURE\n",
"## IT WORKS; note the extra knowledge of `raw_x`\n",
"## in the diff inversion\n",
"predictions = []\n",
"yhats = []\n",
"train_reshaped = train_scaled[:, 0].reshape(len(train_scaled), 1, 1)\n",
"for i in range(len(test_scaled)):\n",
" # make one-step forecast\n",
" X, y = test_scaled[i, 0:-1], test_scaled[i, -1]\n",
" yhat = forecast(lstm, 1, X)\n",
" yhats.append(yhat)\n",
" # invert scaling\n",
" yhat = invert_scale(scaler, X, yhat)\n",
" # invert differencing\n",
" yhat = inverse_difference(raw_X, yhat, len(test_scaled)+1-i)\n",
" # store forecast\n",
" predictions.append(yhat)\n",
" expected = raw_X[len(sup_dX_train) + i]\n",
" print('Day=%d, Predicted=%f, Expected=%f' % (i+1, yhat, expected))"
]
},
{
"cell_type": "code",
"execution_count": 162,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:18:47.633756Z",
"start_time": "2018-04-23T19:18:47.549330Z"
},
"scrolled": false,
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"application/javascript": [
"/* Put everything inside the global mpl namespace */\n",
"window.mpl = {};\n",
"\n",
"\n",
"mpl.get_websocket_type = function() {\n",
" if (typeof(WebSocket) !== 'undefined') {\n",
" return WebSocket;\n",
" } else if (typeof(MozWebSocket) !== 'undefined') {\n",
" return MozWebSocket;\n",
" } else {\n",
" alert('Your browser does not have WebSocket support.' +\n",
" 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
" 'Firefox 4 and 5 are also supported but you ' +\n",
" 'have to enable WebSockets in about:config.');\n",
" };\n",
"}\n",
"\n",
"mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
" this.id = figure_id;\n",
"\n",
" this.ws = websocket;\n",
"\n",
" this.supports_binary = (this.ws.binaryType != undefined);\n",
"\n",
" if (!this.supports_binary) {\n",
" var warnings = document.getElementById(\"mpl-warnings\");\n",
" if (warnings) {\n",
" warnings.style.display = 'block';\n",
" warnings.textContent = (\n",
" \"This browser does not support binary websocket messages. \" +\n",
" \"Performance may be slow.\");\n",
" }\n",
" }\n",
"\n",
" this.imageObj = new Image();\n",
"\n",
" this.context = undefined;\n",
" this.message = undefined;\n",
" this.canvas = undefined;\n",
" this.rubberband_canvas = undefined;\n",
" this.rubberband_context = undefined;\n",
" this.format_dropdown = undefined;\n",
"\n",
" this.image_mode = 'full';\n",
"\n",
" this.root = $('');\n",
" this._root_extra_style(this.root)\n",
" this.root.attr('style', 'display: inline-block');\n",
"\n",
" $(parent_element).append(this.root);\n",
"\n",
" this._init_header(this);\n",
" this._init_canvas(this);\n",
" this._init_toolbar(this);\n",
"\n",
" var fig = this;\n",
"\n",
" this.waiting = false;\n",
"\n",
" this.ws.onopen = function () {\n",
" fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
" fig.send_message(\"send_image_mode\", {});\n",
" if (mpl.ratio != 1) {\n",
" fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n",
" }\n",
" fig.send_message(\"refresh\", {});\n",
" }\n",
"\n",
" this.imageObj.onload = function() {\n",
" if (fig.image_mode == 'full') {\n",
" // Full images could contain transparency (where diff images\n",
" // almost always do), so we need to clear the canvas so that\n",
" // there is no ghosting.\n",
" fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
" }\n",
" fig.context.drawImage(fig.imageObj, 0, 0);\n",
" };\n",
"\n",
" this.imageObj.onunload = function() {\n",
" fig.ws.close();\n",
" }\n",
"\n",
" this.ws.onmessage = this._make_on_message_function(this);\n",
"\n",
" this.ondownload = ondownload;\n",
"}\n",
"\n",
"mpl.figure.prototype._init_header = function() {\n",
" var titlebar = $(\n",
" '');\n",
" var titletext = $(\n",
" '');\n",
" titlebar.append(titletext)\n",
" this.root.append(titlebar);\n",
" this.header = titletext[0];\n",
"}\n",
"\n",
"\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._init_canvas = function() {\n",
" var fig = this;\n",
"\n",
" var canvas_div = $('');\n",
"\n",
" canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
"\n",
" function canvas_keyboard_event(event) {\n",
" return fig.key_event(event, event['data']);\n",
" }\n",
"\n",
" canvas_div.keydown('key_press', canvas_keyboard_event);\n",
" canvas_div.keyup('key_release', canvas_keyboard_event);\n",
" this.canvas_div = canvas_div\n",
" this._canvas_extra_style(canvas_div)\n",
" this.root.append(canvas_div);\n",
"\n",
" var canvas = $('');\n",
" canvas.addClass('mpl-canvas');\n",
" canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
"\n",
" this.canvas = canvas[0];\n",
" this.context = canvas[0].getContext(\"2d\");\n",
"\n",
" var backingStore = this.context.backingStorePixelRatio ||\n",
"\tthis.context.webkitBackingStorePixelRatio ||\n",
"\tthis.context.mozBackingStorePixelRatio ||\n",
"\tthis.context.msBackingStorePixelRatio ||\n",
"\tthis.context.oBackingStorePixelRatio ||\n",
"\tthis.context.backingStorePixelRatio || 1;\n",
"\n",
" mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
"\n",
" var rubberband = $('');\n",
" rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
"\n",
" var pass_mouse_events = true;\n",
"\n",
" canvas_div.resizable({\n",
" start: function(event, ui) {\n",
" pass_mouse_events = false;\n",
" },\n",
" resize: function(event, ui) {\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" stop: function(event, ui) {\n",
" pass_mouse_events = true;\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" });\n",
"\n",
" function mouse_event_fn(event) {\n",
" if (pass_mouse_events)\n",
" return fig.mouse_event(event, event['data']);\n",
" }\n",
"\n",
" rubberband.mousedown('button_press', mouse_event_fn);\n",
" rubberband.mouseup('button_release', mouse_event_fn);\n",
" // Throttle sequential mouse events to 1 every 20ms.\n",
" rubberband.mousemove('motion_notify', mouse_event_fn);\n",
"\n",
" rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
" rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
"\n",
" canvas_div.on(\"wheel\", function (event) {\n",
" event = event.originalEvent;\n",
" event['data'] = 'scroll'\n",
" if (event.deltaY < 0) {\n",
" event.step = 1;\n",
" } else {\n",
" event.step = -1;\n",
" }\n",
" mouse_event_fn(event);\n",
" });\n",
"\n",
" canvas_div.append(canvas);\n",
" canvas_div.append(rubberband);\n",
"\n",
" this.rubberband = rubberband;\n",
" this.rubberband_canvas = rubberband[0];\n",
" this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
" this.rubberband_context.strokeStyle = \"#000000\";\n",
"\n",
" this._resize_canvas = function(width, height) {\n",
" // Keep the size of the canvas, canvas container, and rubber band\n",
" // canvas in synch.\n",
" canvas_div.css('width', width)\n",
" canvas_div.css('height', height)\n",
"\n",
" canvas.attr('width', width * mpl.ratio);\n",
" canvas.attr('height', height * mpl.ratio);\n",
" canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n",
"\n",
" rubberband.attr('width', width);\n",
" rubberband.attr('height', height);\n",
" }\n",
"\n",
" // Set the figure to an initial 600x600px, this will subsequently be updated\n",
" // upon first draw.\n",
" this._resize_canvas(600, 600);\n",
"\n",
" // Disable right mouse context menu.\n",
" $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
" return false;\n",
" });\n",
"\n",
" function set_focus () {\n",
" canvas.focus();\n",
" canvas_div.focus();\n",
" }\n",
"\n",
" window.setTimeout(set_focus, 100);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" // put a spacer in here.\n",
" continue;\n",
" }\n",
" var button = $('');\n",
" button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
" 'ui-button-icon-only');\n",
" button.attr('role', 'button');\n",
" button.attr('aria-disabled', 'false');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
"\n",
" var icon_img = $('');\n",
" icon_img.addClass('ui-button-icon-primary ui-icon');\n",
" icon_img.addClass(image);\n",
" icon_img.addClass('ui-corner-all');\n",
"\n",
" var tooltip_span = $('');\n",
" tooltip_span.addClass('ui-button-text');\n",
" tooltip_span.html(tooltip);\n",
"\n",
" button.append(icon_img);\n",
" button.append(tooltip_span);\n",
"\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" var fmt_picker_span = $('');\n",
"\n",
" var fmt_picker = $('');\n",
" fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
" fmt_picker_span.append(fmt_picker);\n",
" nav_element.append(fmt_picker_span);\n",
" this.format_dropdown = fmt_picker[0];\n",
"\n",
" for (var ind in mpl.extensions) {\n",
" var fmt = mpl.extensions[ind];\n",
" var option = $(\n",
" '', {selected: fmt === mpl.default_extension}).html(fmt);\n",
" fmt_picker.append(option)\n",
" }\n",
"\n",
" // Add hover states to the ui-buttons\n",
" $( \".ui-button\" ).hover(\n",
" function() { $(this).addClass(\"ui-state-hover\");},\n",
" function() { $(this).removeClass(\"ui-state-hover\");}\n",
" );\n",
"\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"}\n",
"\n",
"mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
" // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
" // which will in turn request a refresh of the image.\n",
" this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
"}\n",
"\n",
"mpl.figure.prototype.send_message = function(type, properties) {\n",
" properties['type'] = type;\n",
" properties['figure_id'] = this.id;\n",
" this.ws.send(JSON.stringify(properties));\n",
"}\n",
"\n",
"mpl.figure.prototype.send_draw_message = function() {\n",
" if (!this.waiting) {\n",
" this.waiting = true;\n",
" this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
" }\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" var format_dropdown = fig.format_dropdown;\n",
" var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
" fig.ondownload(fig, format);\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
" var size = msg['size'];\n",
" if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
" fig._resize_canvas(size[0], size[1]);\n",
" fig.send_message(\"refresh\", {});\n",
" };\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
" var x0 = msg['x0'] / mpl.ratio;\n",
" var y0 = (fig.canvas.height - msg['y0']) / mpl.ratio;\n",
" var x1 = msg['x1'] / mpl.ratio;\n",
" var y1 = (fig.canvas.height - msg['y1']) / mpl.ratio;\n",
" x0 = Math.floor(x0) + 0.5;\n",
" y0 = Math.floor(y0) + 0.5;\n",
" x1 = Math.floor(x1) + 0.5;\n",
" y1 = Math.floor(y1) + 0.5;\n",
" var min_x = Math.min(x0, x1);\n",
" var min_y = Math.min(y0, y1);\n",
" var width = Math.abs(x1 - x0);\n",
" var height = Math.abs(y1 - y0);\n",
"\n",
" fig.rubberband_context.clearRect(\n",
" 0, 0, fig.canvas.width, fig.canvas.height);\n",
"\n",
" fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
" // Updates the figure title.\n",
" fig.header.textContent = msg['label'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
" var cursor = msg['cursor'];\n",
" switch(cursor)\n",
" {\n",
" case 0:\n",
" cursor = 'pointer';\n",
" break;\n",
" case 1:\n",
" cursor = 'default';\n",
" break;\n",
" case 2:\n",
" cursor = 'crosshair';\n",
" break;\n",
" case 3:\n",
" cursor = 'move';\n",
" break;\n",
" }\n",
" fig.rubberband_canvas.style.cursor = cursor;\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_message = function(fig, msg) {\n",
" fig.message.textContent = msg['message'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
" // Request the server to send over a new figure.\n",
" fig.send_draw_message();\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
" fig.image_mode = msg['mode'];\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Called whenever the canvas gets updated.\n",
" this.send_message(\"ack\", {});\n",
"}\n",
"\n",
"// A function to construct a web socket function for onmessage handling.\n",
"// Called in the figure constructor.\n",
"mpl.figure.prototype._make_on_message_function = function(fig) {\n",
" return function socket_on_message(evt) {\n",
" if (evt.data instanceof Blob) {\n",
" /* FIXME: We get \"Resource interpreted as Image but\n",
" * transferred with MIME type text/plain:\" errors on\n",
" * Chrome. But how to set the MIME type? It doesn't seem\n",
" * to be part of the websocket stream */\n",
" evt.data.type = \"image/png\";\n",
"\n",
" /* Free the memory for the previous frames */\n",
" if (fig.imageObj.src) {\n",
" (window.URL || window.webkitURL).revokeObjectURL(\n",
" fig.imageObj.src);\n",
" }\n",
"\n",
" fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
" evt.data);\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
" else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
" fig.imageObj.src = evt.data;\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
"\n",
" var msg = JSON.parse(evt.data);\n",
" var msg_type = msg['type'];\n",
"\n",
" // Call the \"handle_{type}\" callback, which takes\n",
" // the figure and JSON message as its only arguments.\n",
" try {\n",
" var callback = fig[\"handle_\" + msg_type];\n",
" } catch (e) {\n",
" console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
" return;\n",
" }\n",
"\n",
" if (callback) {\n",
" try {\n",
" // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
" callback(fig, msg);\n",
" } catch (e) {\n",
" console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
" }\n",
" }\n",
" };\n",
"}\n",
"\n",
"// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
"mpl.findpos = function(e) {\n",
" //this section is from http://www.quirksmode.org/js/events_properties.html\n",
" var targ;\n",
" if (!e)\n",
" e = window.event;\n",
" if (e.target)\n",
" targ = e.target;\n",
" else if (e.srcElement)\n",
" targ = e.srcElement;\n",
" if (targ.nodeType == 3) // defeat Safari bug\n",
" targ = targ.parentNode;\n",
"\n",
" // jQuery normalizes the pageX and pageY\n",
" // pageX,Y are the mouse positions relative to the document\n",
" // offset() returns the position of the element relative to the document\n",
" var x = e.pageX - $(targ).offset().left;\n",
" var y = e.pageY - $(targ).offset().top;\n",
"\n",
" return {\"x\": x, \"y\": y};\n",
"};\n",
"\n",
"/*\n",
" * return a copy of an object with only non-object keys\n",
" * we need this to avoid circular references\n",
" * http://stackoverflow.com/a/24161582/3208463\n",
" */\n",
"function simpleKeys (original) {\n",
" return Object.keys(original).reduce(function (obj, key) {\n",
" if (typeof original[key] !== 'object')\n",
" obj[key] = original[key]\n",
" return obj;\n",
" }, {});\n",
"}\n",
"\n",
"mpl.figure.prototype.mouse_event = function(event, name) {\n",
" var canvas_pos = mpl.findpos(event)\n",
"\n",
" if (name === 'button_press')\n",
" {\n",
" this.canvas.focus();\n",
" this.canvas_div.focus();\n",
" }\n",
"\n",
" var x = canvas_pos.x * mpl.ratio;\n",
" var y = canvas_pos.y * mpl.ratio;\n",
"\n",
" this.send_message(name, {x: x, y: y, button: event.button,\n",
" step: event.step,\n",
" guiEvent: simpleKeys(event)});\n",
"\n",
" /* This prevents the web browser from automatically changing to\n",
" * the text insertion cursor when the button is pressed. We want\n",
" * to control all of the cursor setting manually through the\n",
" * 'cursor' event from matplotlib */\n",
" event.preventDefault();\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" // Handle any extra behaviour associated with a key event\n",
"}\n",
"\n",
"mpl.figure.prototype.key_event = function(event, name) {\n",
"\n",
" // Prevent repeat events\n",
" if (name == 'key_press')\n",
" {\n",
" if (event.which === this._key)\n",
" return;\n",
" else\n",
" this._key = event.which;\n",
" }\n",
" if (name == 'key_release')\n",
" this._key = null;\n",
"\n",
" var value = '';\n",
" if (event.ctrlKey && event.which != 17)\n",
" value += \"ctrl+\";\n",
" if (event.altKey && event.which != 18)\n",
" value += \"alt+\";\n",
" if (event.shiftKey && event.which != 16)\n",
" value += \"shift+\";\n",
"\n",
" value += 'k';\n",
" value += event.which.toString();\n",
"\n",
" this._key_event_extra(event, name);\n",
"\n",
" this.send_message(name, {key: value,\n",
" guiEvent: simpleKeys(event)});\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
" if (name == 'download') {\n",
" this.handle_save(this, null);\n",
" } else {\n",
" this.send_message(\"toolbar_button\", {name: name});\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
" this.message.textContent = tooltip;\n",
"};\n",
"mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
"\n",
"mpl.extensions = [\"eps\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\"];\n",
"\n",
"mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
" // Create a \"websocket\"-like object which calls the given IPython comm\n",
" // object with the appropriate methods. Currently this is a non binary\n",
" // socket, so there is still some room for performance tuning.\n",
" var ws = {};\n",
"\n",
" ws.close = function() {\n",
" comm.close()\n",
" };\n",
" ws.send = function(m) {\n",
" //console.log('sending', m);\n",
" comm.send(m);\n",
" };\n",
" // Register the callback with on_msg.\n",
" comm.on_msg(function(msg) {\n",
" //console.log('receiving', msg['content']['data'], msg);\n",
" // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
" ws.onmessage(msg['content']['data'])\n",
" });\n",
" return ws;\n",
"}\n",
"\n",
"mpl.mpl_figure_comm = function(comm, msg) {\n",
" // This is the function which gets called when the mpl process\n",
" // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
"\n",
" var id = msg.content.data.id;\n",
" // Get hold of the div created by the display call when the Comm\n",
" // socket was opened in Python.\n",
" var element = $(\"#\" + id);\n",
" var ws_proxy = comm_websocket_adapter(comm)\n",
"\n",
" function ondownload(figure, format) {\n",
" window.open(figure.imageObj.src);\n",
" }\n",
"\n",
" var fig = new mpl.figure(id, ws_proxy,\n",
" ondownload,\n",
" element.get(0));\n",
"\n",
" // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
" // web socket which is closed, not our websocket->open comm proxy.\n",
" ws_proxy.onopen();\n",
"\n",
" fig.parent_element = element.get(0);\n",
" fig.cell_info = mpl.find_output_cell(\"\");\n",
" if (!fig.cell_info) {\n",
" console.error(\"Failed to find cell for figure\", id, fig);\n",
" return;\n",
" }\n",
"\n",
" var output_index = fig.cell_info[2]\n",
" var cell = fig.cell_info[0];\n",
"\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_close = function(fig, msg) {\n",
" var width = fig.canvas.width/mpl.ratio\n",
" fig.root.unbind('remove')\n",
"\n",
" // Update the output cell to use the data from the current canvas.\n",
" fig.push_to_output();\n",
" var dataURL = fig.canvas.toDataURL();\n",
" // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
" // the notebook keyboard shortcuts fail.\n",
" IPython.keyboard_manager.enable()\n",
" $(fig.parent_element).html('');\n",
" fig.close_ws(fig, msg);\n",
"}\n",
"\n",
"mpl.figure.prototype.close_ws = function(fig, msg){\n",
" fig.send_message('closing', msg);\n",
" // fig.ws.close()\n",
"}\n",
"\n",
"mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
" // Turn the data on the canvas into data in the output cell.\n",
" var width = this.canvas.width/mpl.ratio\n",
" var dataURL = this.canvas.toDataURL();\n",
" this.cell_info[1]['text/html'] = '';\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Tell IPython that the notebook contents must change.\n",
" IPython.notebook.set_dirty(true);\n",
" this.send_message(\"ack\", {});\n",
" var fig = this;\n",
" // Wait a second, then push the new image to the DOM so\n",
" // that it is saved nicely (might be nice to debounce this).\n",
" setTimeout(function () { fig.push_to_output() }, 1000);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items){\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) { continue; };\n",
"\n",
" var button = $('');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" // Add the status bar.\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"\n",
" // Add the close button to the window.\n",
" var buttongrp = $('');\n",
" var button = $('');\n",
" button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
" button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
" buttongrp.append(button);\n",
" var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
" titlebar.prepend(buttongrp);\n",
"}\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(el){\n",
" var fig = this\n",
" el.on(\"remove\", function(){\n",
"\tfig.close_ws(fig, {});\n",
" });\n",
"}\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(el){\n",
" // this is important to make the div 'focusable\n",
" el.attr('tabindex', 0)\n",
" // reach out to IPython and tell the keyboard manager to turn it's self\n",
" // off when our div gets focus\n",
"\n",
" // location in version 3\n",
" if (IPython.notebook.keyboard_manager) {\n",
" IPython.notebook.keyboard_manager.register_events(el);\n",
" }\n",
" else {\n",
" // location in version 2\n",
" IPython.keyboard_manager.register_events(el);\n",
" }\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" var manager = IPython.notebook.keyboard_manager;\n",
" if (!manager)\n",
" manager = IPython.keyboard_manager;\n",
"\n",
" // Check for shift+enter\n",
" if (event.shiftKey && event.which == 13) {\n",
" this.canvas_div.blur();\n",
" event.shiftKey = false;\n",
" // Send a \"J\" for go to next cell\n",
" event.which = 74;\n",
" event.keyCode = 74;\n",
" manager.command_mode();\n",
" manager.handle_keydown(event);\n",
" }\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" fig.ondownload(fig, null);\n",
"}\n",
"\n",
"\n",
"mpl.find_output_cell = function(html_output) {\n",
" // Return the cell and output element which can be found *uniquely* in the notebook.\n",
" // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
" // IPython event is triggered only after the cells have been serialised, which for\n",
" // our purposes (turning an active figure into a static one), is too late.\n",
" var cells = IPython.notebook.get_cells();\n",
" var ncells = cells.length;\n",
" for (var i=0; i= 3 moved mimebundle to data attribute of output\n",
" data = data.data;\n",
" }\n",
" if (data['text/html'] == html_output) {\n",
" return [cell, data, j];\n",
" }\n",
" }\n",
" }\n",
" }\n",
"}\n",
"\n",
"// Register the function which deals with the matplotlib target/channel.\n",
"// The kernel may be null if the page has been refreshed.\n",
"if (IPython.notebook.kernel != null) {\n",
" IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
"}\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
""
]
},
"execution_count": 162,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%matplotlib nbagg\n",
"import matplotlib.pyplot as plt\n",
"f,ax = plt.subplots()\n",
"pred = pd.Series(predictions, index=pd.date_range(start=sup_dX_train.index[-1], periods=len(predictions)), name='Prediction')\n",
"X = df.set_index('time')['close'].sort_index()\n",
"X.plot(label='Real', ax=ax)\n",
"pred.plot(label='Predicted', ax=ax)\n",
"ax.legend()"
]
},
{
"cell_type": "code",
"execution_count": 163,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:19:40.373609Z",
"start_time": "2018-04-23T19:19:40.368365Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/plain": [
"32.28381575116524"
]
},
"execution_count": 163,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# use mse to work out if you're totally fucked\n",
"from sklearn.metrics import mean_absolute_error\n",
"mean_absolute_error(X[pred.index].values, pred.values)"
]
},
{
"cell_type": "code",
"execution_count": 164,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:19:51.495745Z",
"start_time": "2018-04-23T19:19:51.490605Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"text/plain": [
"1706.048181115777"
]
},
"execution_count": 164,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from sklearn.metrics import mean_squared_error\n",
"validation = X[pred.index].values,pred.values\n",
"mean_squared_error(*validation)"
]
},
{
"cell_type": "code",
"execution_count": 115,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:23:12.651030Z",
"start_time": "2018-04-23T17:23:12.647936Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [],
"source": [
"# create a new dataframe with the validation values to see how wrong you are\n",
" "
]
},
{
"cell_type": "code",
"execution_count": 165,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:20:01.297765Z",
"start_time": "2018-04-23T19:20:01.232026Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"application/javascript": [
"/* Put everything inside the global mpl namespace */\n",
"window.mpl = {};\n",
"\n",
"\n",
"mpl.get_websocket_type = function() {\n",
" if (typeof(WebSocket) !== 'undefined') {\n",
" return WebSocket;\n",
" } else if (typeof(MozWebSocket) !== 'undefined') {\n",
" return MozWebSocket;\n",
" } else {\n",
" alert('Your browser does not have WebSocket support.' +\n",
" 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
" 'Firefox 4 and 5 are also supported but you ' +\n",
" 'have to enable WebSockets in about:config.');\n",
" };\n",
"}\n",
"\n",
"mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
" this.id = figure_id;\n",
"\n",
" this.ws = websocket;\n",
"\n",
" this.supports_binary = (this.ws.binaryType != undefined);\n",
"\n",
" if (!this.supports_binary) {\n",
" var warnings = document.getElementById(\"mpl-warnings\");\n",
" if (warnings) {\n",
" warnings.style.display = 'block';\n",
" warnings.textContent = (\n",
" \"This browser does not support binary websocket messages. \" +\n",
" \"Performance may be slow.\");\n",
" }\n",
" }\n",
"\n",
" this.imageObj = new Image();\n",
"\n",
" this.context = undefined;\n",
" this.message = undefined;\n",
" this.canvas = undefined;\n",
" this.rubberband_canvas = undefined;\n",
" this.rubberband_context = undefined;\n",
" this.format_dropdown = undefined;\n",
"\n",
" this.image_mode = 'full';\n",
"\n",
" this.root = $('');\n",
" this._root_extra_style(this.root)\n",
" this.root.attr('style', 'display: inline-block');\n",
"\n",
" $(parent_element).append(this.root);\n",
"\n",
" this._init_header(this);\n",
" this._init_canvas(this);\n",
" this._init_toolbar(this);\n",
"\n",
" var fig = this;\n",
"\n",
" this.waiting = false;\n",
"\n",
" this.ws.onopen = function () {\n",
" fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
" fig.send_message(\"send_image_mode\", {});\n",
" if (mpl.ratio != 1) {\n",
" fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n",
" }\n",
" fig.send_message(\"refresh\", {});\n",
" }\n",
"\n",
" this.imageObj.onload = function() {\n",
" if (fig.image_mode == 'full') {\n",
" // Full images could contain transparency (where diff images\n",
" // almost always do), so we need to clear the canvas so that\n",
" // there is no ghosting.\n",
" fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
" }\n",
" fig.context.drawImage(fig.imageObj, 0, 0);\n",
" };\n",
"\n",
" this.imageObj.onunload = function() {\n",
" fig.ws.close();\n",
" }\n",
"\n",
" this.ws.onmessage = this._make_on_message_function(this);\n",
"\n",
" this.ondownload = ondownload;\n",
"}\n",
"\n",
"mpl.figure.prototype._init_header = function() {\n",
" var titlebar = $(\n",
" '');\n",
" var titletext = $(\n",
" '');\n",
" titlebar.append(titletext)\n",
" this.root.append(titlebar);\n",
" this.header = titletext[0];\n",
"}\n",
"\n",
"\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._init_canvas = function() {\n",
" var fig = this;\n",
"\n",
" var canvas_div = $('');\n",
"\n",
" canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
"\n",
" function canvas_keyboard_event(event) {\n",
" return fig.key_event(event, event['data']);\n",
" }\n",
"\n",
" canvas_div.keydown('key_press', canvas_keyboard_event);\n",
" canvas_div.keyup('key_release', canvas_keyboard_event);\n",
" this.canvas_div = canvas_div\n",
" this._canvas_extra_style(canvas_div)\n",
" this.root.append(canvas_div);\n",
"\n",
" var canvas = $('');\n",
" canvas.addClass('mpl-canvas');\n",
" canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
"\n",
" this.canvas = canvas[0];\n",
" this.context = canvas[0].getContext(\"2d\");\n",
"\n",
" var backingStore = this.context.backingStorePixelRatio ||\n",
"\tthis.context.webkitBackingStorePixelRatio ||\n",
"\tthis.context.mozBackingStorePixelRatio ||\n",
"\tthis.context.msBackingStorePixelRatio ||\n",
"\tthis.context.oBackingStorePixelRatio ||\n",
"\tthis.context.backingStorePixelRatio || 1;\n",
"\n",
" mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
"\n",
" var rubberband = $('');\n",
" rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
"\n",
" var pass_mouse_events = true;\n",
"\n",
" canvas_div.resizable({\n",
" start: function(event, ui) {\n",
" pass_mouse_events = false;\n",
" },\n",
" resize: function(event, ui) {\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" stop: function(event, ui) {\n",
" pass_mouse_events = true;\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" });\n",
"\n",
" function mouse_event_fn(event) {\n",
" if (pass_mouse_events)\n",
" return fig.mouse_event(event, event['data']);\n",
" }\n",
"\n",
" rubberband.mousedown('button_press', mouse_event_fn);\n",
" rubberband.mouseup('button_release', mouse_event_fn);\n",
" // Throttle sequential mouse events to 1 every 20ms.\n",
" rubberband.mousemove('motion_notify', mouse_event_fn);\n",
"\n",
" rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
" rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
"\n",
" canvas_div.on(\"wheel\", function (event) {\n",
" event = event.originalEvent;\n",
" event['data'] = 'scroll'\n",
" if (event.deltaY < 0) {\n",
" event.step = 1;\n",
" } else {\n",
" event.step = -1;\n",
" }\n",
" mouse_event_fn(event);\n",
" });\n",
"\n",
" canvas_div.append(canvas);\n",
" canvas_div.append(rubberband);\n",
"\n",
" this.rubberband = rubberband;\n",
" this.rubberband_canvas = rubberband[0];\n",
" this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
" this.rubberband_context.strokeStyle = \"#000000\";\n",
"\n",
" this._resize_canvas = function(width, height) {\n",
" // Keep the size of the canvas, canvas container, and rubber band\n",
" // canvas in synch.\n",
" canvas_div.css('width', width)\n",
" canvas_div.css('height', height)\n",
"\n",
" canvas.attr('width', width * mpl.ratio);\n",
" canvas.attr('height', height * mpl.ratio);\n",
" canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n",
"\n",
" rubberband.attr('width', width);\n",
" rubberband.attr('height', height);\n",
" }\n",
"\n",
" // Set the figure to an initial 600x600px, this will subsequently be updated\n",
" // upon first draw.\n",
" this._resize_canvas(600, 600);\n",
"\n",
" // Disable right mouse context menu.\n",
" $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
" return false;\n",
" });\n",
"\n",
" function set_focus () {\n",
" canvas.focus();\n",
" canvas_div.focus();\n",
" }\n",
"\n",
" window.setTimeout(set_focus, 100);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" // put a spacer in here.\n",
" continue;\n",
" }\n",
" var button = $('');\n",
" button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
" 'ui-button-icon-only');\n",
" button.attr('role', 'button');\n",
" button.attr('aria-disabled', 'false');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
"\n",
" var icon_img = $('');\n",
" icon_img.addClass('ui-button-icon-primary ui-icon');\n",
" icon_img.addClass(image);\n",
" icon_img.addClass('ui-corner-all');\n",
"\n",
" var tooltip_span = $('');\n",
" tooltip_span.addClass('ui-button-text');\n",
" tooltip_span.html(tooltip);\n",
"\n",
" button.append(icon_img);\n",
" button.append(tooltip_span);\n",
"\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" var fmt_picker_span = $('');\n",
"\n",
" var fmt_picker = $('');\n",
" fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
" fmt_picker_span.append(fmt_picker);\n",
" nav_element.append(fmt_picker_span);\n",
" this.format_dropdown = fmt_picker[0];\n",
"\n",
" for (var ind in mpl.extensions) {\n",
" var fmt = mpl.extensions[ind];\n",
" var option = $(\n",
" '', {selected: fmt === mpl.default_extension}).html(fmt);\n",
" fmt_picker.append(option)\n",
" }\n",
"\n",
" // Add hover states to the ui-buttons\n",
" $( \".ui-button\" ).hover(\n",
" function() { $(this).addClass(\"ui-state-hover\");},\n",
" function() { $(this).removeClass(\"ui-state-hover\");}\n",
" );\n",
"\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"}\n",
"\n",
"mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
" // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
" // which will in turn request a refresh of the image.\n",
" this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
"}\n",
"\n",
"mpl.figure.prototype.send_message = function(type, properties) {\n",
" properties['type'] = type;\n",
" properties['figure_id'] = this.id;\n",
" this.ws.send(JSON.stringify(properties));\n",
"}\n",
"\n",
"mpl.figure.prototype.send_draw_message = function() {\n",
" if (!this.waiting) {\n",
" this.waiting = true;\n",
" this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
" }\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" var format_dropdown = fig.format_dropdown;\n",
" var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
" fig.ondownload(fig, format);\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
" var size = msg['size'];\n",
" if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
" fig._resize_canvas(size[0], size[1]);\n",
" fig.send_message(\"refresh\", {});\n",
" };\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
" var x0 = msg['x0'] / mpl.ratio;\n",
" var y0 = (fig.canvas.height - msg['y0']) / mpl.ratio;\n",
" var x1 = msg['x1'] / mpl.ratio;\n",
" var y1 = (fig.canvas.height - msg['y1']) / mpl.ratio;\n",
" x0 = Math.floor(x0) + 0.5;\n",
" y0 = Math.floor(y0) + 0.5;\n",
" x1 = Math.floor(x1) + 0.5;\n",
" y1 = Math.floor(y1) + 0.5;\n",
" var min_x = Math.min(x0, x1);\n",
" var min_y = Math.min(y0, y1);\n",
" var width = Math.abs(x1 - x0);\n",
" var height = Math.abs(y1 - y0);\n",
"\n",
" fig.rubberband_context.clearRect(\n",
" 0, 0, fig.canvas.width, fig.canvas.height);\n",
"\n",
" fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
" // Updates the figure title.\n",
" fig.header.textContent = msg['label'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
" var cursor = msg['cursor'];\n",
" switch(cursor)\n",
" {\n",
" case 0:\n",
" cursor = 'pointer';\n",
" break;\n",
" case 1:\n",
" cursor = 'default';\n",
" break;\n",
" case 2:\n",
" cursor = 'crosshair';\n",
" break;\n",
" case 3:\n",
" cursor = 'move';\n",
" break;\n",
" }\n",
" fig.rubberband_canvas.style.cursor = cursor;\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_message = function(fig, msg) {\n",
" fig.message.textContent = msg['message'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
" // Request the server to send over a new figure.\n",
" fig.send_draw_message();\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
" fig.image_mode = msg['mode'];\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Called whenever the canvas gets updated.\n",
" this.send_message(\"ack\", {});\n",
"}\n",
"\n",
"// A function to construct a web socket function for onmessage handling.\n",
"// Called in the figure constructor.\n",
"mpl.figure.prototype._make_on_message_function = function(fig) {\n",
" return function socket_on_message(evt) {\n",
" if (evt.data instanceof Blob) {\n",
" /* FIXME: We get \"Resource interpreted as Image but\n",
" * transferred with MIME type text/plain:\" errors on\n",
" * Chrome. But how to set the MIME type? It doesn't seem\n",
" * to be part of the websocket stream */\n",
" evt.data.type = \"image/png\";\n",
"\n",
" /* Free the memory for the previous frames */\n",
" if (fig.imageObj.src) {\n",
" (window.URL || window.webkitURL).revokeObjectURL(\n",
" fig.imageObj.src);\n",
" }\n",
"\n",
" fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
" evt.data);\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
" else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
" fig.imageObj.src = evt.data;\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
"\n",
" var msg = JSON.parse(evt.data);\n",
" var msg_type = msg['type'];\n",
"\n",
" // Call the \"handle_{type}\" callback, which takes\n",
" // the figure and JSON message as its only arguments.\n",
" try {\n",
" var callback = fig[\"handle_\" + msg_type];\n",
" } catch (e) {\n",
" console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
" return;\n",
" }\n",
"\n",
" if (callback) {\n",
" try {\n",
" // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
" callback(fig, msg);\n",
" } catch (e) {\n",
" console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
" }\n",
" }\n",
" };\n",
"}\n",
"\n",
"// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
"mpl.findpos = function(e) {\n",
" //this section is from http://www.quirksmode.org/js/events_properties.html\n",
" var targ;\n",
" if (!e)\n",
" e = window.event;\n",
" if (e.target)\n",
" targ = e.target;\n",
" else if (e.srcElement)\n",
" targ = e.srcElement;\n",
" if (targ.nodeType == 3) // defeat Safari bug\n",
" targ = targ.parentNode;\n",
"\n",
" // jQuery normalizes the pageX and pageY\n",
" // pageX,Y are the mouse positions relative to the document\n",
" // offset() returns the position of the element relative to the document\n",
" var x = e.pageX - $(targ).offset().left;\n",
" var y = e.pageY - $(targ).offset().top;\n",
"\n",
" return {\"x\": x, \"y\": y};\n",
"};\n",
"\n",
"/*\n",
" * return a copy of an object with only non-object keys\n",
" * we need this to avoid circular references\n",
" * http://stackoverflow.com/a/24161582/3208463\n",
" */\n",
"function simpleKeys (original) {\n",
" return Object.keys(original).reduce(function (obj, key) {\n",
" if (typeof original[key] !== 'object')\n",
" obj[key] = original[key]\n",
" return obj;\n",
" }, {});\n",
"}\n",
"\n",
"mpl.figure.prototype.mouse_event = function(event, name) {\n",
" var canvas_pos = mpl.findpos(event)\n",
"\n",
" if (name === 'button_press')\n",
" {\n",
" this.canvas.focus();\n",
" this.canvas_div.focus();\n",
" }\n",
"\n",
" var x = canvas_pos.x * mpl.ratio;\n",
" var y = canvas_pos.y * mpl.ratio;\n",
"\n",
" this.send_message(name, {x: x, y: y, button: event.button,\n",
" step: event.step,\n",
" guiEvent: simpleKeys(event)});\n",
"\n",
" /* This prevents the web browser from automatically changing to\n",
" * the text insertion cursor when the button is pressed. We want\n",
" * to control all of the cursor setting manually through the\n",
" * 'cursor' event from matplotlib */\n",
" event.preventDefault();\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" // Handle any extra behaviour associated with a key event\n",
"}\n",
"\n",
"mpl.figure.prototype.key_event = function(event, name) {\n",
"\n",
" // Prevent repeat events\n",
" if (name == 'key_press')\n",
" {\n",
" if (event.which === this._key)\n",
" return;\n",
" else\n",
" this._key = event.which;\n",
" }\n",
" if (name == 'key_release')\n",
" this._key = null;\n",
"\n",
" var value = '';\n",
" if (event.ctrlKey && event.which != 17)\n",
" value += \"ctrl+\";\n",
" if (event.altKey && event.which != 18)\n",
" value += \"alt+\";\n",
" if (event.shiftKey && event.which != 16)\n",
" value += \"shift+\";\n",
"\n",
" value += 'k';\n",
" value += event.which.toString();\n",
"\n",
" this._key_event_extra(event, name);\n",
"\n",
" this.send_message(name, {key: value,\n",
" guiEvent: simpleKeys(event)});\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
" if (name == 'download') {\n",
" this.handle_save(this, null);\n",
" } else {\n",
" this.send_message(\"toolbar_button\", {name: name});\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
" this.message.textContent = tooltip;\n",
"};\n",
"mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
"\n",
"mpl.extensions = [\"eps\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\"];\n",
"\n",
"mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
" // Create a \"websocket\"-like object which calls the given IPython comm\n",
" // object with the appropriate methods. Currently this is a non binary\n",
" // socket, so there is still some room for performance tuning.\n",
" var ws = {};\n",
"\n",
" ws.close = function() {\n",
" comm.close()\n",
" };\n",
" ws.send = function(m) {\n",
" //console.log('sending', m);\n",
" comm.send(m);\n",
" };\n",
" // Register the callback with on_msg.\n",
" comm.on_msg(function(msg) {\n",
" //console.log('receiving', msg['content']['data'], msg);\n",
" // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
" ws.onmessage(msg['content']['data'])\n",
" });\n",
" return ws;\n",
"}\n",
"\n",
"mpl.mpl_figure_comm = function(comm, msg) {\n",
" // This is the function which gets called when the mpl process\n",
" // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
"\n",
" var id = msg.content.data.id;\n",
" // Get hold of the div created by the display call when the Comm\n",
" // socket was opened in Python.\n",
" var element = $(\"#\" + id);\n",
" var ws_proxy = comm_websocket_adapter(comm)\n",
"\n",
" function ondownload(figure, format) {\n",
" window.open(figure.imageObj.src);\n",
" }\n",
"\n",
" var fig = new mpl.figure(id, ws_proxy,\n",
" ondownload,\n",
" element.get(0));\n",
"\n",
" // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
" // web socket which is closed, not our websocket->open comm proxy.\n",
" ws_proxy.onopen();\n",
"\n",
" fig.parent_element = element.get(0);\n",
" fig.cell_info = mpl.find_output_cell(\"\");\n",
" if (!fig.cell_info) {\n",
" console.error(\"Failed to find cell for figure\", id, fig);\n",
" return;\n",
" }\n",
"\n",
" var output_index = fig.cell_info[2]\n",
" var cell = fig.cell_info[0];\n",
"\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_close = function(fig, msg) {\n",
" var width = fig.canvas.width/mpl.ratio\n",
" fig.root.unbind('remove')\n",
"\n",
" // Update the output cell to use the data from the current canvas.\n",
" fig.push_to_output();\n",
" var dataURL = fig.canvas.toDataURL();\n",
" // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
" // the notebook keyboard shortcuts fail.\n",
" IPython.keyboard_manager.enable()\n",
" $(fig.parent_element).html('');\n",
" fig.close_ws(fig, msg);\n",
"}\n",
"\n",
"mpl.figure.prototype.close_ws = function(fig, msg){\n",
" fig.send_message('closing', msg);\n",
" // fig.ws.close()\n",
"}\n",
"\n",
"mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
" // Turn the data on the canvas into data in the output cell.\n",
" var width = this.canvas.width/mpl.ratio\n",
" var dataURL = this.canvas.toDataURL();\n",
" this.cell_info[1]['text/html'] = '';\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Tell IPython that the notebook contents must change.\n",
" IPython.notebook.set_dirty(true);\n",
" this.send_message(\"ack\", {});\n",
" var fig = this;\n",
" // Wait a second, then push the new image to the DOM so\n",
" // that it is saved nicely (might be nice to debounce this).\n",
" setTimeout(function () { fig.push_to_output() }, 1000);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items){\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) { continue; };\n",
"\n",
" var button = $('');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" // Add the status bar.\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"\n",
" // Add the close button to the window.\n",
" var buttongrp = $('');\n",
" var button = $('');\n",
" button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
" button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
" buttongrp.append(button);\n",
" var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
" titlebar.prepend(buttongrp);\n",
"}\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(el){\n",
" var fig = this\n",
" el.on(\"remove\", function(){\n",
"\tfig.close_ws(fig, {});\n",
" });\n",
"}\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(el){\n",
" // this is important to make the div 'focusable\n",
" el.attr('tabindex', 0)\n",
" // reach out to IPython and tell the keyboard manager to turn it's self\n",
" // off when our div gets focus\n",
"\n",
" // location in version 3\n",
" if (IPython.notebook.keyboard_manager) {\n",
" IPython.notebook.keyboard_manager.register_events(el);\n",
" }\n",
" else {\n",
" // location in version 2\n",
" IPython.keyboard_manager.register_events(el);\n",
" }\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" var manager = IPython.notebook.keyboard_manager;\n",
" if (!manager)\n",
" manager = IPython.keyboard_manager;\n",
"\n",
" // Check for shift+enter\n",
" if (event.shiftKey && event.which == 13) {\n",
" this.canvas_div.blur();\n",
" event.shiftKey = false;\n",
" // Send a \"J\" for go to next cell\n",
" event.which = 74;\n",
" event.keyCode = 74;\n",
" manager.command_mode();\n",
" manager.handle_keydown(event);\n",
" }\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" fig.ondownload(fig, null);\n",
"}\n",
"\n",
"\n",
"mpl.find_output_cell = function(html_output) {\n",
" // Return the cell and output element which can be found *uniquely* in the notebook.\n",
" // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
" // IPython event is triggered only after the cells have been serialised, which for\n",
" // our purposes (turning an active figure into a static one), is too late.\n",
" var cells = IPython.notebook.get_cells();\n",
" var ncells = cells.length;\n",
" for (var i=0; i= 3 moved mimebundle to data attribute of output\n",
" data = data.data;\n",
" }\n",
" if (data['text/html'] == html_output) {\n",
" return [cell, data, j];\n",
" }\n",
" }\n",
" }\n",
" }\n",
"}\n",
"\n",
"// Register the function which deals with the matplotlib target/channel.\n",
"// The kernel may be null if the page has been refreshed.\n",
"if (IPython.notebook.kernel != null) {\n",
" IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
"}\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
""
]
},
"execution_count": 165,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%matplotlib nbagg\n",
"_validation = X[pred.index].copy().to_frame('Observed')\n",
"_validation['Predicted'] = pred\n",
"_validation.diff(axis=1).plot()"
]
},
{
"cell_type": "code",
"execution_count": 166,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:20:24.429026Z",
"start_time": "2018-04-23T19:20:24.362127Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "5b4e705ce57b4bc39d6f1ab6e497b35b",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"HBox(children=(IntProgress(value=0, max=30), HTML(value='')))"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Future predictions are fucked anyway so you're on your own.\n",
"X, y = test_scaled[-1, 0:-1], test_scaled[-1, -1]\n",
"yhats = []\n",
"new_history = raw_X.copy()\n",
"for day in tqdm.tqdm_notebook(range(30)):\n",
" yhat = forecast(lstm, 1, X)\n",
" # invert scaling\n",
" yhat = invert_scale(scaler, X, yhat)\n",
" # invert differencing\n",
" yhat = new_history[-1]+yhat\n",
" X=np.asarray([yhat])\n",
" yhats.append(yhat)\n",
" new_history = np.append(new_history,X)"
]
},
{
"cell_type": "code",
"execution_count": 167,
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T19:21:06.645504Z",
"start_time": "2018-04-23T19:21:06.578913Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": [
{
"data": {
"application/javascript": [
"/* Put everything inside the global mpl namespace */\n",
"window.mpl = {};\n",
"\n",
"\n",
"mpl.get_websocket_type = function() {\n",
" if (typeof(WebSocket) !== 'undefined') {\n",
" return WebSocket;\n",
" } else if (typeof(MozWebSocket) !== 'undefined') {\n",
" return MozWebSocket;\n",
" } else {\n",
" alert('Your browser does not have WebSocket support.' +\n",
" 'Please try Chrome, Safari or Firefox ≥ 6. ' +\n",
" 'Firefox 4 and 5 are also supported but you ' +\n",
" 'have to enable WebSockets in about:config.');\n",
" };\n",
"}\n",
"\n",
"mpl.figure = function(figure_id, websocket, ondownload, parent_element) {\n",
" this.id = figure_id;\n",
"\n",
" this.ws = websocket;\n",
"\n",
" this.supports_binary = (this.ws.binaryType != undefined);\n",
"\n",
" if (!this.supports_binary) {\n",
" var warnings = document.getElementById(\"mpl-warnings\");\n",
" if (warnings) {\n",
" warnings.style.display = 'block';\n",
" warnings.textContent = (\n",
" \"This browser does not support binary websocket messages. \" +\n",
" \"Performance may be slow.\");\n",
" }\n",
" }\n",
"\n",
" this.imageObj = new Image();\n",
"\n",
" this.context = undefined;\n",
" this.message = undefined;\n",
" this.canvas = undefined;\n",
" this.rubberband_canvas = undefined;\n",
" this.rubberband_context = undefined;\n",
" this.format_dropdown = undefined;\n",
"\n",
" this.image_mode = 'full';\n",
"\n",
" this.root = $('');\n",
" this._root_extra_style(this.root)\n",
" this.root.attr('style', 'display: inline-block');\n",
"\n",
" $(parent_element).append(this.root);\n",
"\n",
" this._init_header(this);\n",
" this._init_canvas(this);\n",
" this._init_toolbar(this);\n",
"\n",
" var fig = this;\n",
"\n",
" this.waiting = false;\n",
"\n",
" this.ws.onopen = function () {\n",
" fig.send_message(\"supports_binary\", {value: fig.supports_binary});\n",
" fig.send_message(\"send_image_mode\", {});\n",
" if (mpl.ratio != 1) {\n",
" fig.send_message(\"set_dpi_ratio\", {'dpi_ratio': mpl.ratio});\n",
" }\n",
" fig.send_message(\"refresh\", {});\n",
" }\n",
"\n",
" this.imageObj.onload = function() {\n",
" if (fig.image_mode == 'full') {\n",
" // Full images could contain transparency (where diff images\n",
" // almost always do), so we need to clear the canvas so that\n",
" // there is no ghosting.\n",
" fig.context.clearRect(0, 0, fig.canvas.width, fig.canvas.height);\n",
" }\n",
" fig.context.drawImage(fig.imageObj, 0, 0);\n",
" };\n",
"\n",
" this.imageObj.onunload = function() {\n",
" fig.ws.close();\n",
" }\n",
"\n",
" this.ws.onmessage = this._make_on_message_function(this);\n",
"\n",
" this.ondownload = ondownload;\n",
"}\n",
"\n",
"mpl.figure.prototype._init_header = function() {\n",
" var titlebar = $(\n",
" '');\n",
" var titletext = $(\n",
" '');\n",
" titlebar.append(titletext)\n",
" this.root.append(titlebar);\n",
" this.header = titletext[0];\n",
"}\n",
"\n",
"\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(canvas_div) {\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._init_canvas = function() {\n",
" var fig = this;\n",
"\n",
" var canvas_div = $('');\n",
"\n",
" canvas_div.attr('style', 'position: relative; clear: both; outline: 0');\n",
"\n",
" function canvas_keyboard_event(event) {\n",
" return fig.key_event(event, event['data']);\n",
" }\n",
"\n",
" canvas_div.keydown('key_press', canvas_keyboard_event);\n",
" canvas_div.keyup('key_release', canvas_keyboard_event);\n",
" this.canvas_div = canvas_div\n",
" this._canvas_extra_style(canvas_div)\n",
" this.root.append(canvas_div);\n",
"\n",
" var canvas = $('');\n",
" canvas.addClass('mpl-canvas');\n",
" canvas.attr('style', \"left: 0; top: 0; z-index: 0; outline: 0\")\n",
"\n",
" this.canvas = canvas[0];\n",
" this.context = canvas[0].getContext(\"2d\");\n",
"\n",
" var backingStore = this.context.backingStorePixelRatio ||\n",
"\tthis.context.webkitBackingStorePixelRatio ||\n",
"\tthis.context.mozBackingStorePixelRatio ||\n",
"\tthis.context.msBackingStorePixelRatio ||\n",
"\tthis.context.oBackingStorePixelRatio ||\n",
"\tthis.context.backingStorePixelRatio || 1;\n",
"\n",
" mpl.ratio = (window.devicePixelRatio || 1) / backingStore;\n",
"\n",
" var rubberband = $('');\n",
" rubberband.attr('style', \"position: absolute; left: 0; top: 0; z-index: 1;\")\n",
"\n",
" var pass_mouse_events = true;\n",
"\n",
" canvas_div.resizable({\n",
" start: function(event, ui) {\n",
" pass_mouse_events = false;\n",
" },\n",
" resize: function(event, ui) {\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" stop: function(event, ui) {\n",
" pass_mouse_events = true;\n",
" fig.request_resize(ui.size.width, ui.size.height);\n",
" },\n",
" });\n",
"\n",
" function mouse_event_fn(event) {\n",
" if (pass_mouse_events)\n",
" return fig.mouse_event(event, event['data']);\n",
" }\n",
"\n",
" rubberband.mousedown('button_press', mouse_event_fn);\n",
" rubberband.mouseup('button_release', mouse_event_fn);\n",
" // Throttle sequential mouse events to 1 every 20ms.\n",
" rubberband.mousemove('motion_notify', mouse_event_fn);\n",
"\n",
" rubberband.mouseenter('figure_enter', mouse_event_fn);\n",
" rubberband.mouseleave('figure_leave', mouse_event_fn);\n",
"\n",
" canvas_div.on(\"wheel\", function (event) {\n",
" event = event.originalEvent;\n",
" event['data'] = 'scroll'\n",
" if (event.deltaY < 0) {\n",
" event.step = 1;\n",
" } else {\n",
" event.step = -1;\n",
" }\n",
" mouse_event_fn(event);\n",
" });\n",
"\n",
" canvas_div.append(canvas);\n",
" canvas_div.append(rubberband);\n",
"\n",
" this.rubberband = rubberband;\n",
" this.rubberband_canvas = rubberband[0];\n",
" this.rubberband_context = rubberband[0].getContext(\"2d\");\n",
" this.rubberband_context.strokeStyle = \"#000000\";\n",
"\n",
" this._resize_canvas = function(width, height) {\n",
" // Keep the size of the canvas, canvas container, and rubber band\n",
" // canvas in synch.\n",
" canvas_div.css('width', width)\n",
" canvas_div.css('height', height)\n",
"\n",
" canvas.attr('width', width * mpl.ratio);\n",
" canvas.attr('height', height * mpl.ratio);\n",
" canvas.attr('style', 'width: ' + width + 'px; height: ' + height + 'px;');\n",
"\n",
" rubberband.attr('width', width);\n",
" rubberband.attr('height', height);\n",
" }\n",
"\n",
" // Set the figure to an initial 600x600px, this will subsequently be updated\n",
" // upon first draw.\n",
" this._resize_canvas(600, 600);\n",
"\n",
" // Disable right mouse context menu.\n",
" $(this.rubberband_canvas).bind(\"contextmenu\",function(e){\n",
" return false;\n",
" });\n",
"\n",
" function set_focus () {\n",
" canvas.focus();\n",
" canvas_div.focus();\n",
" }\n",
"\n",
" window.setTimeout(set_focus, 100);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items) {\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) {\n",
" // put a spacer in here.\n",
" continue;\n",
" }\n",
" var button = $('');\n",
" button.addClass('ui-button ui-widget ui-state-default ui-corner-all ' +\n",
" 'ui-button-icon-only');\n",
" button.attr('role', 'button');\n",
" button.attr('aria-disabled', 'false');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
"\n",
" var icon_img = $('');\n",
" icon_img.addClass('ui-button-icon-primary ui-icon');\n",
" icon_img.addClass(image);\n",
" icon_img.addClass('ui-corner-all');\n",
"\n",
" var tooltip_span = $('');\n",
" tooltip_span.addClass('ui-button-text');\n",
" tooltip_span.html(tooltip);\n",
"\n",
" button.append(icon_img);\n",
" button.append(tooltip_span);\n",
"\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" var fmt_picker_span = $('');\n",
"\n",
" var fmt_picker = $('');\n",
" fmt_picker.addClass('mpl-toolbar-option ui-widget ui-widget-content');\n",
" fmt_picker_span.append(fmt_picker);\n",
" nav_element.append(fmt_picker_span);\n",
" this.format_dropdown = fmt_picker[0];\n",
"\n",
" for (var ind in mpl.extensions) {\n",
" var fmt = mpl.extensions[ind];\n",
" var option = $(\n",
" '', {selected: fmt === mpl.default_extension}).html(fmt);\n",
" fmt_picker.append(option)\n",
" }\n",
"\n",
" // Add hover states to the ui-buttons\n",
" $( \".ui-button\" ).hover(\n",
" function() { $(this).addClass(\"ui-state-hover\");},\n",
" function() { $(this).removeClass(\"ui-state-hover\");}\n",
" );\n",
"\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"}\n",
"\n",
"mpl.figure.prototype.request_resize = function(x_pixels, y_pixels) {\n",
" // Request matplotlib to resize the figure. Matplotlib will then trigger a resize in the client,\n",
" // which will in turn request a refresh of the image.\n",
" this.send_message('resize', {'width': x_pixels, 'height': y_pixels});\n",
"}\n",
"\n",
"mpl.figure.prototype.send_message = function(type, properties) {\n",
" properties['type'] = type;\n",
" properties['figure_id'] = this.id;\n",
" this.ws.send(JSON.stringify(properties));\n",
"}\n",
"\n",
"mpl.figure.prototype.send_draw_message = function() {\n",
" if (!this.waiting) {\n",
" this.waiting = true;\n",
" this.ws.send(JSON.stringify({type: \"draw\", figure_id: this.id}));\n",
" }\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" var format_dropdown = fig.format_dropdown;\n",
" var format = format_dropdown.options[format_dropdown.selectedIndex].value;\n",
" fig.ondownload(fig, format);\n",
"}\n",
"\n",
"\n",
"mpl.figure.prototype.handle_resize = function(fig, msg) {\n",
" var size = msg['size'];\n",
" if (size[0] != fig.canvas.width || size[1] != fig.canvas.height) {\n",
" fig._resize_canvas(size[0], size[1]);\n",
" fig.send_message(\"refresh\", {});\n",
" };\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_rubberband = function(fig, msg) {\n",
" var x0 = msg['x0'] / mpl.ratio;\n",
" var y0 = (fig.canvas.height - msg['y0']) / mpl.ratio;\n",
" var x1 = msg['x1'] / mpl.ratio;\n",
" var y1 = (fig.canvas.height - msg['y1']) / mpl.ratio;\n",
" x0 = Math.floor(x0) + 0.5;\n",
" y0 = Math.floor(y0) + 0.5;\n",
" x1 = Math.floor(x1) + 0.5;\n",
" y1 = Math.floor(y1) + 0.5;\n",
" var min_x = Math.min(x0, x1);\n",
" var min_y = Math.min(y0, y1);\n",
" var width = Math.abs(x1 - x0);\n",
" var height = Math.abs(y1 - y0);\n",
"\n",
" fig.rubberband_context.clearRect(\n",
" 0, 0, fig.canvas.width, fig.canvas.height);\n",
"\n",
" fig.rubberband_context.strokeRect(min_x, min_y, width, height);\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_figure_label = function(fig, msg) {\n",
" // Updates the figure title.\n",
" fig.header.textContent = msg['label'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_cursor = function(fig, msg) {\n",
" var cursor = msg['cursor'];\n",
" switch(cursor)\n",
" {\n",
" case 0:\n",
" cursor = 'pointer';\n",
" break;\n",
" case 1:\n",
" cursor = 'default';\n",
" break;\n",
" case 2:\n",
" cursor = 'crosshair';\n",
" break;\n",
" case 3:\n",
" cursor = 'move';\n",
" break;\n",
" }\n",
" fig.rubberband_canvas.style.cursor = cursor;\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_message = function(fig, msg) {\n",
" fig.message.textContent = msg['message'];\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_draw = function(fig, msg) {\n",
" // Request the server to send over a new figure.\n",
" fig.send_draw_message();\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_image_mode = function(fig, msg) {\n",
" fig.image_mode = msg['mode'];\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Called whenever the canvas gets updated.\n",
" this.send_message(\"ack\", {});\n",
"}\n",
"\n",
"// A function to construct a web socket function for onmessage handling.\n",
"// Called in the figure constructor.\n",
"mpl.figure.prototype._make_on_message_function = function(fig) {\n",
" return function socket_on_message(evt) {\n",
" if (evt.data instanceof Blob) {\n",
" /* FIXME: We get \"Resource interpreted as Image but\n",
" * transferred with MIME type text/plain:\" errors on\n",
" * Chrome. But how to set the MIME type? It doesn't seem\n",
" * to be part of the websocket stream */\n",
" evt.data.type = \"image/png\";\n",
"\n",
" /* Free the memory for the previous frames */\n",
" if (fig.imageObj.src) {\n",
" (window.URL || window.webkitURL).revokeObjectURL(\n",
" fig.imageObj.src);\n",
" }\n",
"\n",
" fig.imageObj.src = (window.URL || window.webkitURL).createObjectURL(\n",
" evt.data);\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
" else if (typeof evt.data === 'string' && evt.data.slice(0, 21) == \"data:image/png;base64\") {\n",
" fig.imageObj.src = evt.data;\n",
" fig.updated_canvas_event();\n",
" fig.waiting = false;\n",
" return;\n",
" }\n",
"\n",
" var msg = JSON.parse(evt.data);\n",
" var msg_type = msg['type'];\n",
"\n",
" // Call the \"handle_{type}\" callback, which takes\n",
" // the figure and JSON message as its only arguments.\n",
" try {\n",
" var callback = fig[\"handle_\" + msg_type];\n",
" } catch (e) {\n",
" console.log(\"No handler for the '\" + msg_type + \"' message type: \", msg);\n",
" return;\n",
" }\n",
"\n",
" if (callback) {\n",
" try {\n",
" // console.log(\"Handling '\" + msg_type + \"' message: \", msg);\n",
" callback(fig, msg);\n",
" } catch (e) {\n",
" console.log(\"Exception inside the 'handler_\" + msg_type + \"' callback:\", e, e.stack, msg);\n",
" }\n",
" }\n",
" };\n",
"}\n",
"\n",
"// from http://stackoverflow.com/questions/1114465/getting-mouse-location-in-canvas\n",
"mpl.findpos = function(e) {\n",
" //this section is from http://www.quirksmode.org/js/events_properties.html\n",
" var targ;\n",
" if (!e)\n",
" e = window.event;\n",
" if (e.target)\n",
" targ = e.target;\n",
" else if (e.srcElement)\n",
" targ = e.srcElement;\n",
" if (targ.nodeType == 3) // defeat Safari bug\n",
" targ = targ.parentNode;\n",
"\n",
" // jQuery normalizes the pageX and pageY\n",
" // pageX,Y are the mouse positions relative to the document\n",
" // offset() returns the position of the element relative to the document\n",
" var x = e.pageX - $(targ).offset().left;\n",
" var y = e.pageY - $(targ).offset().top;\n",
"\n",
" return {\"x\": x, \"y\": y};\n",
"};\n",
"\n",
"/*\n",
" * return a copy of an object with only non-object keys\n",
" * we need this to avoid circular references\n",
" * http://stackoverflow.com/a/24161582/3208463\n",
" */\n",
"function simpleKeys (original) {\n",
" return Object.keys(original).reduce(function (obj, key) {\n",
" if (typeof original[key] !== 'object')\n",
" obj[key] = original[key]\n",
" return obj;\n",
" }, {});\n",
"}\n",
"\n",
"mpl.figure.prototype.mouse_event = function(event, name) {\n",
" var canvas_pos = mpl.findpos(event)\n",
"\n",
" if (name === 'button_press')\n",
" {\n",
" this.canvas.focus();\n",
" this.canvas_div.focus();\n",
" }\n",
"\n",
" var x = canvas_pos.x * mpl.ratio;\n",
" var y = canvas_pos.y * mpl.ratio;\n",
"\n",
" this.send_message(name, {x: x, y: y, button: event.button,\n",
" step: event.step,\n",
" guiEvent: simpleKeys(event)});\n",
"\n",
" /* This prevents the web browser from automatically changing to\n",
" * the text insertion cursor when the button is pressed. We want\n",
" * to control all of the cursor setting manually through the\n",
" * 'cursor' event from matplotlib */\n",
" event.preventDefault();\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" // Handle any extra behaviour associated with a key event\n",
"}\n",
"\n",
"mpl.figure.prototype.key_event = function(event, name) {\n",
"\n",
" // Prevent repeat events\n",
" if (name == 'key_press')\n",
" {\n",
" if (event.which === this._key)\n",
" return;\n",
" else\n",
" this._key = event.which;\n",
" }\n",
" if (name == 'key_release')\n",
" this._key = null;\n",
"\n",
" var value = '';\n",
" if (event.ctrlKey && event.which != 17)\n",
" value += \"ctrl+\";\n",
" if (event.altKey && event.which != 18)\n",
" value += \"alt+\";\n",
" if (event.shiftKey && event.which != 16)\n",
" value += \"shift+\";\n",
"\n",
" value += 'k';\n",
" value += event.which.toString();\n",
"\n",
" this._key_event_extra(event, name);\n",
"\n",
" this.send_message(name, {key: value,\n",
" guiEvent: simpleKeys(event)});\n",
" return false;\n",
"}\n",
"\n",
"mpl.figure.prototype.toolbar_button_onclick = function(name) {\n",
" if (name == 'download') {\n",
" this.handle_save(this, null);\n",
" } else {\n",
" this.send_message(\"toolbar_button\", {name: name});\n",
" }\n",
"};\n",
"\n",
"mpl.figure.prototype.toolbar_button_onmouseover = function(tooltip) {\n",
" this.message.textContent = tooltip;\n",
"};\n",
"mpl.toolbar_items = [[\"Home\", \"Reset original view\", \"fa fa-home icon-home\", \"home\"], [\"Back\", \"Back to previous view\", \"fa fa-arrow-left icon-arrow-left\", \"back\"], [\"Forward\", \"Forward to next view\", \"fa fa-arrow-right icon-arrow-right\", \"forward\"], [\"\", \"\", \"\", \"\"], [\"Pan\", \"Pan axes with left mouse, zoom with right\", \"fa fa-arrows icon-move\", \"pan\"], [\"Zoom\", \"Zoom to rectangle\", \"fa fa-square-o icon-check-empty\", \"zoom\"], [\"\", \"\", \"\", \"\"], [\"Download\", \"Download plot\", \"fa fa-floppy-o icon-save\", \"download\"]];\n",
"\n",
"mpl.extensions = [\"eps\", \"pdf\", \"png\", \"ps\", \"raw\", \"svg\"];\n",
"\n",
"mpl.default_extension = \"png\";var comm_websocket_adapter = function(comm) {\n",
" // Create a \"websocket\"-like object which calls the given IPython comm\n",
" // object with the appropriate methods. Currently this is a non binary\n",
" // socket, so there is still some room for performance tuning.\n",
" var ws = {};\n",
"\n",
" ws.close = function() {\n",
" comm.close()\n",
" };\n",
" ws.send = function(m) {\n",
" //console.log('sending', m);\n",
" comm.send(m);\n",
" };\n",
" // Register the callback with on_msg.\n",
" comm.on_msg(function(msg) {\n",
" //console.log('receiving', msg['content']['data'], msg);\n",
" // Pass the mpl event to the overridden (by mpl) onmessage function.\n",
" ws.onmessage(msg['content']['data'])\n",
" });\n",
" return ws;\n",
"}\n",
"\n",
"mpl.mpl_figure_comm = function(comm, msg) {\n",
" // This is the function which gets called when the mpl process\n",
" // starts-up an IPython Comm through the \"matplotlib\" channel.\n",
"\n",
" var id = msg.content.data.id;\n",
" // Get hold of the div created by the display call when the Comm\n",
" // socket was opened in Python.\n",
" var element = $(\"#\" + id);\n",
" var ws_proxy = comm_websocket_adapter(comm)\n",
"\n",
" function ondownload(figure, format) {\n",
" window.open(figure.imageObj.src);\n",
" }\n",
"\n",
" var fig = new mpl.figure(id, ws_proxy,\n",
" ondownload,\n",
" element.get(0));\n",
"\n",
" // Call onopen now - mpl needs it, as it is assuming we've passed it a real\n",
" // web socket which is closed, not our websocket->open comm proxy.\n",
" ws_proxy.onopen();\n",
"\n",
" fig.parent_element = element.get(0);\n",
" fig.cell_info = mpl.find_output_cell(\"\");\n",
" if (!fig.cell_info) {\n",
" console.error(\"Failed to find cell for figure\", id, fig);\n",
" return;\n",
" }\n",
"\n",
" var output_index = fig.cell_info[2]\n",
" var cell = fig.cell_info[0];\n",
"\n",
"};\n",
"\n",
"mpl.figure.prototype.handle_close = function(fig, msg) {\n",
" var width = fig.canvas.width/mpl.ratio\n",
" fig.root.unbind('remove')\n",
"\n",
" // Update the output cell to use the data from the current canvas.\n",
" fig.push_to_output();\n",
" var dataURL = fig.canvas.toDataURL();\n",
" // Re-enable the keyboard manager in IPython - without this line, in FF,\n",
" // the notebook keyboard shortcuts fail.\n",
" IPython.keyboard_manager.enable()\n",
" $(fig.parent_element).html('');\n",
" fig.close_ws(fig, msg);\n",
"}\n",
"\n",
"mpl.figure.prototype.close_ws = function(fig, msg){\n",
" fig.send_message('closing', msg);\n",
" // fig.ws.close()\n",
"}\n",
"\n",
"mpl.figure.prototype.push_to_output = function(remove_interactive) {\n",
" // Turn the data on the canvas into data in the output cell.\n",
" var width = this.canvas.width/mpl.ratio\n",
" var dataURL = this.canvas.toDataURL();\n",
" this.cell_info[1]['text/html'] = '';\n",
"}\n",
"\n",
"mpl.figure.prototype.updated_canvas_event = function() {\n",
" // Tell IPython that the notebook contents must change.\n",
" IPython.notebook.set_dirty(true);\n",
" this.send_message(\"ack\", {});\n",
" var fig = this;\n",
" // Wait a second, then push the new image to the DOM so\n",
" // that it is saved nicely (might be nice to debounce this).\n",
" setTimeout(function () { fig.push_to_output() }, 1000);\n",
"}\n",
"\n",
"mpl.figure.prototype._init_toolbar = function() {\n",
" var fig = this;\n",
"\n",
" var nav_element = $('')\n",
" nav_element.attr('style', 'width: 100%');\n",
" this.root.append(nav_element);\n",
"\n",
" // Define a callback function for later on.\n",
" function toolbar_event(event) {\n",
" return fig.toolbar_button_onclick(event['data']);\n",
" }\n",
" function toolbar_mouse_event(event) {\n",
" return fig.toolbar_button_onmouseover(event['data']);\n",
" }\n",
"\n",
" for(var toolbar_ind in mpl.toolbar_items){\n",
" var name = mpl.toolbar_items[toolbar_ind][0];\n",
" var tooltip = mpl.toolbar_items[toolbar_ind][1];\n",
" var image = mpl.toolbar_items[toolbar_ind][2];\n",
" var method_name = mpl.toolbar_items[toolbar_ind][3];\n",
"\n",
" if (!name) { continue; };\n",
"\n",
" var button = $('');\n",
" button.click(method_name, toolbar_event);\n",
" button.mouseover(tooltip, toolbar_mouse_event);\n",
" nav_element.append(button);\n",
" }\n",
"\n",
" // Add the status bar.\n",
" var status_bar = $('');\n",
" nav_element.append(status_bar);\n",
" this.message = status_bar[0];\n",
"\n",
" // Add the close button to the window.\n",
" var buttongrp = $('');\n",
" var button = $('');\n",
" button.click(function (evt) { fig.handle_close(fig, {}); } );\n",
" button.mouseover('Stop Interaction', toolbar_mouse_event);\n",
" buttongrp.append(button);\n",
" var titlebar = this.root.find($('.ui-dialog-titlebar'));\n",
" titlebar.prepend(buttongrp);\n",
"}\n",
"\n",
"mpl.figure.prototype._root_extra_style = function(el){\n",
" var fig = this\n",
" el.on(\"remove\", function(){\n",
"\tfig.close_ws(fig, {});\n",
" });\n",
"}\n",
"\n",
"mpl.figure.prototype._canvas_extra_style = function(el){\n",
" // this is important to make the div 'focusable\n",
" el.attr('tabindex', 0)\n",
" // reach out to IPython and tell the keyboard manager to turn it's self\n",
" // off when our div gets focus\n",
"\n",
" // location in version 3\n",
" if (IPython.notebook.keyboard_manager) {\n",
" IPython.notebook.keyboard_manager.register_events(el);\n",
" }\n",
" else {\n",
" // location in version 2\n",
" IPython.keyboard_manager.register_events(el);\n",
" }\n",
"\n",
"}\n",
"\n",
"mpl.figure.prototype._key_event_extra = function(event, name) {\n",
" var manager = IPython.notebook.keyboard_manager;\n",
" if (!manager)\n",
" manager = IPython.keyboard_manager;\n",
"\n",
" // Check for shift+enter\n",
" if (event.shiftKey && event.which == 13) {\n",
" this.canvas_div.blur();\n",
" event.shiftKey = false;\n",
" // Send a \"J\" for go to next cell\n",
" event.which = 74;\n",
" event.keyCode = 74;\n",
" manager.command_mode();\n",
" manager.handle_keydown(event);\n",
" }\n",
"}\n",
"\n",
"mpl.figure.prototype.handle_save = function(fig, msg) {\n",
" fig.ondownload(fig, null);\n",
"}\n",
"\n",
"\n",
"mpl.find_output_cell = function(html_output) {\n",
" // Return the cell and output element which can be found *uniquely* in the notebook.\n",
" // Note - this is a bit hacky, but it is done because the \"notebook_saving.Notebook\"\n",
" // IPython event is triggered only after the cells have been serialised, which for\n",
" // our purposes (turning an active figure into a static one), is too late.\n",
" var cells = IPython.notebook.get_cells();\n",
" var ncells = cells.length;\n",
" for (var i=0; i= 3 moved mimebundle to data attribute of output\n",
" data = data.data;\n",
" }\n",
" if (data['text/html'] == html_output) {\n",
" return [cell, data, j];\n",
" }\n",
" }\n",
" }\n",
" }\n",
"}\n",
"\n",
"// Register the function which deals with the matplotlib target/channel.\n",
"// The kernel may be null if the page has been refreshed.\n",
"if (IPython.notebook.kernel != null) {\n",
" IPython.notebook.kernel.comm_manager.register_target('matplotlib', mpl.mpl_figure_comm);\n",
"}\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
""
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"(736481.0, 736873.0)"
]
},
"execution_count": 167,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"%matplotlib nbagg\n",
"import matplotlib.pyplot as plt\n",
"f,ax = plt.subplots()\n",
"pred = pd.Series(yhats, index=pd.date_range(start=sup_dX.index[-1], periods=len(yhats)), name='Blind Prediction')\n",
"X = df.set_index('time')['close'].sort_index()\n",
"X.plot(label='Real', ax=ax)\n",
"pred.plot(label='Blind', ax=ax)\n",
"ax.legend()\n",
"ax.set_xlim([pd.to_datetime('2017-06-01'),pd.to_datetime('2018-06-28')]) "
]
},
{
"cell_type": "markdown",
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T17:25:21.697193Z",
"start_time": "2018-04-23T17:25:21.564174Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"![](btc.gif)"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# What I'd do differently / next?\n",
"* Multi-timestep pipeline and hyperparameter optimisation\n",
"* i.e. does stationarity correction make a difference?\n",
"* Re-training on dynamic timesteps (2/3/4-delay hops)\n",
"* Sliding window (needs dive in to TF underbelly)\n",
"* Treat multi-currency valuations as correlated features\n",
"* Try [Attention Modelling](https://towardsdatascience.com/memory-attention-sequences-37456d271992) instead of LSTM"
]
},
{
"cell_type": "markdown",
"metadata": {
"ExecuteTime": {
"end_time": "2018-04-23T13:25:34.317076Z",
"start_time": "2018-04-23T13:25:34.278841Z"
},
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"# Wrap up, Conclusions, Questions?\n",
"* This is *crap*.\n",
"* Yes, it models the input data fairly well given a split but the predictive model doesn't include the randomness we'd see in the real market\n",
"* Could be worthwhile adding in other features (OHLC) and multiple timesteps, but this *explodes* training time.\n",
"* It *might* be right about bitcoin going down tomorrow, lemme know if anyone makes any money off it.\n",
"* LSTM is *awesome* but it's fiddly. Keras makes life a bit easier but it does constrain a bit.\n",
"* I am not an ML expert, I may have made fundamental mistakes\n",
"* These models ran a hell of a lot better on a cloud GPU, but there's only so much 'live' I'm willing to risk!"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"# Addendum: Places I was shamelessly 'insipired by'\n",
"* https://www.kaggle.com/microtang/predicting-btc-price-using-rnn/notebook\n",
"* https://machinelearningmastery.com/time-series-forecasting-long-short-term-memory-network-python/\n",
"* https://machinelearningmastery.com/use-different-batch-sizes-training-predicting-python-keras/\n",
"* http://karpathy.github.io/2015/05/21/rnn-effectiveness/\n",
"* https://machinelearningmastery.com/make-predictions-long-short-term-memory-models-keras/\n",
"* https://lilianweng.github.io/lil-log/2017/07/08/predict-stock-prices-using-RNN-part-1.html\n",
"* http://adventuresinmachinelearning.com/keras-lstm-tutorial/\n",
"* https://www.datasciencecentral.com/profiles/blogs/tutorial-forecasting-with-seasonal-arima"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"celltoolbar": "Slideshow",
"kernelspec": {
"display_name": "Python [conda env:bash]",
"language": "python",
"name": "conda-env-bash-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.6.5"
},
"nbpresent": {
"slides": {
"59b1e077-9045-4a30-aa3b-e4f05ac4b5eb": {
"id": "59b1e077-9045-4a30-aa3b-e4f05ac4b5eb",
"prev": null,
"regions": {
"c51f56c1-eb42-437c-9900-ff979351ddc9": {
"attrs": {
"height": 0.8,
"width": 0.8,
"x": 0.1,
"y": 0.1
},
"content": {
"cell": "1fd0e61d-57b0-4843-9673-a3b5d9d55bc3",
"part": "whole"
},
"id": "c51f56c1-eb42-437c-9900-ff979351ddc9"
},
"db562d40-e360-409c-963e-19df1c3c7ba2": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "4ae5529d-5aaa-423e-967b-fa79455c0231",
"part": "whole"
},
"id": "db562d40-e360-409c-963e-19df1c3c7ba2"
}
}
},
"69b597fe-965a-49e8-9556-b42a9b9c74db": {
"id": "69b597fe-965a-49e8-9556-b42a9b9c74db",
"prev": "6c34dde0-be9c-4eac-9677-52cebca989ad",
"regions": {
"012cb989-8760-41cd-bb01-a671f0eb05ca": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "b6f19a2f-cb75-4ab1-81c6-ec7b06da811d",
"part": "whole"
},
"id": "012cb989-8760-41cd-bb01-a671f0eb05ca"
},
"03f20341-8289-40b9-ac1d-341952f514a7": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "000ce75c-f0cb-439b-ab0a-d6df8a865b4f",
"part": "whole"
},
"id": "03f20341-8289-40b9-ac1d-341952f514a7"
},
"0fb69111-e3d0-4e41-a967-4daf474498b7": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "57b28eda-cbd5-4139-9521-814d446d0b40",
"part": "whole"
},
"id": "0fb69111-e3d0-4e41-a967-4daf474498b7"
},
"10aa332e-e907-4da7-a9a1-39def7413222": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "0b80d536-1bd9-44bc-a3b2-83c3abeaf1d2",
"part": "whole"
},
"id": "10aa332e-e907-4da7-a9a1-39def7413222"
},
"1fc20dc0-65d9-4567-bc7e-92bf7d455540": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "24a78010-3d8c-4ffb-8a1f-086b20d67434",
"part": "whole"
},
"id": "1fc20dc0-65d9-4567-bc7e-92bf7d455540"
},
"207a9348-68ec-4a4a-8b3a-adc5254c0b79": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "71eef1b8-26a0-4b42-8cf9-2b13b9962b25",
"part": "whole"
},
"id": "207a9348-68ec-4a4a-8b3a-adc5254c0b79"
},
"47a56eaf-20ba-470c-98d4-46e24b9c7116": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "efd34c2e-a8ee-476f-b2a7-6cc258b80fec",
"part": "whole"
},
"id": "47a56eaf-20ba-470c-98d4-46e24b9c7116"
},
"497fadf0-92de-486a-be7b-9fe445458458": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "d60a69d5-c528-4bd4-a7cb-6ca420be7e52",
"part": "whole"
},
"id": "497fadf0-92de-486a-be7b-9fe445458458"
},
"4fbac1b5-c52a-479f-a17d-899909854ac5": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "fcfa8cb1-d4e4-4663-85ff-4dc2ceb2f300",
"part": "whole"
},
"id": "4fbac1b5-c52a-479f-a17d-899909854ac5"
},
"7a10e35d-7f98-4ffa-a33b-feaf236fc790": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "4b2441c5-839a-4a66-8251-98d3657be21e",
"part": "whole"
},
"id": "7a10e35d-7f98-4ffa-a33b-feaf236fc790"
},
"84e11845-a6e8-450c-9a26-a9b8167a8cb7": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "5340f61e-af7f-4abe-bc2d-715641d2b416",
"part": "whole"
},
"id": "84e11845-a6e8-450c-9a26-a9b8167a8cb7"
},
"86b9d812-a5d3-40ae-96b3-e9986b60adfd": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "bdd4abcb-d36f-4561-a4df-908178fc2483",
"part": "whole"
},
"id": "86b9d812-a5d3-40ae-96b3-e9986b60adfd"
},
"879f8ea7-13af-41b3-9bd3-3ef2198af3f5": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "039b9754-0ad4-4353-a071-021a23d9c247",
"part": "whole"
},
"id": "879f8ea7-13af-41b3-9bd3-3ef2198af3f5"
},
"8d3fc833-65ca-4e82-816e-2ecfb1a713ea": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "2c21a769-39fa-406d-915b-0cde43cfe060",
"part": "whole"
},
"id": "8d3fc833-65ca-4e82-816e-2ecfb1a713ea"
},
"a5e452fe-12aa-4403-8f37-b3f92ac8c0da": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "89b4c2b5-ab20-46ea-a5c0-899403604c08",
"part": "whole"
},
"id": "a5e452fe-12aa-4403-8f37-b3f92ac8c0da"
},
"a637e6bf-2d39-4a72-9d3b-6ff6203719b0": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "aebe08f5-ebb7-4547-a726-44c04ec249fe",
"part": "whole"
},
"id": "a637e6bf-2d39-4a72-9d3b-6ff6203719b0"
},
"af17ba3e-ae05-4128-aee2-8e0e0bb8a828": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "364c476f-3da0-4598-90cd-d1c5ead76088",
"part": "whole"
},
"id": "af17ba3e-ae05-4128-aee2-8e0e0bb8a828"
},
"bcf5d241-1f67-4122-a4d6-40fb97dfbff4": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "16d60f0f-e11c-444a-9478-8998d435cc2f",
"part": "whole"
},
"id": "bcf5d241-1f67-4122-a4d6-40fb97dfbff4"
},
"c356046d-6daf-4280-bfd5-44a72833b15b": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "41d8e208-9381-44d9-8ef6-5d29fcff2b14",
"part": "whole"
},
"id": "c356046d-6daf-4280-bfd5-44a72833b15b"
},
"c37577fe-b3c3-499a-8a63-24231bc2a79c": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "04cdbbf0-c28c-418a-a490-251b44fe0c65",
"part": "whole"
},
"id": "c37577fe-b3c3-499a-8a63-24231bc2a79c"
},
"d9fb68d4-61c6-4218-ae31-f7852a6fc8c6": {
"attrs": {
"height": 0.8,
"width": 0.8,
"x": 0.1,
"y": 0.1
},
"content": {
"cell": "e4d1c9be-9927-4846-b48a-5121af3665c2",
"part": "whole"
},
"id": "d9fb68d4-61c6-4218-ae31-f7852a6fc8c6"
},
"eefd0d8b-a0ff-4e18-86a8-412d927c45a1": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "70277862-c156-4fed-bdb8-60c8d36f8024",
"part": "whole"
},
"id": "eefd0d8b-a0ff-4e18-86a8-412d927c45a1"
},
"f440c9f3-4a4f-4e69-9ed5-f07afc91195e": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "718da564-137e-4ecb-ad27-970a7b082a96",
"part": "whole"
},
"id": "f440c9f3-4a4f-4e69-9ed5-f07afc91195e"
},
"f65adba6-5990-4a78-916b-86ee30e1726a": {
"attrs": {
"height": 0.4,
"width": 0.8,
"x": 0.1,
"y": 0.5
},
"content": {
"cell": "d23f402e-4fa4-4711-bdb7-07f57302184e",
"part": "whole"
},
"id": "f65adba6-5990-4a78-916b-86ee30e1726a"
}
}
},
"6c34dde0-be9c-4eac-9677-52cebca989ad": {
"id": "6c34dde0-be9c-4eac-9677-52cebca989ad",
"prev": "bb681677-91a1-436e-a718-8262ad67a9c7",
"regions": {
"8ad5aedc-1a00-47ac-b946-2bae1d897e48": {
"attrs": {
"height": 0.8,
"width": 0.8,
"x": 0.1,
"y": 0.1
},
"content": {
"cell": "1be69ffe-1dc3-41bf-a3d9-bb131202eae7",
"part": "whole"
},
"id": "8ad5aedc-1a00-47ac-b946-2bae1d897e48"
}
}
},
"7371e675-22fd-4343-b05b-327d23f38a8e": {
"id": "7371e675-22fd-4343-b05b-327d23f38a8e",
"prev": "59b1e077-9045-4a30-aa3b-e4f05ac4b5eb",
"regions": {
"2d89cc3a-a95d-4e9d-b7e8-d0b79b962ced": {
"attrs": {
"height": 0.8,
"width": 0.8,
"x": 0.1,
"y": 0.1
},
"content": {
"cell": "13d20d4d-c608-445c-a49f-394619c393f2",
"part": "whole"
},
"id": "2d89cc3a-a95d-4e9d-b7e8-d0b79b962ced"
}
}
},
"bb681677-91a1-436e-a718-8262ad67a9c7": {
"id": "bb681677-91a1-436e-a718-8262ad67a9c7",
"prev": "7371e675-22fd-4343-b05b-327d23f38a8e",
"regions": {
"75fb7835-7df6-425e-99eb-67e7c030eda8": {
"attrs": {
"height": 0.8,
"width": 0.8,
"x": 0.1,
"y": 0.1
},
"content": {
"cell": "fc2973da-a545-4c30-a9a8-3a3a39039597",
"part": "whole"
},
"id": "75fb7835-7df6-425e-99eb-67e7c030eda8"
}
}
}
},
"themes": {}
},
"notify_time": "5",
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}