├── CNAME ├── .gitattributes ├── .gitignore ├── assets ├── images │ ├── favicon.ico │ └── meta-img.jpg ├── css │ └── style.css ├── built │ ├── index.js.LICENSE.txt │ ├── style.css │ ├── pyscript.py │ └── index.js └── js │ ├── repl.js │ ├── index.js │ └── chart_code.js ├── data ├── donut_chart.csv ├── bar_chart.csv ├── stacked_bar_chart.csv ├── scatter_plot.csv └── box_plot.csv ├── download_pyscript.sh ├── tailwind.config.js ├── webpack.config.js ├── package.json ├── README.md ├── LICENSE ├── scripts └── script.py ├── reduce_dataset.ipynb └── index.html /CNAME: -------------------------------------------------------------------------------- 1 | dataviz.dylancastillo.co -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .DS_Store 3 | package-lock.json 4 | .ipynb_checkpoints/ 5 | -------------------------------------------------------------------------------- /assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanjcastillo/python-dataviz-cookbook/HEAD/assets/images/favicon.ico -------------------------------------------------------------------------------- /assets/images/meta-img.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dylanjcastillo/python-dataviz-cookbook/HEAD/assets/images/meta-img.jpg -------------------------------------------------------------------------------- /data/donut_chart.csv: -------------------------------------------------------------------------------- 1 | Name,Volume 2 | AAPL,395928831057 3 | AMZN,17907839742 4 | GOOGL,10721989174 5 | IBM,17435367880 6 | JPM,85374727984 7 | -------------------------------------------------------------------------------- /data/bar_chart.csv: -------------------------------------------------------------------------------- 1 | Year,Open,Close,Name 2 | 2014,119.27,119.0,AAPL 3 | 2015,134.46,133.0,AAPL 4 | 2016,118.18,118.25,AAPL 5 | 2017,175.11,176.42,AAPL 6 | -------------------------------------------------------------------------------- /download_pyscript.sh: -------------------------------------------------------------------------------- 1 | set -o errexit 2 | curl https://pyscript.net/alpha/pyscript.css -o ./assets/built/pyscript.css 3 | curl https://pyscript.net/alpha/pyscript.js -o ./assets/built/pyscript.js 4 | curl https://pyscript.net/alpha/pyscript.py -o ./assets/built/pyscript.py 5 | -------------------------------------------------------------------------------- /tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | const colors = require('tailwindcss/colors'); 3 | 4 | module.exports = { 5 | content: ["assets/js/*.js", "./*.html"], 6 | theme: { 7 | extend: { 8 | colors: { 9 | bgray: colors.slate, 10 | }, 11 | }, 12 | plugins: [], 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require("path"); 2 | 3 | module.exports = [{ 4 | entry: "./assets/js/index.js", 5 | watch: true, 6 | mode: "production", 7 | output: { 8 | path: path.resolve(__dirname, "assets/built/"), 9 | filename: "index.js", 10 | }, 11 | devServer: { 12 | writeToDisk: true, 13 | }, 14 | }, ]; 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pandas-pyscript", 3 | "version": "1.0.0", 4 | "description": "Pandas PyScript", 5 | "main": "webpack.config.js", 6 | "scripts": { 7 | "build": "webpack --mode production" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "tailwindcss": "^3.1.8", 14 | "webpack": "^5.73.0", 15 | "webpack-cli": "^4.10.0" 16 | }, 17 | "dependencies": { 18 | "alpinejs": "^3.10.3", 19 | "plotly.js-dist-min": "^2.14.0" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Python Data Viz Cookbook 2 | 3 | An interactive cookbook to create graphs with Python 4 | 5 | Check it out: [Python Data Viz Cookbook](https://dataviz.dylancastillo.co/) 6 | 7 | ## Development 8 | 9 | 1. Install [Node](https://nodejs.dev/en/learn/how-to-install-nodejs) 10 | 2. Install requirements using `npm install` 11 | 3. Run Tailwind CLI: `npx tailwindcss -i ./assets/css/style.css -o ./assets/built/style.css --watch --minify` 12 | 4. Run Webpack: `npm run build` 13 | 14 | ## Contributions 15 | 16 | If you have any ideas of new graphs to add, please feel to open an issue or (even better!) a pull request with your proposal. 17 | 18 | ## Attributions 19 | 20 | Original dataset by [ichardddddd](https://github.com/szrlee). 21 | 22 | ## License 23 | 24 | MIT 25 | -------------------------------------------------------------------------------- /data/stacked_bar_chart.csv: -------------------------------------------------------------------------------- 1 | Year,Name,Volume 2 | 2012,AAPL,32.994076346 3 | 2012,AMZN,1.050233531 4 | 2012,GOOGL,0.649998834 5 | 2012,IBM,1.020874087 6 | 2012,JPM,8.267915072 7 | 2013,AAPL,25.606397999 8 | 2013,AMZN,0.748378451 9 | 2013,GOOGL,0.526336666 10 | 2013,IBM,1.069999353 11 | 2013,JPM,5.324287797 12 | 2014,AAPL,15.934492689999999 13 | 2014,AMZN,1.030226257 14 | 2014,GOOGL,0.529858529 15 | 2014,IBM,1.140046829 16 | 2014,JPM,3.985797974 17 | 2015,AAPL,13.01993994 18 | 2015,AMZN,0.954245799 19 | 2015,GOOGL,0.545842483 20 | 2015,IBM,1.100959104 21 | 2015,JPM,3.992625707 22 | 2016,AAPL,9.625820389 23 | 2016,AMZN,1.034016481 24 | 2016,GOOGL,0.493769102 25 | 2016,IBM,1.016418393 26 | 2016,JPM,4.289325011 27 | 2017,AAPL,6.811235883 28 | 2017,AMZN,0.8829259 29 | 2017,GOOGL,0.405862262 30 | 2017,IBM,1.067761571 31 | 2017,JPM,3.488062616 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Dylan Castillo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/css/style.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | details>summary { 6 | list-style: none; 7 | } 8 | 9 | details>summary::marker, 10 | details>summary::-webkit-details-marker { 11 | display: none; 12 | } 13 | 14 | #initial>div, 15 | #output>div { 16 | @apply relative overflow-auto; 17 | } 18 | 19 | #output div, 20 | #initial div { 21 | @apply whitespace-pre-wrap mt-[-5px]; 22 | } 23 | 24 | #output div div, 25 | #initial div div { 26 | @apply whitespace-normal mt-[-5px]; 27 | } 28 | 29 | table.dataframe { 30 | @apply text-sm text-gray-600 w-full; 31 | } 32 | 33 | table.dataframe thead { 34 | @apply bg-stone-800 text-white; 35 | } 36 | 37 | table.dataframe thead tr th { 38 | @apply text-center; 39 | } 40 | 41 | table.dataframe thead tr th:first-child { 42 | @apply bg-stone-500; 43 | } 44 | 45 | table.dataframe tbody tr th:first-child { 46 | @apply bg-stone-300 border-b border-bgray-200; 47 | } 48 | 49 | table.dataframe thead th { 50 | @apply py-2 px-4; 51 | } 52 | 53 | table.dataframe tbody tr { 54 | @apply border-b bg-white text-center; 55 | } 56 | 57 | table.dataframe tbody th { 58 | @apply py-2 px-4; 59 | } 60 | -------------------------------------------------------------------------------- /assets/built/index.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc 3 | * @license MIT 4 | * @preserve Project Home: https://github.com/voidqk/polybooljs 5 | */ 6 | 7 | /* 8 | object-assign 9 | (c) Sindre Sorhus 10 | @license MIT 11 | */ 12 | 13 | /*! 14 | * Determine if an object is a Buffer 15 | * 16 | * @author Feross Aboukhadijeh 17 | * @license MIT 18 | */ 19 | 20 | /*! 21 | * The buffer module from node.js, for the browser. 22 | * 23 | * @author Feross Aboukhadijeh 24 | * @license MIT 25 | */ 26 | 27 | /*! 28 | * The buffer module from node.js, for the browser. 29 | * 30 | * @author Feross Aboukhadijeh 31 | * @license MIT 32 | */ 33 | 34 | /*! 35 | * pad-left 36 | * 37 | * Copyright (c) 2014-2015, Jon Schlinkert. 38 | * Licensed under the MIT license. 39 | */ 40 | 41 | /*! 42 | * repeat-string 43 | * 44 | * Copyright (c) 2014-2015, Jon Schlinkert. 45 | * Licensed under the MIT License. 46 | */ 47 | 48 | /*! Native Promise Only 49 | v0.8.1 (c) Kyle Simpson 50 | MIT License: http://getify.mit-license.org 51 | */ 52 | -------------------------------------------------------------------------------- /scripts/script.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | import numpy as np 4 | import pandas as pd 5 | import seaborn as sns 6 | 7 | import matplotlib.pyplot as plt 8 | import plotly.express as px 9 | 10 | from js import plot_js, update_initial_df 11 | from plotly.utils import PlotlyJSONEncoder 12 | from pyodide import to_js, create_proxy 13 | from pyodide.http import open_url 14 | 15 | 16 | df = pd.DataFrame({}) 17 | chart_data_mapping = { 18 | "Line Chart": "line_chart.csv", 19 | "Bar Chart": "bar_chart.csv", 20 | "Grouped Bar Chart": "bar_chart.csv", 21 | "Stacked Bar Chart": "stacked_bar_chart.csv", 22 | "Stacked Area Chart": "stacked_area_chart.csv", 23 | "Pie Chart": "donut_chart.csv", 24 | "Donut Chart": "donut_chart.csv", 25 | "Histogram": "histogram.csv", 26 | "Scatter Plot": "scatter_plot.csv", 27 | "Box Plot": "box_plot.csv", 28 | "Strip Plot": "box_plot.csv", 29 | "Pair Plot": "box_plot.csv" 30 | } 31 | 32 | chart_type = document.querySelector("#chart-type") 33 | 34 | 35 | def plot(fig): 36 | graph_json = json.dumps(fig, cls=PlotlyJSONEncoder) 37 | plot_js(graph_json) 38 | 39 | 40 | def read_data(change): 41 | global df 42 | url = "./data/{}" 43 | 44 | try: 45 | df = pd.read_csv(open_url(url.format(chart_data_mapping[chart_type.value]))) 46 | 47 | if "Date" in df.columns: 48 | df["Date"] = pd.to_datetime(df["Date"]) 49 | 50 | update_initial_df(to_js(df.head().to_html())) 51 | except Exception: 52 | pass 53 | 54 | document.querySelector( 55 | "#copy-code-prefix" 56 | ).innerHTML = f"""import pandas as pd 57 | import plotly.express as px 58 | import matplotlib.pyplot as plt 59 | import seaborn as sns 60 | import numpy as np 61 | 62 | df = pd.read_csv("https://raw.githubusercontent.com/dylanjcastillo/python-dataviz-cookbook/main/data/{chart_data_mapping[chart_type.value]}") 63 | 64 | if "Date" in df.columns: 65 | df["Date"] = pd.to_datetime(df["Date"]) 66 | """ 67 | 68 | 69 | chart_type.addEventListener("change", create_proxy(read_data)) 70 | read_data(None) 71 | -------------------------------------------------------------------------------- /assets/js/repl.js: -------------------------------------------------------------------------------- 1 | import { 2 | line_chart, 3 | bar_chart, 4 | grouped_bar_chart, 5 | stacked_bar_chart, 6 | stacked_area_chart, 7 | pie_chart, 8 | donut_chart, 9 | histogram, 10 | scatter_plot, 11 | box_plot, 12 | strip_plot, 13 | pair_plot 14 | } from "./chart_code.js"; 15 | 16 | 17 | function get_sample_code(chart_type, library) { 18 | 19 | if (chart_type === "Line Chart") { 20 | return line_chart[library]; 21 | } else if (chart_type === "Bar Chart") { 22 | return bar_chart[library]; 23 | } else if (chart_type === "Grouped Bar Chart") { 24 | return grouped_bar_chart[library]; 25 | } else if (chart_type === "Stacked Bar Chart") { 26 | return stacked_bar_chart[library]; 27 | } else if (chart_type === "Stacked Area Chart") { 28 | return stacked_area_chart[library]; 29 | } else if (chart_type === "Pie Chart") { 30 | return pie_chart[library]; 31 | } else if (chart_type === "Donut Chart") { 32 | return donut_chart[library]; 33 | } else if (chart_type === "Histogram") { 34 | return histogram[library]; 35 | } else if (chart_type === "Scatter Plot") { 36 | return scatter_plot[library]; 37 | } else if (chart_type === "Box Plot") { 38 | return box_plot[library]; 39 | } else if (chart_type === "Strip Plot") { 40 | return strip_plot[library]; 41 | } else if (chart_type === "Pair Plot") { 42 | return pair_plot[library]; 43 | } 44 | return ""; 45 | } 46 | 47 | export function update_repl_code(selected_library) { 48 | let chart_type = document.getElementById("chart-type"); 49 | console.log(selected_library); 50 | let code_str = get_sample_code(chart_type.value, selected_library); 51 | 52 | if (code_str != "") { 53 | document.getElementById("output-repl").remove(); 54 | let repl = document.createElement("py-repl"); 55 | 56 | repl.textContent = code_str; 57 | repl.setAttribute("std-out", "output"); 58 | repl.id = "output-repl"; 59 | document.getElementById("container-repl").appendChild(repl); 60 | 61 | if (code_str.match("\$")) { 62 | let editor_lines = document.getElementById("container-repl").getElementsByClassName("cm-line"); 63 | for (var i = 0; i < editor_lines.length; i++) { 64 | editor_lines[i].textContent = editor_lines[i].textContent.replace("amp;", "").replace("<", 65 | "<").replace(">", ">"); 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /assets/js/index.js: -------------------------------------------------------------------------------- 1 | import Alpine from 'alpinejs'; 2 | import { 3 | update_repl_code 4 | } from './repl.js'; 5 | 6 | window.Alpine = Alpine; 7 | 8 | Alpine.data('radioData', () => ({ 9 | selectedLibrary: 'Pandas', 10 | libraries: [{ 11 | id: "pandas-option", 12 | value: "Pandas", 13 | label: "Pandas" 14 | }, 15 | { 16 | id: "mpl-option", 17 | value: "Matplotlib", 18 | label: "Matplotlib" 19 | }, 20 | { 21 | id: "sns-option", 22 | value: "Seaborn", 23 | label: "Seaborn" 24 | }, 25 | { 26 | id: "px-option", 27 | value: "Plotly Express", 28 | label: "Plotly Express" 29 | }, 30 | ], 31 | init() { 32 | update_repl_code("Pandas"); 33 | }, 34 | update_repl() { 35 | if (this.$el.id === "chart-type") { 36 | update_repl_code(this.selectedLibrary); 37 | } else { 38 | update_repl_code(this.$el.getAttribute('value')); 39 | } 40 | }, 41 | copy_to_clipboard() { 42 | const repl_lines = document.querySelectorAll("#output-repl .cm-line"); 43 | const prefix = document.getElementById("copy-code-prefix"); 44 | 45 | let text_to_copy = prefix.textContent; 46 | 47 | repl_lines.forEach((line) => { 48 | text_to_copy += "\n" + line.textContent; 49 | }); 50 | 51 | this.$el.textContent = "Copied!"; 52 | this.$el.classList.add("bg-rose-400"); 53 | setTimeout(() => { 54 | this.$el.textContent = "Copy to clipboard"; 55 | this.$el.classList.remove("bg-rose-400"); 56 | }, 2000); 57 | 58 | navigator.clipboard.writeText(text_to_copy); 59 | } 60 | })); 61 | 62 | Alpine.start(); 63 | 64 | const observer = new MutationObserver((event) => { 65 | let elements = document.querySelectorAll('div[id^="output-"]'); 66 | [].forEach.call(elements, function (element) { 67 | if (parseInt(element.id.split("-")[1]) != elements.length) { 68 | element.classList.add("hidden"); 69 | } else { 70 | if (element.getElementsByTagName('img').length > 0) { 71 | var img = element.getElementsByTagName('img')[0] 72 | img.setAttribute("x-bind", "imgModal"); 73 | 74 | Alpine.bind("imgModal", () => ({ 75 | type: 'button', 76 | '@click'() { 77 | this.$dispatch('lightbox', { 78 | imgModalSrc: img.getAttribute("src"), 79 | }) 80 | }, 81 | })); 82 | } 83 | } 84 | }); 85 | }); 86 | 87 | const output = document.getElementById('output'); 88 | 89 | observer.observe(output, { 90 | childList: true, 91 | subtree: true 92 | }); 93 | 94 | document.addEventListener('DOMContentLoaded', function () { 95 | var about_button = document.getElementById('about'); 96 | var close_modal_button = document.getElementById('close-modal'); 97 | var btn_run = document.getElementById('btnRun'); 98 | 99 | btn_run.classList.remove("opacity-0"); 100 | btn_run.classList.remove("group-hover:opacity-100"); 101 | btn_run.classList.add("hover:opacity-75") 102 | 103 | about_button.addEventListener('click', function (event) { 104 | event.preventDefault(); 105 | document.getElementById("modal-id").classList.toggle("hidden"); 106 | document.getElementById("modal-id" + "-backdrop").classList.toggle("hidden"); 107 | document.getElementById("modal-id").classList.toggle("flex"); 108 | document.getElementById("modal-id" + "-backdrop").classList.toggle("flex"); 109 | }); 110 | 111 | close_modal_button.addEventListener('click', function () { 112 | document.getElementById("modal-id").classList.toggle("hidden"); 113 | document.getElementById("modal-id" + "-backdrop").classList.toggle("hidden"); 114 | document.getElementById("modal-id").classList.toggle("flex"); 115 | document.getElementById("modal-id" + "-backdrop").classList.toggle("flex"); 116 | }); 117 | 118 | }); 119 | -------------------------------------------------------------------------------- /reduce_dataset.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "id": "a290dba1", 7 | "metadata": {}, 8 | "outputs": [], 9 | "source": [ 10 | "import pandas as pd" 11 | ] 12 | }, 13 | { 14 | "cell_type": "markdown", 15 | "id": "ab113f49", 16 | "metadata": {}, 17 | "source": [ 18 | "## Line chart data" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": 4, 24 | "id": "4be84998", 25 | "metadata": {}, 26 | "outputs": [], 27 | "source": [ 28 | "url = \"https://raw.githubusercontent.com/szrlee/Stock-Time-Series-Analysis/master/data/all_stocks_2006-01-01_to_2018-01-01.csv\"\n", 29 | "df = pd.read_csv(url)\n", 30 | "\n", 31 | "df = df.loc[df.Name.isin([\"AAPL\", \"JPM\", \"GOOGL\", \"AMZN\"])]\n", 32 | "df[\"Date\"] = pd.to_datetime(df.Date)" 33 | ] 34 | }, 35 | { 36 | "cell_type": "code", 37 | "execution_count": 9, 38 | "id": "cfdd7ddb", 39 | "metadata": {}, 40 | "outputs": [], 41 | "source": [ 42 | "df[df.Date.dt.year >= 2015].to_csv(\"data/line_plot.csv\", index=False)" 43 | ] 44 | }, 45 | { 46 | "cell_type": "markdown", 47 | "id": "27e98ba2", 48 | "metadata": {}, 49 | "source": [ 50 | "## Bar chart data" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": 15, 56 | "id": "94864052", 57 | "metadata": {}, 58 | "outputs": [], 59 | "source": [ 60 | "url = \"https://raw.githubusercontent.com/szrlee/Stock-Time-Series-Analysis/master/data/all_stocks_2006-01-01_to_2018-01-01.csv\"\n", 61 | "df = pd.read_csv(url)\n", 62 | "\n", 63 | "df = df.loc[df.Name == \"AAPL\", [\"Date\", \"Open\", \"Close\", \"Name\"]]\n", 64 | "df[\"Year\"] = pd.to_datetime(df.Date).dt.year\n", 65 | "df = df.query(\"Year >= 2014\").groupby(\"Year\").max().reset_index(drop=False)" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": 16, 71 | "id": "c8e35297", 72 | "metadata": {}, 73 | "outputs": [], 74 | "source": [ 75 | "df.drop(columns=[\"Date\"]).to_csv(\"data/bar_chart.csv\", index=False)" 76 | ] 77 | }, 78 | { 79 | "cell_type": "markdown", 80 | "id": "627f8150", 81 | "metadata": {}, 82 | "source": [ 83 | "## Stacked bar chart data" 84 | ] 85 | }, 86 | { 87 | "cell_type": "code", 88 | "execution_count": 17, 89 | "id": "78ef0704", 90 | "metadata": {}, 91 | "outputs": [], 92 | "source": [ 93 | "url = \"https://raw.githubusercontent.com/szrlee/Stock-Time-Series-Analysis/master/data/all_stocks_2006-01-01_to_2018-01-01.csv\"\n", 94 | "df = pd.read_csv(url)\n", 95 | "\n", 96 | "stocks_filter = [\"AAPL\", \"JPM\", \"GOOGL\", \"AMZN\", \"IBM\"]\n", 97 | "df = df[df.Name.isin(stocks_filter)]\n", 98 | "df[\"Date\"] = pd.to_datetime(df.Date)\n", 99 | "df[\"Year\"] = pd.to_datetime(df.Date).dt.year\n", 100 | "df[\"Volume\"] = df[\"Volume\"] / 1e9\n", 101 | "\n", 102 | "df = (\n", 103 | " df[[\"Year\", \"Volume\", \"Name\"]]\n", 104 | " .query(\"Year >= 2012\")\n", 105 | " .groupby([\"Year\", \"Name\"])\n", 106 | " .sum()\n", 107 | " .reset_index(drop=False)\n", 108 | ")" 109 | ] 110 | }, 111 | { 112 | "cell_type": "code", 113 | "execution_count": 20, 114 | "id": "28a81fed", 115 | "metadata": {}, 116 | "outputs": [], 117 | "source": [ 118 | "df.to_csv(\"data/stacked_bar_chart.csv\", index=False)" 119 | ] 120 | }, 121 | { 122 | "cell_type": "markdown", 123 | "id": "cce3da0d", 124 | "metadata": {}, 125 | "source": [ 126 | "## Stacked area chart data" 127 | ] 128 | }, 129 | { 130 | "cell_type": "code", 131 | "execution_count": 21, 132 | "id": "5faf1141", 133 | "metadata": {}, 134 | "outputs": [], 135 | "source": [ 136 | "url = \"https://raw.githubusercontent.com/szrlee/Stock-Time-Series-Analysis/master/data/all_stocks_2006-01-01_to_2018-01-01.csv\"\n", 137 | "df = pd.read_csv(url)\n", 138 | "\n", 139 | "stocks = [\"AAPL\", \"AMZN\", \"GOOGL\", \"IBM\", \"JPM\"]\n", 140 | "df = df.loc[df.Name.isin(stocks), [\"Date\", \"Name\", \"Volume\"]]\n", 141 | "df[\"Date\"] = pd.to_datetime(df.Date)\n", 142 | "df = df[df.Date.dt.year >= 2017]\n", 143 | "df[\"Volume Perc\"] = df[\"Volume\"] / df.groupby(\"Date\")[\"Volume\"].transform(\"sum\")" 144 | ] 145 | }, 146 | { 147 | "cell_type": "code", 148 | "execution_count": 23, 149 | "id": "a9029543", 150 | "metadata": {}, 151 | "outputs": [], 152 | "source": [ 153 | "df.to_csv(\"data/stacked_area_chart.csv\", index=False)" 154 | ] 155 | }, 156 | { 157 | "cell_type": "markdown", 158 | "id": "f8851f00", 159 | "metadata": {}, 160 | "source": [ 161 | "## Pie/Donut chart data" 162 | ] 163 | }, 164 | { 165 | "cell_type": "code", 166 | "execution_count": 24, 167 | "id": "fa79208e", 168 | "metadata": {}, 169 | "outputs": [], 170 | "source": [ 171 | "url = \"https://raw.githubusercontent.com/szrlee/Stock-Time-Series-Analysis/master/data/all_stocks_2006-01-01_to_2018-01-01.csv\"\n", 172 | "df = pd.read_csv(url)\n", 173 | "\n", 174 | "stocks_filter = [\"AAPL\", \"JPM\", \"GOOGL\", \"AMZN\", \"IBM\"]\n", 175 | "df = df.loc[df.Name.isin(stocks_filter), [\"Name\", \"Volume\"]]\n", 176 | "df = df.groupby(\"Name\").sum().reset_index()" 177 | ] 178 | }, 179 | { 180 | "cell_type": "code", 181 | "execution_count": 25, 182 | "id": "db88115f", 183 | "metadata": {}, 184 | "outputs": [], 185 | "source": [ 186 | "df.to_csv(\"data/donut_chart.csv\", index=False)" 187 | ] 188 | }, 189 | { 190 | "cell_type": "markdown", 191 | "id": "5015e807", 192 | "metadata": {}, 193 | "source": [ 194 | "## Histogram data" 195 | ] 196 | }, 197 | { 198 | "cell_type": "code", 199 | "execution_count": 32, 200 | "id": "683c2d83", 201 | "metadata": {}, 202 | "outputs": [], 203 | "source": [ 204 | "url = \"https://raw.githubusercontent.com/szrlee/Stock-Time-Series-Analysis/master/data/all_stocks_2006-01-01_to_2018-01-01.csv\"\n", 205 | "df = pd.read_csv(url)\n", 206 | "\n", 207 | "stocks_filter = [\"GOOGL\"]\n", 208 | "df = df.loc[df.Name.isin(stocks_filter), [\"Name\", \"Date\", \"Close\"]]" 209 | ] 210 | }, 211 | { 212 | "cell_type": "code", 213 | "execution_count": 33, 214 | "id": "3b5e69df", 215 | "metadata": {}, 216 | "outputs": [], 217 | "source": [ 218 | "df.to_csv(\"data/histogram.csv\", index=False)" 219 | ] 220 | }, 221 | { 222 | "cell_type": "markdown", 223 | "id": "0be5c972", 224 | "metadata": {}, 225 | "source": [ 226 | "## Scatter plot data" 227 | ] 228 | }, 229 | { 230 | "cell_type": "code", 231 | "execution_count": 36, 232 | "id": "c86072d5", 233 | "metadata": {}, 234 | "outputs": [], 235 | "source": [ 236 | "url = \"https://raw.githubusercontent.com/szrlee/Stock-Time-Series-Analysis/master/data/all_stocks_2006-01-01_to_2018-01-01.csv\"\n", 237 | "df = pd.read_csv(url)\n", 238 | "\n", 239 | "stocks_filter = [\"GOOGL\", \"AMZN\"]\n", 240 | "df = df.loc[\n", 241 | " (df.Name.isin(stocks_filter)) & (pd.to_datetime(df.Date).dt.year >= 2017),\n", 242 | " [\"Date\", \"Name\", \"Open\", \"Close\"],\n", 243 | "]\n", 244 | "df[\"Return\"] = (df[\"Close\"] - df[\"Open\"]) / df[\"Open\"]" 245 | ] 246 | }, 247 | { 248 | "cell_type": "code", 249 | "execution_count": 39, 250 | "id": "090e1f17", 251 | "metadata": {}, 252 | "outputs": [], 253 | "source": [ 254 | "df.to_csv(\"data/scatter_plot.csv\", index=False)" 255 | ] 256 | }, 257 | { 258 | "cell_type": "code", 259 | "execution_count": null, 260 | "id": "d10ca46f", 261 | "metadata": {}, 262 | "outputs": [], 263 | "source": [ 264 | "[object HTMLDivElement]Python Script Area99123456789101112131415›import matplotlib.ticker as mtickerfig, ax = plt.subplots(figsize=(6, 6))df_wide = df.pivot(index=\"Date\", columns=\"Name\", values=\"Return\")ax = df_wide.plot.scatter( x=\"GOOGL\", y=\"AMZN\", title=\"Daily returns - GOOGL vs. AMZN\", ax=ax)ax.yaxis.set_major_formatter(mticker.PercentFormatter(1))ax.xaxis.set_major_formatter(mticker.PercentFormatter(1))figPython Script Run Button" 265 | ] 266 | }, 267 | { 268 | "cell_type": "markdown", 269 | "id": "6fd65b39", 270 | "metadata": {}, 271 | "source": [ 272 | "## Box plot data" 273 | ] 274 | }, 275 | { 276 | "cell_type": "code", 277 | "execution_count": 41, 278 | "id": "6f3c13a0", 279 | "metadata": {}, 280 | "outputs": [], 281 | "source": [ 282 | "url = \"https://raw.githubusercontent.com/szrlee/Stock-Time-Series-Analysis/master/data/all_stocks_2006-01-01_to_2018-01-01.csv\"\n", 283 | "df = pd.read_csv(url)\n", 284 | "\n", 285 | "stocks = [\"AMZN\", \"GOOGL\", \"IBM\", \"JPM\"]\n", 286 | "df = df.loc[\n", 287 | " (df.Name.isin(stocks)) & (pd.to_datetime(df.Date).dt.year == 2016),\n", 288 | " [\"Date\", \"Name\", \"Close\", \"Open\"],\n", 289 | "]\n", 290 | "df[\"Return\"] = (df[\"Close\"] - df[\"Open\"]) / df[\"Open\"]\n", 291 | "df[\"Date\"] = pd.to_datetime(df.Date)" 292 | ] 293 | }, 294 | { 295 | "cell_type": "code", 296 | "execution_count": 42, 297 | "id": "76b76c57", 298 | "metadata": {}, 299 | "outputs": [], 300 | "source": [ 301 | "df.to_csv(\"data/box_plot.csv\", index=False)" 302 | ] 303 | } 304 | ], 305 | "metadata": { 306 | "kernelspec": { 307 | "display_name": "Python 3 (ipykernel)", 308 | "language": "python", 309 | "name": "python3" 310 | }, 311 | "language_info": { 312 | "codemirror_mode": { 313 | "name": "ipython", 314 | "version": 3 315 | }, 316 | "file_extension": ".py", 317 | "mimetype": "text/x-python", 318 | "name": "python", 319 | "nbconvert_exporter": "python", 320 | "pygments_lexer": "ipython3", 321 | "version": "3.10.5" 322 | } 323 | }, 324 | "nbformat": 4, 325 | "nbformat_minor": 5 326 | } 327 | -------------------------------------------------------------------------------- /assets/built/style.css: -------------------------------------------------------------------------------- 1 | /*! tailwindcss v3.1.8 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.top-3{top:.75rem}.right-2\.5{right:.625rem}.right-2{right:.5rem}.z-50{z-index:50}.z-40{z-index:40}.order-2{order:2}.order-1{order:1}.float-right{float:right}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.mr-1{margin-right:.25rem}.ml-auto{margin-left:auto}.mb-4{margin-bottom:1rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-5{height:1.25rem}.max-h-\[500px\]{max-height:500px}.min-h-screen{min-height:100vh}.w-\[400px\]{width:400px}.w-full{width:100%}.w-5{width:1.25rem}.w-auto{width:auto}.max-w-2xl{max-width:42rem}.flex-auto{flex:1 1 auto}.shrink{flex-shrink:1}.scale-90{--tw-scale-x:.9;--tw-scale-y:.9}.scale-100,.scale-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.rounded-lg{border-radius:.5rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.rounded-b-xl{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.border{border-width:1px}.border-0{border-width:0}.border-x{border-left-width:1px;border-right-width:1px}.border-stone-300{--tw-border-opacity:1;border-color:rgb(214 211 209/var(--tw-border-opacity))}.border-stone-200{--tw-border-opacity:1;border-color:rgb(231 229 228/var(--tw-border-opacity))}.bg-rose-50{--tw-bg-opacity:1;background-color:rgb(255 241 242/var(--tw-bg-opacity))}.bg-stone-50{--tw-bg-opacity:1;background-color:rgb(250 250 249/var(--tw-bg-opacity))}.bg-rose-100{--tw-bg-opacity:1;background-color:rgb(255 228 230/var(--tw-bg-opacity))}.bg-rose-500{--tw-bg-opacity:1;background-color:rgb(244 63 94/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-stone-800{--tw-bg-opacity:1;background-color:rgb(41 37 36/var(--tw-bg-opacity))}.bg-rose-600{--tw-bg-opacity:1;background-color:rgb(225 29 72/var(--tw-bg-opacity))}.bg-transparent{background-color:initial}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-rose-400{--tw-bg-opacity:1;background-color:rgb(251 113 133/var(--tw-bg-opacity))}.bg-opacity-75{--tw-bg-opacity:0.75}.p-2\.5{padding:.625rem}.p-2{padding:.5rem}.p-1{padding:.25rem}.p-4{padding:1rem}.p-10{padding:2.5rem}.p-1\.5{padding:.375rem}.p-6{padding:1.5rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.px-0{padding-left:0;padding-right:0}.px-4{padding-left:1rem;padding-right:1rem}.pt-6{padding-top:1.5rem}.pb-6{padding-bottom:1.5rem}.pt-2{padding-top:.5rem}.pr-0{padding-right:0}.pb-2{padding-bottom:.5rem}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-6xl{font-size:3.75rem;line-height:1}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-relaxed{line-height:1.625}.text-bgray-800{--tw-text-opacity:1;color:rgb(30 41 59/var(--tw-text-opacity))}.text-stone-900{--tw-text-opacity:1;color:rgb(28 25 23/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-stone-400{--tw-text-opacity:1;color:rgb(168 162 158/var(--tw-text-opacity))}.text-stone-200{--tw-text-opacity:1;color:rgb(231 229 228/var(--tw-text-opacity))}.text-stone-300{--tw-text-opacity:1;color:rgb(214 211 209/var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.opacity-25{opacity:.25}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.transition{transition-property:color,background-color,border-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-text-decoration-color,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}details>summary{list-style:none}details>summary::-webkit-details-marker,details>summary::marker{display:none}#initial>div,#output>div{position:relative;overflow:auto}#initial div,#output div{margin-top:-5px;white-space:pre-wrap}#initial div div,#output div div{margin-top:-5px;white-space:normal}table.dataframe{width:100%;font-size:.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}table.dataframe thead{--tw-bg-opacity:1;background-color:rgb(41 37 36/var(--tw-bg-opacity));--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}table.dataframe thead tr th{text-align:center}table.dataframe thead tr th:first-child{--tw-bg-opacity:1;background-color:rgb(120 113 108/var(--tw-bg-opacity))}table.dataframe tbody tr th:first-child{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(226 232 240/var(--tw-border-opacity));--tw-bg-opacity:1;background-color:rgb(214 211 209/var(--tw-bg-opacity))}table.dataframe thead th{padding:.5rem 1rem}table.dataframe tbody tr{border-bottom-width:1px;--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));text-align:center}table.dataframe tbody th{padding:.5rem 1rem}.hover\:border-stone-300:hover{--tw-border-opacity:1;border-color:rgb(214 211 209/var(--tw-border-opacity))}.hover\:bg-rose-400:hover{--tw-bg-opacity:1;background-color:rgb(251 113 133/var(--tw-bg-opacity))}.hover\:bg-stone-200:hover{--tw-bg-opacity:1;background-color:rgb(231 229 228/var(--tw-bg-opacity))}.hover\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.hover\:text-stone-200:hover{--tw-text-opacity:1;color:rgb(231 229 228/var(--tw-text-opacity))}.hover\:text-stone-300:hover{--tw-text-opacity:1;color:rgb(214 211 209/var(--tw-text-opacity))}.hover\:text-blue-500:hover{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.hover\:text-gray-900:hover{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.hover\:opacity-75:hover{opacity:.75}.focus\:border-rose-500:focus{--tw-border-opacity:1;border-color:rgb(244 63 94/var(--tw-border-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-rose-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(244 63 94/var(--tw-ring-opacity))}.group:hover .group-hover\:opacity-100{opacity:1}@media (min-width:768px){.md\:order-1{order:1}.md\:order-2{order:2}.md\:w-\[600px\]{width:600px}.md\:px-10{padding-left:2.5rem;padding-right:2.5rem}} -------------------------------------------------------------------------------- /assets/built/pyscript.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import base64 3 | import io 4 | import sys 5 | import time 6 | from textwrap import dedent 7 | 8 | import micropip # noqa: F401 9 | from js import console, document 10 | 11 | loop = asyncio.get_event_loop() 12 | 13 | MIME_METHODS = { 14 | "__repr__": "text/plain", 15 | "_repr_html_": "text/html", 16 | "_repr_markdown_": "text/markdown", 17 | "_repr_svg_": "image/svg+xml", 18 | "_repr_png_": "image/png", 19 | "_repr_pdf_": "application/pdf", 20 | "_repr_jpeg_": "image/jpeg", 21 | "_repr_latex": "text/latex", 22 | "_repr_json_": "application/json", 23 | "_repr_javascript_": "application/javascript", 24 | "savefig": "image/png", 25 | } 26 | 27 | 28 | def render_image(mime, value, meta): 29 | data = f"data:{mime};charset=utf-8;base64,{value}" 30 | attrs = " ".join(['{k}="{v}"' for k, v in meta.items()]) 31 | return f'' 32 | 33 | 34 | def identity(value, meta): 35 | return value 36 | 37 | 38 | MIME_RENDERERS = { 39 | "text/plain": identity, 40 | "text/html": identity, 41 | "image/png": lambda value, meta: render_image("image/png", value, meta), 42 | "image/jpeg": lambda value, meta: render_image("image/jpeg", value, meta), 43 | "image/svg+xml": identity, 44 | "application/json": identity, 45 | "application/javascript": lambda value, meta: f"", 46 | } 47 | 48 | 49 | def eval_formatter(obj, print_method): 50 | """ 51 | Evaluates a formatter method. 52 | """ 53 | if print_method == "__repr__": 54 | return repr(obj) 55 | elif hasattr(obj, print_method): 56 | if print_method == "savefig": 57 | buf = io.BytesIO() 58 | obj.savefig(buf, format="png") 59 | buf.seek(0) 60 | return base64.b64encode(buf.read()).decode("utf-8") 61 | return getattr(obj, print_method)() 62 | elif print_method == "_repr_mimebundle_": 63 | return {}, {} 64 | return None 65 | 66 | 67 | def format_mime(obj): 68 | """ 69 | Formats object using _repr_x_ methods. 70 | """ 71 | if isinstance(obj, str): 72 | return obj, "text/plain" 73 | 74 | mimebundle = eval_formatter(obj, "_repr_mimebundle_") 75 | if isinstance(mimebundle, tuple): 76 | format_dict, _ = mimebundle 77 | else: 78 | format_dict = mimebundle 79 | 80 | output, not_available = None, [] 81 | for method, mime_type in reversed(MIME_METHODS.items()): 82 | if mime_type in format_dict: 83 | output = format_dict[mime_type] 84 | else: 85 | output = eval_formatter(obj, method) 86 | 87 | if output is None: 88 | continue 89 | elif mime_type not in MIME_RENDERERS: 90 | not_available.append(mime_type) 91 | continue 92 | break 93 | if output is None: 94 | if not_available: 95 | console.warning( 96 | f"Rendered object requested unavailable MIME renderers: {not_available}" 97 | ) 98 | output = repr(output) 99 | mime_type = "text/plain" 100 | elif isinstance(output, tuple): 101 | output, meta = output 102 | else: 103 | meta = {} 104 | return MIME_RENDERERS[mime_type](output, meta), mime_type 105 | 106 | 107 | class PyScript: 108 | loop = loop 109 | 110 | @staticmethod 111 | def write(element_id, value, append=False, exec_id=0): 112 | """Writes value to the element with id "element_id""" 113 | console.log(f"APPENDING: {append} ==> {element_id} --> {value}") 114 | if append: 115 | child = document.createElement("div") 116 | element = document.querySelector(f"#{element_id}") 117 | if not element: 118 | return 119 | exec_id = exec_id or element.childElementCount + 1 120 | element_id = child.id = f"{element_id}-{exec_id}" 121 | element.appendChild(child) 122 | 123 | element = document.getElementById(element_id) 124 | html, mime_type = format_mime(value) 125 | if mime_type in ("application/javascript", "text/html"): 126 | script_element = document.createRange().createContextualFragment(html) 127 | element.appendChild(script_element) 128 | else: 129 | element.innerHTML = html 130 | 131 | @staticmethod 132 | def run_until_complete(f): 133 | _ = loop.run_until_complete(f) 134 | 135 | 136 | class Element: 137 | def __init__(self, element_id, element=None): 138 | self._id = element_id 139 | self._element = element 140 | 141 | @property 142 | def id(self): 143 | return self._id 144 | 145 | @property 146 | def element(self): 147 | """Return the dom element""" 148 | if not self._element: 149 | self._element = document.querySelector(f"#{self._id}") 150 | return self._element 151 | 152 | @property 153 | def value(self): 154 | return self.element.value 155 | 156 | @property 157 | def innerHtml(self): 158 | return self.element.innerHtml 159 | 160 | def write(self, value, append=False): 161 | console.log(f"Element.write: {value} --> {append}") 162 | # TODO: it should be the opposite... pyscript.write should use the Element.write 163 | # so we can consolidate on how we write depending on the element type 164 | pyscript.write(self._id, value, append=append) 165 | 166 | def clear(self): 167 | if hasattr(self.element, "value"): 168 | self.element.value = "" 169 | else: 170 | self.write("", append=False) 171 | 172 | def select(self, query, from_content=False): 173 | el = self.element 174 | if from_content: 175 | el = el.content 176 | 177 | _el = el.querySelector(query) 178 | if _el: 179 | return Element(_el.id, _el) 180 | else: 181 | console.log(f"WARNING: can't find element matching query {query}") 182 | 183 | def clone(self, new_id=None, to=None): 184 | if new_id is None: 185 | new_id = self.element.id 186 | 187 | clone = self.element.cloneNode(True) 188 | clone.id = new_id 189 | 190 | if to: 191 | to.element.appendChild(clone) 192 | 193 | # Inject it into the DOM 194 | self.element.after(clone) 195 | 196 | return Element(clone.id, clone) 197 | 198 | def remove_class(self, classname): 199 | if isinstance(classname, list): 200 | for cl in classname: 201 | self.remove_class(cl) 202 | else: 203 | self.element.classList.remove(classname) 204 | 205 | def add_class(self, classname): 206 | self.element.classList.add(classname) 207 | 208 | 209 | def add_classes(element, class_list): 210 | for klass in class_list.split(" "): 211 | element.classList.add(klass) 212 | 213 | 214 | def create(what, id_=None, classes=""): 215 | element = document.createElement(what) 216 | if id_: 217 | element.id = id_ 218 | add_classes(element, classes) 219 | return Element(id_, element) 220 | 221 | 222 | class PyWidgetTheme: 223 | def __init__(self, main_style_classes): 224 | self.main_style_classes = main_style_classes 225 | 226 | def theme_it(self, widget): 227 | for klass in self.main_style_classes.split(" "): 228 | widget.classList.add(klass) 229 | 230 | 231 | class PyItemTemplate(Element): 232 | label_fields = None 233 | 234 | def __init__(self, data, labels=None, state_key=None, parent=None): 235 | self.data = data 236 | 237 | self.register_parent(parent) 238 | 239 | if not labels: 240 | labels = list(self.data.keys()) 241 | self.labels = labels 242 | 243 | self.state_key = state_key 244 | 245 | super().__init__(self._id) 246 | 247 | def register_parent(self, parent): 248 | self._parent = parent 249 | if parent: 250 | self._id = f"{self._parent._id}-c-{len(self._parent._children)}" 251 | self.data["id"] = self._id 252 | else: 253 | self._id = None 254 | 255 | def create(self): 256 | console.log("creating section") 257 | new_child = create("section", self._id, "task bg-white my-1") 258 | console.log("creating values") 259 | 260 | console.log("creating innerHtml") 261 | new_child._element.innerHTML = dedent( 262 | f""" 263 | 267 | """ 268 | ) 269 | 270 | console.log("returning") 271 | return new_child 272 | 273 | def on_click(self, evt): 274 | pass 275 | 276 | def pre_append(self): 277 | pass 278 | 279 | def post_append(self): 280 | self.element.click = self.on_click 281 | self.element.onclick = self.on_click 282 | 283 | self._post_append() 284 | 285 | def _post_append(self): 286 | pass 287 | 288 | def strike(self, value, extra=None): 289 | if value: 290 | self.add_class("line-through") 291 | else: 292 | self.remove_class("line-through") 293 | 294 | def render_content(self): 295 | return " - ".join([self.data[f] for f in self.labels]) 296 | 297 | 298 | class PyListTemplate: 299 | theme = PyWidgetTheme("flex flex-col-reverse mt-8 mx-8") 300 | item_class = PyItemTemplate 301 | 302 | def __init__(self, parent): 303 | self.parent = parent 304 | self._children = [] 305 | self._id = self.parent.id 306 | 307 | @property 308 | def children(self): 309 | return self._children 310 | 311 | @property 312 | def data(self): 313 | return [c.data for c in self._children] 314 | 315 | def render_children(self): 316 | binds = {} 317 | for i, c in enumerate(self._children): 318 | txt = c.element.innerHTML 319 | rnd = str(time.time()).replace(".", "")[-5:] 320 | new_id = f"{c.element.id}-{i}-{rnd}" 321 | binds[new_id] = c.element.id 322 | txt = txt.replace(">", f" id='{new_id}'>") 323 | print(txt) 324 | 325 | def foo(evt): 326 | console.log(evt) 327 | evtEl = evt.srcElement 328 | srcEl = Element(binds[evtEl.id]) 329 | srcEl.element.onclick() 330 | evtEl.classList = srcEl.element.classList 331 | 332 | for new_id in binds: 333 | Element(new_id).element.onclick = foo 334 | 335 | def connect(self): 336 | self.md = main_div = document.createElement("div") 337 | main_div.id = self._id + "-list-tasks-container" 338 | 339 | if self.theme: 340 | self.theme.theme_it(main_div) 341 | 342 | self.parent.appendChild(main_div) 343 | 344 | def add(self, *args, **kws): 345 | if not isinstance(args[0], self.item_class): 346 | child = self.item_class(*args, **kws) 347 | else: 348 | child = args[0] 349 | child.register_parent(self) 350 | return self._add(child) 351 | 352 | def _add(self, child_elem): 353 | console.log("appending child", child_elem.element) 354 | self.pre_child_append(child_elem) 355 | child_elem.pre_append() 356 | self._children.append(child_elem) 357 | self.md.appendChild(child_elem.create().element) 358 | child_elem.post_append() 359 | self.child_appended(child_elem) 360 | return child_elem 361 | 362 | def pre_child_append(self, child): 363 | pass 364 | 365 | def child_appended(self, child): 366 | """Overwrite me to define logic""" 367 | pass 368 | 369 | 370 | class OutputCtxManager: 371 | def __init__(self, out=None, output_to_console=True, append=True): 372 | self._out = out 373 | self._prev = out 374 | self.output_to_console = output_to_console 375 | self._append = append 376 | 377 | def change(self, out=None, err=None, output_to_console=True, append=True): 378 | self._prev = self._out 379 | self._out = out 380 | self.output_to_console = output_to_console 381 | self._append = append 382 | console.log("----> changed out to", self._out, self._append) 383 | 384 | def revert(self): 385 | console.log("----> reverted") 386 | self._out = self._prev 387 | 388 | def write(self, txt): 389 | console.log("writing to", self._out, txt, self._append) 390 | if self._out: 391 | pyscript.write(self._out, txt, append=self._append) 392 | if self.output_to_console: 393 | console.log(self._out, txt) 394 | 395 | 396 | class OutputManager: 397 | def __init__(self, out=None, err=None, output_to_console=True, append=True): 398 | sys.stdout = self._out_manager = OutputCtxManager( 399 | out, output_to_console, append 400 | ) 401 | sys.stderr = self._err_manager = OutputCtxManager( 402 | err, output_to_console, append 403 | ) 404 | self.output_to_console = output_to_console 405 | self._append = append 406 | 407 | def change(self, out=None, err=None, output_to_console=True, append=True): 408 | self._out_manager.change(out, output_to_console, append) 409 | sys.stdout = self._out_manager 410 | self._err_manager.change(err, output_to_console, append) 411 | sys.stderr = self._err_manager 412 | self.output_to_console = output_to_console 413 | self.append = append 414 | 415 | def revert(self): 416 | self._out_manager.revert() 417 | self._err_manager.revert() 418 | sys.stdout = self._out_manager 419 | sys.stderr = self._err_manager 420 | console.log("----> reverted") 421 | 422 | 423 | pyscript = PyScript() 424 | output_manager = OutputManager() 425 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Python Data Vizualization Cookbok 7 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | - matplotlib 39 | - numpy 40 | - pandas 41 | - seaborn 42 | - plotly 43 | 44 | 45 | 46 | 47 |

👨‍🍳 📙 📊

48 |

Python Data Viz Cookbook

49 |
50 |
51 | 67 |
68 |
69 |
77 | 92 |
93 |
94 |
95 | 118 | 119 | 120 |
121 |
122 |
124 |
125 | REPL 126 |
127 | 128 |
129 | 131 |
132 |
133 |
134 | df.head() 135 |
136 |
137 |
138 |
139 | Output 140 |
141 | 168 |
169 |
171 |
172 |
174 |
175 |
176 |
177 |
178 | 188 | 250 | 251 | 252 |
253 |
255 |
262 |
263 | 264 |
265 |
266 |
267 |
268 | 269 | 270 | 271 | 272 | 273 | -------------------------------------------------------------------------------- /assets/js/chart_code.js: -------------------------------------------------------------------------------- 1 | const line_chart = { 2 | "Pandas": ` 3 | import matplotlib.dates as mdates 4 | 5 | fig, ax = plt.subplots(figsize=(6, 4)) 6 | 7 | df_wide = df.pivot( 8 | index="Date", 9 | columns="Name", 10 | values="Close" 11 | ) # Pandas requires variables in columns to plot them 12 | 13 | df_wide.plot( 14 | title="Stock prices (2015 - 2017)", 15 | ylabel="Closing Price", 16 | ax=ax, 17 | ) 18 | ax.xaxis.set_major_formatter( 19 | mdates.DateFormatter("%b-%y") 20 | ) 21 | fig # Not necessary if using a notebook 22 | `, 23 | "Matplotlib": ` 24 | import matplotlib.dates as mdates 25 | 26 | fig, ax = plt.subplots(figsize=(6, 4)) 27 | 28 | for l, g in df.groupby("Name"): 29 | ax.plot(g["Date"], g["Close"], label=l) 30 | 31 | ax.xaxis.set_major_formatter( 32 | mdates.DateFormatter("%b-%y") 33 | ) 34 | ax.tick_params(axis='x', rotation=30) 35 | 36 | ax.set_title("Stock prices (2015 - 2017)") 37 | ax.set_ylabel("Close") 38 | ax.set_xlabel("Date") 39 | ax.legend(title="Name") 40 | 41 | fig # Not necessary if using a notebook 42 | `, 43 | "Seaborn": ` 44 | import matplotlib.dates as mdates 45 | 46 | fig, ax = plt.subplots(figsize=(6, 4)) 47 | sns.lineplot( 48 | data=df, 49 | x="Date", 50 | y="Close", 51 | hue="Name", 52 | ax=ax 53 | ) 54 | ax.xaxis.set_major_formatter( 55 | mdates.DateFormatter("%b-%y") 56 | ) 57 | ax.tick_params(axis='x', rotation=30) 58 | ax.set_title("Stock Prices (2015 - 2017)") 59 | fig # Not necessary if using a notebook 60 | `, 61 | "Plotly Express": ` 62 | fig = px.line( 63 | df, 64 | x="Date", 65 | y="Close", 66 | color="Name", 67 | title="Stock Prices (2015 - 2017)" 68 | ) 69 | fig.update_yaxes(tickprefix="$") 70 | plot(fig) # Replace this line by fig.show() to use in a notebook 71 | ` 72 | } 73 | 74 | const bar_chart = { 75 | "Pandas": ` 76 | import matplotlib.ticker as mticker 77 | 78 | fig, ax = plt.subplots(figsize=(6, 4)) 79 | 80 | df.plot.bar( 81 | x="Year", 82 | y="Open", 83 | rot=0, 84 | ylabel="Opening price", 85 | title="Maximum opening price per year - AAPL", 86 | legend=None, 87 | ax=ax 88 | ) 89 | ax.yaxis.set_major_formatter( 90 | mticker.StrMethodFormatter("$\{x:1.0f\}") 91 | ) 92 | fig # Not necessary if using a notebook 93 | `, 94 | "Matplotlib": ` 95 | import matplotlib.ticker as mticker 96 | 97 | fig, ax = plt.subplots(figsize=(6, 4)) 98 | 99 | x = np.arange(len(df.Year)) 100 | width = 0.5 101 | 102 | ax.bar(x, df.Open, width, label="Open") 103 | 104 | ax.set_xlabel("Year") 105 | ax.set_ylabel("Opening price") 106 | ax.set_title("Maximum opening price per year - AAPL") 107 | 108 | ax.set_xticks(x) 109 | ax.set_xticklabels(df.Year) 110 | 111 | ax.yaxis.set_major_formatter( 112 | mticker.StrMethodFormatter("$\{x:1.0f\}") 113 | ) 114 | fig # Not necessary if using a notebook 115 | `, 116 | "Seaborn": ` 117 | import matplotlib.ticker as mticker 118 | 119 | fig, ax = plt.subplots(figsize=(6, 4)) 120 | 121 | sns.barplot( 122 | data=df, 123 | x="Year", 124 | y="Open", 125 | color="blue", 126 | ax=ax 127 | ) 128 | 129 | ax.yaxis.set_major_formatter( 130 | mticker.StrMethodFormatter("$\{x:1.0f\}") 131 | ) 132 | 133 | ax.set_title("Maximum opening price per year - AAPL") 134 | fig # Not necessary if using a notebook 135 | `, 136 | "Plotly Express": ` 137 | fig = px.bar( 138 | df, 139 | x="Year", 140 | y="Open", 141 | title="Max opening price per year - AAPL", 142 | labels={"value": "Opening price"}, 143 | ) 144 | fig.update_yaxes(tickprefix="$") 145 | plot(fig) # Replace this line by fig.show() to use in a notebook 146 | ` 147 | } 148 | 149 | const grouped_bar_chart = { 150 | "Pandas": ` 151 | import matplotlib.ticker as mticker 152 | 153 | fig, ax = plt.subplots(figsize=(6, 4)) 154 | 155 | df.plot.bar( 156 | x="Year", 157 | y=["Open", "Close"], 158 | rot=0, 159 | ylabel="Price", 160 | title="Maximum opening and closing price per year - AAPL", 161 | ax=ax 162 | ) 163 | ax.yaxis.set_major_formatter( 164 | mticker.StrMethodFormatter("$\{x:1.0f\}") 165 | ) 166 | fig # Not necessary if using a notebook 167 | `, 168 | "Matplotlib": ` 169 | import matplotlib.ticker as mticker 170 | 171 | fig, ax = plt.subplots(figsize=(6, 4)) 172 | 173 | x = np.arange(len(df.Year)) 174 | width = 0.25 175 | 176 | ax.bar(x - width / 2, df.Open, width, label="Open") 177 | ax.bar(x + width / 2, df.Close, width, label="Close") 178 | 179 | ax.set_xlabel("Year") 180 | ax.set_ylabel("Price") 181 | ax.set_title("Maximum opening and closing price per year - AAPL") 182 | 183 | ax.set_xticks(x) 184 | ax.set_xticklabels(df.Year) 185 | 186 | ax.yaxis.set_major_formatter( 187 | mticker.StrMethodFormatter("$\{x:1.0f\}") 188 | ) 189 | ax.legend() 190 | fig # Not necessary if using a notebook 191 | `, 192 | "Seaborn": ` 193 | import matplotlib.ticker as mticker 194 | 195 | df_long = df.melt( 196 | id_vars="Year", 197 | value_vars=["Open", "Close"], 198 | var_name="Category", 199 | value_name="Price", 200 | ) # Seaborn works better with long data 201 | 202 | fig, ax = plt.subplots(figsize=(6, 4)) 203 | sns.barplot(data=df_long, x="Year", y="Price", hue="Category", ax=ax) 204 | 205 | ax.yaxis.set_major_formatter( 206 | mticker.StrMethodFormatter("$\{x:1.0f\}") 207 | ) 208 | 209 | ax.set_title("Maximum opening and closing price per year - AAPL") 210 | ax.legend(title=None) 211 | fig # Not necessary if using a notebook 212 | `, 213 | "Plotly Express": ` 214 | fig = px.bar( 215 | df, 216 | x="Year", 217 | y=["Open", "Close"], 218 | barmode="group", 219 | title="Max opening and closing price per year - AAPL", 220 | labels={"value": "Price"}, 221 | ) 222 | fig.update_yaxes(tickprefix="$") 223 | plot(fig) # Replace this line by fig.show() to use in a notebook 224 | ` 225 | } 226 | 227 | const stacked_bar_chart = { 228 | "Pandas": ` 229 | fig, ax = plt.subplots(figsize=(6, 4)) 230 | df_wide = df.pivot( 231 | index="Year", columns="Name", values="Volume" 232 | ) # Pandas works better with wide data 233 | df_wide.plot.bar( 234 | ylabel="Volume (billions of shares)", 235 | title="Trading volume per year for selected shares", 236 | stacked=True, 237 | ax=ax, 238 | rot=0 239 | ) 240 | fig # Not necessary if using a notebook 241 | `, 242 | "Matplotlib": ` 243 | fig, ax = plt.subplots(figsize=(6, 4)) 244 | 245 | bottom = np.zeros(df.Year.nunique()) 246 | for i, g in df.groupby("Name"): 247 | ax.bar( 248 | g["Year"], 249 | g["Volume"], 250 | bottom=bottom, 251 | label=i, 252 | width=0.5 253 | ) 254 | bottom += g["Volume"].values 255 | 256 | ax.set_title("Trading volume per year for selected shares") 257 | ax.set_ylabel("Volume (billions of shares)") 258 | ax.set_xlabel("Year") 259 | 260 | ax.legend() 261 | 262 | fig # Not necessary if using a notebook 263 | `, 264 | "Seaborn": ` 265 | fig, ax = plt.subplots(figsize=(6, 4)) 266 | 267 | ax = sns.histplot( 268 | data=df, 269 | x="Year", 270 | hue="Name", 271 | weights="Volume", 272 | multiple="stack", 273 | shrink=0.5, 274 | discrete=True, 275 | hue_order=df.groupby("Name").Volume.sum().sort_values().index, 276 | ) 277 | 278 | ax.set_title("Trading volume per year for selected shares") 279 | ax.set_ylabel("Volume (billions of shares)") 280 | 281 | legend = ax.get_legend() 282 | legend.set_bbox_to_anchor((1, 1)) 283 | fig # Not necessary if using a notebook 284 | `, 285 | "Plotly Express": ` 286 | fig = px.bar( 287 | df, 288 | x="Year", 289 | y="Volume", 290 | color="Name", 291 | title="Trading volume per year for selected shares", 292 | barmode="stack", 293 | labels={"Volume": "Volume (billions of shares)"}, 294 | ) 295 | plot(fig) # Replace this line by fig.show() to use in a notebook 296 | ` 297 | } 298 | 299 | const stacked_area_chart = { 300 | "Pandas": ` 301 | import matplotlib.dates as mdates 302 | import matplotlib.ticker as mticker 303 | 304 | fig, ax = plt.subplots(figsize=(6, 4)) 305 | 306 | df_wide = df.pivot( 307 | index="Date", columns="Name", values="Volume Perc" 308 | ) # Pandas works better with wide data 309 | 310 | df_wide.plot.area( 311 | rot=0, 312 | title="Distribution of daily trading volume - 2017", 313 | stacked=True, 314 | ax=ax 315 | ) 316 | 317 | ax.tick_params(axis="x", rotation=30) 318 | ax.yaxis.set_major_formatter(mticker.PercentFormatter(1)) 319 | ax.xaxis.set_major_formatter(mdates.DateFormatter("%b-%y")) 320 | 321 | fig # Not necessary if using a notebook 322 | `, 323 | "Matplotlib": ` 324 | import matplotlib.dates as mdates 325 | import matplotlib.ticker as mticker 326 | 327 | df_wide = df.pivot( 328 | index="Date", columns="Name", values="Volume Perc" 329 | ) 330 | 331 | fig, ax = plt.subplots(figsize=(6, 4)) 332 | 333 | ax.stackplot( 334 | df_wide.index, 335 | [df_wide[col].values for col in sorted(df.Name.unique())], 336 | labels=sorted(df.Name.unique()) 337 | ) 338 | 339 | ax.set_title("Distribution of daily trading volume - 2017") 340 | 341 | ax.tick_params(axis="x", rotation=30) 342 | ax.yaxis.set_major_formatter(mticker.PercentFormatter(1)) 343 | ax.xaxis.set_major_formatter(mdates.DateFormatter("%b-%y")) 344 | 345 | fig # Not necessary if using a notebook 346 | `, 347 | "Seaborn": `# Seaborn does not support stacked area charts`, 348 | "Plotly Express": ` 349 | # Plotly express 350 | fig = px.area( 351 | df, 352 | x="Date", 353 | y="Volume Perc", 354 | color="Name", 355 | title="Distribution of daily trading volume - 2017", 356 | ) 357 | fig.update_layout(yaxis_tickformat=".0%") 358 | plot(fig) # Replace this line by fig.show() to use in a notebook 359 | ` 360 | } 361 | 362 | const donut_chart = { 363 | "Pandas": ` 364 | fig, ax = plt.subplots(figsize=(6, 6)) 365 | df.set_index("Name").plot.pie( 366 | y="Volume", 367 | wedgeprops=dict(width=0.5), 368 | autopct="%1.0f%%", 369 | pctdistance=0.75, 370 | title="Distribution of total trading volume for selected stocks (2006 - 2017)", 371 | ax=ax 372 | ) 373 | fig # Not necessary if using a notebook 374 | `, 375 | "Matplotlib": ` 376 | fig, ax = plt.subplots(figsize=(6, 6)) 377 | 378 | ax.pie( 379 | df.Volume, 380 | labels=df.Name, 381 | wedgeprops=dict(width=0.5), 382 | autopct="%1.0f%%", 383 | pctdistance=0.75, 384 | ) 385 | ax.set_title("Distribution of total trading volume for selected stocks (2006 - 2017)") 386 | ax.legend() 387 | fig`, 388 | "Seaborn": `# Seaborn does not support donut charts`, 389 | "Plotly Express": ` 390 | fig = px.pie( 391 | data_frame=df, 392 | values="Volume", 393 | names="Name", 394 | hole=0.5, 395 | color="Name", 396 | title="Distribution of trading volume for selected stocks (2006 - 2017)", 397 | ) 398 | plot(fig) # Replace this line by fig.show() to use in a notebook 399 | ` 400 | } 401 | 402 | const pie_chart = { 403 | "Pandas": ` 404 | fig, ax = plt.subplots(figsize=(6, 6)) 405 | df.set_index("Name").plot.pie( 406 | y="Volume", 407 | autopct="%1.0f%%", 408 | pctdistance=0.75, 409 | title="Distribution of total trading volume for selected stocks (2006 - 2017)", 410 | ax=ax 411 | ) 412 | fig 413 | `, 414 | "Matplotlib": ` 415 | fig, ax = plt.subplots(figsize=(6, 6)) 416 | 417 | ax.pie( 418 | df.Volume, 419 | labels=df.Name, 420 | autopct="%1.0f%%", 421 | pctdistance=0.75, 422 | ) 423 | ax.set_title("Distribution of total trading volume for selected stocks (2006 - 2017)") 424 | ax.legend() 425 | fig`, 426 | "Seaborn": `# Seaborn does not support pie charts`, 427 | "Plotly Express": ` 428 | fig = px.pie( 429 | data_frame=df, 430 | values="Volume", 431 | names="Name", 432 | color="Name", 433 | title="Distribution of trading volume for selected stocks (2006 - 2017)", 434 | ) 435 | plot(fig) # Replace this line by fig.show() to use in a notebook 436 | ` 437 | } 438 | 439 | const histogram = { 440 | "Pandas": ` 441 | import matplotlib.ticker as mticker 442 | 443 | fig, ax = plt.subplots(figsize=(6, 4)) 444 | 445 | df.plot.hist( 446 | y="Close", 447 | legend=None, 448 | ax=ax, 449 | title="Distribution of Closing Prices - GOOGL", 450 | xlabel="Closing Price" 451 | ) 452 | ax.xaxis.set_major_formatter( 453 | mticker.StrMethodFormatter("$\{x:1.0f\}") 454 | ) 455 | 456 | fig`, 457 | "Matplotlib": ` 458 | import matplotlib.ticker as mticker 459 | 460 | fig, ax = plt.subplots(figsize=(6, 4)) 461 | 462 | ax.hist(df.Close, alpha=0.75, bins=30) 463 | 464 | ax.set_title("Distribution of Closing Prices - GOOGL") 465 | ax.set_xlabel("Closing Price") 466 | ax.xaxis.set_major_formatter( 467 | mticker.StrMethodFormatter("$\{x:1.0f\}") 468 | ) 469 | 470 | fig`, 471 | "Seaborn": ` 472 | import matplotlib.ticker as mticker 473 | 474 | fig, ax = plt.subplots(figsize=(6, 4)) 475 | 476 | sns.histplot(data=df, x="Close", hue="Name", ax=ax) 477 | 478 | ax.set_title("Distribution of Closing Prices - GOOGL") 479 | ax.set_xlabel("Closing Price") 480 | ax.xaxis.set_major_formatter( 481 | mticker.StrMethodFormatter("$\{x:1.0f\}") 482 | ) 483 | 484 | fig`, 485 | "Plotly Express": ` 486 | fig = px.histogram( 487 | df, 488 | x="Close", 489 | labels={"Close": "Closing Price"}, 490 | title="Distribution of Closing Prices - GOOGL", 491 | nbins=30 492 | ) 493 | plot(fig) # Replace this line by fig.show() to use in a notebook 494 | ` 495 | } 496 | 497 | const scatter_plot = { 498 | "Pandas": ` 499 | import matplotlib.ticker as mticker 500 | 501 | fig, ax = plt.subplots(figsize=(6, 6)) 502 | df_wide = df.pivot(index="Date", columns="Name", values="Return") 503 | 504 | ax = df_wide.plot.scatter( 505 | x="GOOGL", 506 | y="AMZN", 507 | title="Daily returns - GOOGL vs. AMZN", 508 | ax=ax 509 | ) 510 | 511 | ax.yaxis.set_major_formatter(mticker.PercentFormatter(1)) 512 | ax.xaxis.set_major_formatter(mticker.PercentFormatter(1)) 513 | fig`, 514 | "Matplotlib": ` 515 | import matplotlib.ticker as mticker 516 | 517 | df_wide = df.pivot( 518 | index="Date", columns="Name", values="Return" 519 | ) 520 | 521 | fig, ax = plt.subplots(figsize=(6, 6)) 522 | 523 | ax.scatter(x=df_wide["GOOGL"], y=df_wide["AMZN"]) 524 | 525 | ax.set_xlabel("GOOGL") 526 | ax.set_ylabel("AMZN") 527 | ax.set_title("Daily returns - GOOGL vs. AMZN") 528 | 529 | ax.yaxis.set_major_formatter(mticker.PercentFormatter(1)) 530 | ax.xaxis.set_major_formatter(mticker.PercentFormatter(1)) 531 | fig`, 532 | "Seaborn": ` 533 | import matplotlib.ticker as mticker 534 | 535 | fig, ax = plt.subplots(figsize=(6, 6)) 536 | 537 | df_wide = df.pivot(index="Date", columns="Name", values="Return") 538 | 539 | sns.scatterplot(data=df_wide, x="GOOGL", y="AMZN", ax=ax) 540 | 541 | ax.set_title("Daily returns - GOOGL vs AMZN") 542 | ax.yaxis.set_major_formatter(mticker.PercentFormatter(1)) 543 | ax.xaxis.set_major_formatter(mticker.PercentFormatter(1)) 544 | fig`, 545 | "Plotly Express": ` 546 | fig = px.scatter( 547 | data_frame=df_wide, 548 | x="GOOGL", 549 | y="AMZN", 550 | title="Daily returns - GOOGL vs. AMZN" 551 | ) 552 | fig.update_layout(yaxis_tickformat=".0%", xaxis_tickformat=".0%") 553 | plot(fig) # Replace this line by fig.show() to use in a notebook 554 | ` 555 | } 556 | 557 | const box_plot = { 558 | "Pandas": ` 559 | import matplotlib.ticker as mticker 560 | 561 | fig, ax = plt.subplots(figsize=(6, 4)) 562 | 563 | df_wide = df.pivot( 564 | index="Date", columns="Name", values="Return" 565 | ) 566 | df_wide.boxplot( 567 | column=["AMZN", "GOOGL", "IBM", "JPM"], 568 | ax=ax 569 | ) 570 | 571 | ax.set_ylabel("Daily returns") 572 | ax.yaxis.set_major_formatter(mticker.PercentFormatter(1)) 573 | fig # Not necessary if using a notebook 574 | `, 575 | "Matplotlib": ` 576 | import matplotlib.ticker as mticker 577 | 578 | df_wide = df.pivot(index="Date", columns="Name", values="Return") 579 | 580 | fig, ax = plt.subplots(figsize=(6, 4)) 581 | 582 | ax.boxplot( 583 | [df_wide[col] for col in sorted(df.Name.unique())], 584 | vert=True, 585 | autorange=True, 586 | labels=sorted(df.Name.unique()) 587 | ) 588 | 589 | ax.set_ylabel("Daily returns") 590 | ax.yaxis.set_major_formatter(mticker.PercentFormatter(1)) 591 | fig # Not necessary if using a notebook 592 | `, 593 | "Seaborn": ` 594 | import matplotlib.ticker as mticker 595 | 596 | fig, ax = plt.subplots(figsize=(6, 4)) 597 | 598 | sns.boxplot( 599 | data=df, 600 | x="Name", 601 | y="Return", 602 | order=sorted(df.Name.unique()), 603 | ax=ax 604 | ) 605 | 606 | ax.set_ylabel("Daily returns") 607 | ax.yaxis.set_major_formatter(mticker.PercentFormatter(1)) 608 | fig # Not necessary if using a notebook 609 | `, 610 | "Plotly Express": ` 611 | fig = px.box( 612 | df, 613 | x="Name", 614 | y="Return", 615 | category_orders={"Name": sorted(df.Name.unique())} 616 | ) 617 | fig.update_layout(yaxis_tickformat=".0%") 618 | plot(fig) 619 | ` 620 | } 621 | 622 | const strip_plot = { 623 | "Pandas": `# Pandas does not support strip plots`, 624 | "Matplotlib": `# Matplotlib does not support strip plots`, 625 | "Seaborn": ` 626 | import matplotlib.ticker as mticker 627 | 628 | fig, ax = plt.subplots(figsize=(6, 4)) 629 | 630 | sns.stripplot( 631 | data=df, 632 | x="Name", 633 | y="Return", 634 | order=sorted(df.Name.unique()), 635 | alpha=0.3, 636 | ax=ax 637 | ) 638 | 639 | ax.set_ylabel("Daily returns") 640 | ax.yaxis.set_major_formatter(mticker.PercentFormatter(1)) 641 | fig # Not necessary if using a notebook 642 | `, 643 | "Plotly Express": ` 644 | fig = px.strip( 645 | df, 646 | x="Name", 647 | y="Return", 648 | category_orders={"Name": sorted(df.Name.unique())}, 649 | color="Name" 650 | ) 651 | fig.update_layout(yaxis_tickformat=".0%") 652 | plot(fig) # Replace this line by fig.show() to use in a notebook 653 | ` 654 | } 655 | 656 | const pair_plot = { 657 | "Pandas": `# TBD`, 658 | "Matplotlib": `# Matplotlib does not support strip plots`, 659 | "Seaborn": ` 660 | import matplotlib.ticker as mticker 661 | 662 | df_wide = df.pivot( 663 | index="Date", columns="Name", values="Return" 664 | ) # Pair plots work with wide data 665 | 666 | fig = sns.pairplot( 667 | df_wide, 668 | kind="reg", 669 | corner=True, 670 | height=1.5, 671 | plot_kws={ 672 | 'line_kws':{'color':'red'}, 673 | 'scatter_kws': {'alpha': 0.1} 674 | }, 675 | diag_kws={ 676 | "edgecolor": "black", 677 | "linewidth": 0.2 678 | }, 679 | size=2 680 | ) 681 | 682 | for ax in fig.axes.flatten(): 683 | if ax: 684 | ax.yaxis.set_major_formatter(mticker.PercentFormatter(1)) 685 | ax.xaxis.set_major_formatter(mticker.PercentFormatter(1)) 686 | 687 | fig # Not necessary if using a notebook 688 | `, 689 | "Plotly Express": ` 690 | df_wide = df.pivot( 691 | index="Date", columns="Name", values="Return" 692 | ) # Pair plots work with wide data 693 | 694 | fig = px.scatter_matrix( 695 | df_wide, 696 | title="Daily Returns", 697 | opacity=0.2 698 | ) 699 | 700 | fig.update_layout( 701 | {"yaxis"+str(i+1): dict(tickformat=".0%") for i in range(16)} 702 | ) 703 | fig.update_layout( 704 | {"xaxis"+str(i+1): dict(tickformat=".0%") for i in range(16)} 705 | ) 706 | 707 | plot(fig) # Replace this line by fig.show() to use in a notebook 708 | ` 709 | } 710 | module.exports = { 711 | line_chart, 712 | bar_chart, 713 | grouped_bar_chart, 714 | stacked_bar_chart, 715 | stacked_area_chart, 716 | donut_chart, 717 | pie_chart, 718 | histogram, 719 | scatter_plot, 720 | box_plot, 721 | strip_plot, 722 | pair_plot 723 | } 724 | -------------------------------------------------------------------------------- /data/scatter_plot.csv: -------------------------------------------------------------------------------- 1 | Date,Name,Open,Close,Return 2 | 2017-01-03,GOOGL,800.62,808.01,0.009230346481476838 3 | 2017-01-04,GOOGL,809.89,807.77,-0.0026176394325155327 4 | 2017-01-05,GOOGL,807.5,813.02,0.006835913312693476 5 | 2017-01-06,GOOGL,814.99,825.21,0.012540031166026611 6 | 2017-01-09,GOOGL,826.37,827.18,0.0009801904715804608 7 | 2017-01-10,GOOGL,827.07,826.01,-0.0012816327517623165 8 | 2017-01-11,GOOGL,826.62,829.86,0.003919576105102718 9 | 2017-01-12,GOOGL,828.38,829.53,0.001388251768512008 10 | 2017-01-13,GOOGL,831.0,830.94,-7.220216606491628e-05 11 | 2017-01-17,GOOGL,830.0,827.46,-0.003060240963855378 12 | 2017-01-18,GOOGL,829.8,829.02,-0.0009399855386839875 13 | 2017-01-19,GOOGL,829.0,824.37,-0.005585042219541611 14 | 2017-01-20,GOOGL,829.09,828.17,-0.0011096503395289687 15 | 2017-01-23,GOOGL,831.61,844.43,0.015415880039922484 16 | 2017-01-24,GOOGL,846.98,849.53,0.00301069682873262 17 | 2017-01-25,GOOGL,853.55,858.45,0.005740729892800763 18 | 2017-01-26,GOOGL,859.05,856.98,-0.0024096385542167935 19 | 2017-01-27,GOOGL,859.0,845.03,-0.016263096623981406 20 | 2017-01-30,GOOGL,837.06,823.83,-0.015805318615152924 21 | 2017-01-31,GOOGL,819.5,820.19,0.0008419768151312441 22 | 2017-02-01,GOOGL,824.0,815.24,-0.010631067961165037 23 | 2017-02-02,GOOGL,815.0,818.26,0.003999999999999989 24 | 2017-02-03,GOOGL,823.13,820.13,-0.003644624785878294 25 | 2017-02-06,GOOGL,820.92,821.62,0.0008527018467086263 26 | 2017-02-07,GOOGL,825.5,829.23,0.004518473652331942 27 | 2017-02-08,GOOGL,830.53,829.88,-0.0007826327766606592 28 | 2017-02-09,GOOGL,831.73,830.06,-0.0020078631286596284 29 | 2017-02-10,GOOGL,832.95,834.85,0.002281049282670001 30 | 2017-02-13,GOOGL,837.7,838.96,0.001504118419481904 31 | 2017-02-14,GOOGL,839.77,840.03,0.0003096085833025601 32 | 2017-02-15,GOOGL,838.81,837.32,-0.0017763259856223644 33 | 2017-02-16,GOOGL,838.5,842.17,0.00437686344663084 34 | 2017-02-17,GOOGL,841.31,846.55,0.00622838192818344 35 | 2017-02-21,GOOGL,847.99,849.27,0.0015094517624028264 36 | 2017-02-22,GOOGL,848.0,851.36,0.003962264150943412 37 | 2017-02-23,GOOGL,851.08,851.0,-9.399821403398143e-05 38 | 2017-02-24,GOOGL,847.65,847.81,0.00018875715212642973 39 | 2017-02-27,GOOGL,844.95,849.67,0.00558612935676657 40 | 2017-02-28,GOOGL,847.35,844.93,-0.002855962707263908 41 | 2017-03-01,GOOGL,851.38,856.75,0.006307406798374409 42 | 2017-03-02,GOOGL,856.31,849.85,-0.007543996917004266 43 | 2017-03-03,GOOGL,848.94,849.08,0.00016491153673991841 44 | 2017-03-06,GOOGL,846.86,847.27,0.0004841414165268972 45 | 2017-03-07,GOOGL,847.26,851.15,0.004591270684323568 46 | 2017-03-08,GOOGL,853.12,853.64,0.00060952738184544 47 | 2017-03-09,GOOGL,853.69,857.84,0.004861249399664957 48 | 2017-03-10,GOOGL,862.7,861.4,-0.0015068969514316312 49 | 2017-03-13,GOOGL,860.83,864.58,0.004356260818047698 50 | 2017-03-14,GOOGL,863.75,865.91,0.0025007235890014104 51 | 2017-03-15,GOOGL,867.94,868.39,0.0005184690185956769 52 | 2017-03-16,GOOGL,870.53,870.0,-0.0006088245092070035 53 | 2017-03-17,GOOGL,873.68,872.37,-0.0014994048164086915 54 | 2017-03-20,GOOGL,869.48,867.91,-0.001805676956341779 55 | 2017-03-21,GOOGL,870.06,850.14,-0.02289497276049923 56 | 2017-03-22,GOOGL,849.48,849.8,0.0003767010406365498 57 | 2017-03-23,GOOGL,841.39,839.65,-0.0020680065130320173 58 | 2017-03-24,GOOGL,842.0,835.14,-0.008147268408551085 59 | 2017-03-27,GOOGL,828.09,838.51,0.012583173326570734 60 | 2017-03-28,GOOGL,839.69,840.63,0.0011194607533731983 61 | 2017-03-29,GOOGL,842.75,849.87,0.008448531592999116 62 | 2017-03-30,GOOGL,851.98,849.48,-0.002934341181717881 63 | 2017-03-31,GOOGL,846.83,847.8,0.001145448319024968 64 | 2017-04-03,GOOGL,848.75,856.75,0.00942562592047128 65 | 2017-04-04,GOOGL,848.0,852.57,0.005389150943396285 66 | 2017-04-05,GOOGL,854.71,848.91,-0.006785927390577 67 | 2017-04-06,GOOGL,849.5,845.1,-0.00517951736315477 68 | 2017-04-07,GOOGL,845.0,842.1,-0.0034319526627218664 69 | 2017-04-10,GOOGL,841.54,841.7,0.00019012762316714815 70 | 2017-04-11,GOOGL,841.7,839.88,-0.0021622906023524412 71 | 2017-04-12,GOOGL,838.46,841.46,0.00357798821649214 72 | 2017-04-13,GOOGL,841.04,840.18,-0.0010225435175497167 73 | 2017-04-17,GOOGL,841.38,855.13,0.016342199719508427 74 | 2017-04-18,GOOGL,852.54,853.99,0.0017007999624651577 75 | 2017-04-19,GOOGL,857.38,856.51,-0.0010147192610044607 76 | 2017-04-20,GOOGL,859.74,860.08,0.0003954683974225136 77 | 2017-04-21,GOOGL,860.62,858.95,-0.0019404615277357708 78 | 2017-04-24,GOOGL,868.44,878.93,0.01207913039473066 79 | 2017-04-25,GOOGL,882.26,888.84,0.007458118921859816 80 | 2017-04-26,GOOGL,891.39,889.14,-0.0025241476794669 81 | 2017-04-27,GOOGL,890.0,891.44,0.001617977528089949 82 | 2017-04-28,GOOGL,929.0,924.52,-0.004822389666307878 83 | 2017-05-01,GOOGL,924.15,932.82,0.009381593897094706 84 | 2017-05-02,GOOGL,933.27,937.09,0.004093134891296249 85 | 2017-05-03,GOOGL,936.05,948.45,0.013247155600662456 86 | 2017-05-04,GOOGL,950.29,954.72,0.004661734838838738 87 | 2017-05-05,GOOGL,956.72,950.28,-0.006731332051174904 88 | 2017-05-08,GOOGL,947.45,958.69,0.011863422871919372 89 | 2017-05-09,GOOGL,961.33,956.71,-0.004805841906525339 90 | 2017-05-10,GOOGL,956.22,954.84,-0.0014431825312166608 91 | 2017-05-11,GOOGL,951.29,955.89,0.004835539110050587 92 | 2017-05-12,GOOGL,957.85,955.14,-0.002829253014563905 93 | 2017-05-15,GOOGL,955.29,959.22,0.004113933988631791 94 | 2017-05-16,GOOGL,963.55,964.61,0.0011000985937419533 95 | 2017-05-17,GOOGL,959.7,942.17,-0.018266124830676342 96 | 2017-05-18,GOOGL,943.2,950.5,0.007739609838846431 97 | 2017-05-19,GOOGL,952.82,954.65,0.0019206145966708583 98 | 2017-05-22,GOOGL,957.0,964.07,0.007387669801462957 99 | 2017-05-23,GOOGL,969.96,970.55,0.0006082725060826406 100 | 2017-05-24,GOOGL,975.26,977.61,0.0024096138465640165 101 | 2017-05-25,GOOGL,979.0,991.86,0.013135852911133825 102 | 2017-05-26,GOOGL,992.0,993.27,0.0012802419354838526 103 | 2017-05-30,GOOGL,992.5,996.17,0.003697732997481067 104 | 2017-05-31,GOOGL,996.21,987.09,-0.009154696298973112 105 | 2017-06-01,GOOGL,990.96,988.29,-0.0026943569871640356 106 | 2017-06-02,GOOGL,988.59,996.12,0.007616908930901559 107 | 2017-06-05,GOOGL,997.89,1003.88,0.0060026656244676355 108 | 2017-06-06,GOOGL,1003.31,996.68,-0.006608127099301309 109 | 2017-06-07,GOOGL,998.82,1001.59,0.002773272461504557 110 | 2017-06-08,GOOGL,1004.23,1004.28,4.9789390876546734e-05 111 | 2017-06-09,GOOGL,1005.49,970.12,-0.035176878934648784 112 | 2017-06-12,GOOGL,958.72,961.81,0.0032230473965286196 113 | 2017-06-13,GOOGL,972.04,970.5,-0.0015842969425126164 114 | 2017-06-14,GOOGL,975.5,967.93,-0.0077601230138391085 115 | 2017-06-15,GOOGL,948.02,960.18,0.012826733613214878 116 | 2017-06-16,GOOGL,957.91,958.62,0.0007411969809272649 117 | 2017-06-19,GOOGL,969.65,975.22,0.005744340741504718 118 | 2017-06-20,GOOGL,975.31,968.99,-0.006479990977227688 119 | 2017-06-21,GOOGL,970.79,978.59,0.008034693394039977 120 | 2017-06-22,GOOGL,976.87,976.62,-0.00025591941609426024 121 | 2017-06-23,GOOGL,975.5,986.09,0.01085597129677092 122 | 2017-06-26,GOOGL,990.0,972.09,-0.01809090909090906 123 | 2017-06-27,GOOGL,961.6,948.09,-0.014049500831946745 124 | 2017-06-28,GOOGL,950.66,961.01,0.010887173121831174 125 | 2017-06-29,GOOGL,951.35,937.82,-0.014221895201555656 126 | 2017-06-30,GOOGL,943.99,929.68,-0.015159058888335745 127 | 2017-07-03,GOOGL,933.22,919.46,-0.01474464756434709 128 | 2017-07-05,GOOGL,924.2,932.26,0.008721056048474297 129 | 2017-07-06,GOOGL,925.0,927.69,0.002908108108108167 130 | 2017-07-07,GOOGL,930.98,940.81,0.010558766031493616 131 | 2017-07-10,GOOGL,941.95,951.0,0.009607728648017361 132 | 2017-07-11,GOOGL,950.52,953.53,0.0031666877077809945 133 | 2017-07-12,GOOGL,960.86,967.66,0.007076993526632345 134 | 2017-07-13,GOOGL,970.8,968.85,-0.0020086526576019075 135 | 2017-07-14,GOOGL,974.0,976.91,0.002987679671457873 136 | 2017-07-17,GOOGL,976.32,975.96,-0.0003687315634218429 137 | 2017-07-18,GOOGL,973.36,986.95,0.013961946248048031 138 | 2017-07-19,GOOGL,990.01,992.77,0.0027878506277714274 139 | 2017-07-20,GOOGL,997.0,992.19,-0.004824473420260727 140 | 2017-07-21,GOOGL,989.0,993.84,0.004893832153690629 141 | 2017-07-24,GOOGL,994.1,998.31,0.004234986419877198 142 | 2017-07-25,GOOGL,970.7,969.03,-0.001720407953023666 143 | 2017-07-26,GOOGL,972.78,965.31,-0.007679023006229597 144 | 2017-07-27,GOOGL,969.18,952.51,-0.017200107307208112 145 | 2017-07-28,GOOGL,947.99,958.33,0.01090728805156176 146 | 2017-07-31,GOOGL,960.0,945.5,-0.015104166666666667 147 | 2017-08-01,GOOGL,947.81,946.56,-0.001318829723256771 148 | 2017-08-02,GOOGL,948.37,947.64,-0.0007697417674536501 149 | 2017-08-03,GOOGL,949.1,940.3,-0.009271941839637624 150 | 2017-08-04,GOOGL,943.95,945.79,0.0019492557868530304 151 | 2017-08-07,GOOGL,947.52,945.75,-0.0018680344478216628 152 | 2017-08-08,GOOGL,944.29,944.19,-0.00010589967065192796 153 | 2017-08-09,GOOGL,938.45,940.08,0.001736906601310667 154 | 2017-08-10,GOOGL,935.0,923.59,-0.0122032085561497 155 | 2017-08-11,GOOGL,923.71,930.09,0.006906929664072052 156 | 2017-08-14,GOOGL,939.07,938.93,-0.0001490836678842898 157 | 2017-08-15,GOOGL,941.03,938.08,-0.003134862863032987 158 | 2017-08-16,GOOGL,941.25,944.27,0.0032084993359893566 159 | 2017-08-17,GOOGL,942.95,927.66,-0.016215069727981417 160 | 2017-08-18,GOOGL,926.98,926.18,-0.000863017540831591 161 | 2017-08-21,GOOGL,925.77,920.87,-0.005292891322898752 162 | 2017-08-22,GOOGL,926.96,940.4,0.014499007508414537 163 | 2017-08-23,GOOGL,937.0,942.58,0.005955176093916799 164 | 2017-08-24,GOOGL,943.71,936.89,-0.0072267963675282125 165 | 2017-08-25,GOOGL,939.21,930.5,-0.009273751344214856 166 | 2017-08-28,GOOGL,931.88,928.13,-0.004024123277675237 167 | 2017-08-29,GOOGL,919.95,935.75,0.017174846459046638 168 | 2017-08-30,GOOGL,935.67,943.63,0.00850727286329586 169 | 2017-08-31,GOOGL,946.3,955.24,0.009447321145514167 170 | 2017-09-01,GOOGL,957.47,951.99,-0.005723416921679027 171 | 2017-09-05,GOOGL,946.86,941.48,-0.005681938195720587 172 | 2017-09-06,GOOGL,943.87,942.02,-0.001960015680125465 173 | 2017-09-07,GOOGL,944.25,949.89,0.005972994440031756 174 | 2017-09-08,GOOGL,949.7,941.41,-0.008729072338633334 175 | 2017-09-11,GOOGL,947.2,943.29,-0.004127956081081167 176 | 2017-09-12,GOOGL,946.92,946.65,-0.0002851349638828854 177 | 2017-09-13,GOOGL,945.5,950.44,0.005224748810153416 178 | 2017-09-14,GOOGL,946.0,940.13,-0.006205073995771675 179 | 2017-09-15,GOOGL,940.09,935.29,-0.005105894116520831 180 | 2017-09-18,GOOGL,935.01,929.75,-0.0056256082822643515 181 | 2017-09-19,GOOGL,933.41,936.86,0.0036961249611639534 182 | 2017-09-20,GOOGL,937.73,947.54,0.010461433461657349 183 | 2017-09-21,GOOGL,948.13,947.55,-0.0006117304589033581 184 | 2017-09-22,GOOGL,942.77,943.26,0.0005197450067354806 185 | 2017-09-25,GOOGL,939.45,934.28,-0.005503219969130952 186 | 2017-09-26,GOOGL,936.69,937.43,0.0007900159070769362 187 | 2017-09-27,GOOGL,942.74,959.9,0.018202261493094563 188 | 2017-09-28,GOOGL,956.25,964.81,0.008951633986928047 189 | 2017-09-29,GOOGL,966.0,973.72,0.007991718426501064 190 | 2017-10-02,GOOGL,975.65,967.47,-0.008384154153641112 191 | 2017-10-03,GOOGL,967.56,972.08,0.004671544917111183 192 | 2017-10-04,GOOGL,971.76,966.78,-0.005124722153618196 193 | 2017-10-05,GOOGL,972.79,985.19,0.01274684155881546 194 | 2017-10-06,GOOGL,980.0,993.64,0.013918367346938762 195 | 2017-10-09,GOOGL,995.0,992.31,-0.002703517587939753 196 | 2017-10-10,GOOGL,995.3,987.8,-0.007535416457349543 197 | 2017-10-11,GOOGL,989.04,1005.65,0.01679406292970963 198 | 2017-10-12,GOOGL,1003.84,1005.65,0.0018030761874401752 199 | 2017-10-13,GOOGL,1009.11,1007.87,-0.0012288055811556808 200 | 2017-10-16,GOOGL,1009.63,1009.35,-0.00027732931866126473 201 | 2017-10-17,GOOGL,1007.44,1011.0,0.003533709203525714 202 | 2017-10-18,GOOGL,1011.05,1012.74,0.0016715295979427868 203 | 2017-10-19,GOOGL,1004.75,1001.84,-0.002896242846479192 204 | 2017-10-20,GOOGL,1007.05,1005.07,-0.001966138722009736 205 | 2017-10-23,GOOGL,1005.18,985.54,-0.0195387890726039 206 | 2017-10-24,GOOGL,986.5,988.49,0.0020172326406487674 207 | 2017-10-25,GOOGL,986.27,991.46,0.005262250702140443 208 | 2017-10-26,GOOGL,998.47,991.42,-0.007060803028633877 209 | 2017-10-27,GOOGL,1030.99,1033.67,0.0025994432535718713 210 | 2017-10-30,GOOGL,1029.16,1033.13,0.0038575148664930885 211 | 2017-10-31,GOOGL,1033.0,1033.04,3.87221684413975e-05 212 | 2017-11-01,GOOGL,1036.32,1042.6,0.006059904276671272 213 | 2017-11-02,GOOGL,1039.99,1042.97,0.002865412167424704 214 | 2017-11-03,GOOGL,1042.75,1049.99,0.006943179093742516 215 | 2017-11-06,GOOGL,1049.1,1042.68,-0.006119531026594077 216 | 2017-11-07,GOOGL,1049.65,1052.39,0.0026103939408374304 217 | 2017-11-08,GOOGL,1050.05,1058.29,0.00784724536926814 218 | 2017-11-09,GOOGL,1048.0,1047.72,-0.0002671755725190579 219 | 2017-11-10,GOOGL,1043.87,1044.15,0.00026823263433205295 220 | 2017-11-13,GOOGL,1040.8,1041.2,0.0003843197540354448 221 | 2017-11-14,GOOGL,1037.72,1041.64,0.0037775122383688015 222 | 2017-11-15,GOOGL,1035.0,1036.41,0.0013623188405797893 223 | 2017-11-16,GOOGL,1038.75,1048.47,0.009357400722021687 224 | 2017-11-17,GOOGL,1049.8,1035.89,-0.013250142884358787 225 | 2017-11-20,GOOGL,1036.0,1034.66,-0.0012934362934362144 226 | 2017-11-21,GOOGL,1040.04,1050.3,0.009865005192107987 227 | 2017-11-22,GOOGL,1051.16,1051.92,0.0007230107690551304 228 | 2017-11-24,GOOGL,1054.39,1056.52,0.002020125380551676 229 | 2017-11-27,GOOGL,1058.57,1072.01,0.012696373409410861 230 | 2017-11-28,GOOGL,1073.99,1063.29,-0.009962848816097027 231 | 2017-11-29,GOOGL,1056.18,1037.38,-0.01779999621276672 232 | 2017-11-30,GOOGL,1039.94,1036.17,-0.0036252091466815214 233 | 2017-12-01,GOOGL,1030.41,1025.07,-0.005182403121087863 234 | 2017-12-04,GOOGL,1027.8,1011.87,-0.015499124343257394 235 | 2017-12-05,GOOGL,1010.99,1019.6,0.008516404712212796 236 | 2017-12-06,GOOGL,1016.52,1032.72,0.015936725298075834 237 | 2017-12-07,GOOGL,1036.07,1044.57,0.00820407887497949 238 | 2017-12-08,GOOGL,1051.81,1049.38,-0.0023103031916409202 239 | 2017-12-11,GOOGL,1051.11,1051.97,0.0008181826830684966 240 | 2017-12-12,GOOGL,1050.0,1048.77,-0.0011714285714285887 241 | 2017-12-13,GOOGL,1052.08,1051.39,-0.0006558436620787651 242 | 2017-12-14,GOOGL,1055.49,1057.47,0.0018759059773186086 243 | 2017-12-15,GOOGL,1063.78,1072.0,0.0077271616311643644 244 | 2017-12-18,GOOGL,1076.45,1085.09,0.008026383018254328 245 | 2017-12-19,GOOGL,1083.02,1079.78,-0.002991634503517949 246 | 2017-12-20,GOOGL,1080.92,1073.56,-0.006809014543167049 247 | 2017-12-21,GOOGL,1075.39,1070.85,-0.004221724211681521 248 | 2017-12-22,GOOGL,1070.0,1068.86,-0.0010654205607477571 249 | 2017-12-26,GOOGL,1068.64,1065.85,-0.002610795029196166 250 | 2017-12-27,GOOGL,1066.6,1060.2,-0.006000375023438837 251 | 2017-12-28,GOOGL,1062.25,1055.95,-0.0059308072487643726 252 | 2017-12-29,GOOGL,1055.49,1053.4,-0.0019801229760584354 253 | 2017-01-03,AMZN,757.92,753.67,-0.005607451973823095 254 | 2017-01-04,AMZN,758.39,757.18,-0.0015954851725366057 255 | 2017-01-05,AMZN,761.55,780.45,0.024817805790821473 256 | 2017-01-06,AMZN,782.36,795.99,0.01742164732348279 257 | 2017-01-09,AMZN,798.0,796.92,-0.0013533834586466678 258 | 2017-01-10,AMZN,796.6,795.9,-0.0008787346221441696 259 | 2017-01-11,AMZN,793.66,799.02,0.006753521659148771 260 | 2017-01-12,AMZN,800.31,813.64,0.016656045782259425 261 | 2017-01-13,AMZN,814.32,817.14,0.0034630120837016603 262 | 2017-01-17,AMZN,815.7,809.72,-0.007331126639695988 263 | 2017-01-18,AMZN,809.5,807.48,-0.002495367510809119 264 | 2017-01-19,AMZN,810.0,809.04,-0.00118518518518523 265 | 2017-01-20,AMZN,815.28,808.33,-0.008524678638013851 266 | 2017-01-23,AMZN,806.8,817.88,0.013733267228557314 267 | 2017-01-24,AMZN,822.0,822.44,0.0005352798053528644 268 | 2017-01-25,AMZN,825.79,836.52,0.012993618232238243 269 | 2017-01-26,AMZN,835.53,839.15,0.004332579320910086 270 | 2017-01-27,AMZN,839.0,835.77,-0.003849821215733037 271 | 2017-01-30,AMZN,833.0,830.38,-0.003145258103241302 272 | 2017-01-31,AMZN,823.75,823.48,-0.0003277693474961843 273 | 2017-02-01,AMZN,829.21,832.35,0.003786736773555536 274 | 2017-02-02,AMZN,836.59,839.95,0.004016304282862589 275 | 2017-02-03,AMZN,806.72,810.2,0.00431376437921462 276 | 2017-02-06,AMZN,809.8,807.64,-0.0026673252654976147 277 | 2017-02-07,AMZN,809.31,812.5,0.003941629289147613 278 | 2017-02-08,AMZN,812.69,819.71,0.008637980041590252 279 | 2017-02-09,AMZN,821.6,821.36,-0.0002921129503408095 280 | 2017-02-10,AMZN,823.82,827.46,0.004418440921560518 281 | 2017-02-13,AMZN,831.62,836.53,0.005904138909598095 282 | 2017-02-14,AMZN,837.0,836.39,-0.000728793309438487 283 | 2017-02-15,AMZN,834.0,842.7,0.010431654676259047 284 | 2017-02-16,AMZN,841.84,844.14,0.0027321106148436216 285 | 2017-02-17,AMZN,842.0,845.07,0.0036460807600950714 286 | 2017-02-21,AMZN,848.84,856.44,0.008953395221714367 287 | 2017-02-22,AMZN,856.95,855.61,-0.0015636851624949318 288 | 2017-02-23,AMZN,857.57,852.19,-0.006273540352391053 289 | 2017-02-24,AMZN,844.69,845.24,0.0006511264487562946 290 | 2017-02-27,AMZN,842.38,848.64,0.007431325530045812 291 | 2017-02-28,AMZN,851.45,845.04,-0.007528334018439229 292 | 2017-03-01,AMZN,853.05,853.08,3.5167926850813435e-05 293 | 2017-03-02,AMZN,853.08,848.91,-0.004888169925446702 294 | 2017-03-03,AMZN,847.2,849.88,0.0031633616619451722 295 | 2017-03-06,AMZN,845.23,846.61,0.001632691693385227 296 | 2017-03-07,AMZN,845.48,846.02,0.0006386904480294787 297 | 2017-03-08,AMZN,848.0,850.5,0.00294811320754717 298 | 2017-03-09,AMZN,851.0,853.0,0.0023501762632197414 299 | 2017-03-10,AMZN,857.0,852.46,-0.005297549591598557 300 | 2017-03-13,AMZN,851.77,854.59,0.003310752902778978 301 | 2017-03-14,AMZN,853.55,852.53,-0.0011950090797258296 302 | 2017-03-15,AMZN,854.33,852.97,-0.0015918907213840244 303 | 2017-03-16,AMZN,855.3,853.42,-0.0021980591605284643 304 | 2017-03-17,AMZN,853.49,852.31,-0.0013825586708690947 305 | 2017-03-20,AMZN,851.51,856.97,0.006412138436424747 306 | 2017-03-21,AMZN,858.84,843.2,-0.018210609659540758 307 | 2017-03-22,AMZN,840.43,848.06,0.00907868591078376 308 | 2017-03-23,AMZN,848.2,847.38,-0.0009667531242632044 309 | 2017-03-24,AMZN,851.68,845.61,-0.007127089986849446 310 | 2017-03-27,AMZN,838.07,846.82,0.010440655315188467 311 | 2017-03-28,AMZN,851.75,856.0,0.004989727032579982 312 | 2017-03-29,AMZN,859.05,874.32,0.01777544962458541 313 | 2017-03-30,AMZN,874.95,876.34,0.0015886622092690854 314 | 2017-03-31,AMZN,877.0,886.54,0.010877993158494827 315 | 2017-04-03,AMZN,888.0,891.51,0.003952702702702693 316 | 2017-04-04,AMZN,891.5,906.83,0.017195737521032015 317 | 2017-04-05,AMZN,910.82,909.28,-0.0016907841285875116 318 | 2017-04-06,AMZN,913.8,898.28,-0.016984022762092342 319 | 2017-04-07,AMZN,899.65,894.88,-0.0053020619129661335 320 | 2017-04-10,AMZN,899.63,907.04,0.008236719540255403 321 | 2017-04-11,AMZN,907.04,902.36,-0.005159640148174226 322 | 2017-04-12,AMZN,903.09,896.23,-0.007596142134228054 323 | 2017-04-13,AMZN,891.45,884.67,-0.007605586404173073 324 | 2017-04-17,AMZN,887.5,901.99,0.016326760563380293 325 | 2017-04-18,AMZN,900.99,903.78,0.0030965937468783932 326 | 2017-04-19,AMZN,907.84,899.2,-0.009517095523440239 327 | 2017-04-20,AMZN,899.7,902.06,0.0026230965877513616 328 | 2017-04-21,AMZN,902.67,898.53,-0.00458639369869386 329 | 2017-04-24,AMZN,908.68,907.41,-0.0013976317295417329 330 | 2017-04-25,AMZN,907.04,907.62,0.0006394425824660885 331 | 2017-04-26,AMZN,910.3,909.29,-0.0011095243326375822 332 | 2017-04-27,AMZN,914.39,918.38,0.00436356478089219 333 | 2017-04-28,AMZN,948.83,924.99,-0.025125681101988796 334 | 2017-05-01,AMZN,927.8,948.23,0.022019831860314792 335 | 2017-05-02,AMZN,946.64,946.94,0.00031691033550248056 336 | 2017-05-03,AMZN,946.0,941.03,-0.0052536997885835384 337 | 2017-05-04,AMZN,944.75,937.53,-0.007642233395078092 338 | 2017-05-05,AMZN,940.52,934.15,-0.006772849062220904 339 | 2017-05-08,AMZN,940.95,949.04,0.008597693820075369 340 | 2017-05-09,AMZN,952.8,952.82,2.099076406391215e-05 341 | 2017-05-10,AMZN,953.5,948.95,-0.004771893025694761 342 | 2017-05-11,AMZN,945.11,947.62,0.00265577551819364 343 | 2017-05-12,AMZN,954.5,961.35,0.007176532215819825 344 | 2017-05-15,AMZN,958.73,957.97,-0.0007927153630323354 345 | 2017-05-16,AMZN,961.0,966.07,0.005275754422476639 346 | 2017-05-17,AMZN,954.7,944.76,-0.010411647638001523 347 | 2017-05-18,AMZN,944.8,958.49,0.014489839119390406 348 | 2017-05-19,AMZN,962.84,959.84,-0.0031157824768393502 349 | 2017-05-22,AMZN,964.0,970.67,0.006919087136929418 350 | 2017-05-23,AMZN,975.02,971.54,-0.003569157555742465 351 | 2017-05-24,AMZN,976.0,980.35,0.004456967213114778 352 | 2017-05-25,AMZN,984.85,993.38,0.008661217444280826 353 | 2017-05-26,AMZN,995.0,995.78,0.0007839195979899223 354 | 2017-05-30,AMZN,996.51,996.7,0.0001906654223239652 355 | 2017-05-31,AMZN,1000.0,994.62,-0.005379999999999995 356 | 2017-06-01,AMZN,998.59,995.95,-0.002643727655994939 357 | 2017-06-02,AMZN,998.99,1006.73,0.007747825303556602 358 | 2017-06-05,AMZN,1007.23,1011.34,0.00408049799946389 359 | 2017-06-06,AMZN,1012.0,1003.0,-0.008893280632411068 360 | 2017-06-07,AMZN,1005.95,1010.07,0.004095630995576326 361 | 2017-06-08,AMZN,1012.06,1010.27,-0.0017686698417089537 362 | 2017-06-09,AMZN,1012.5,978.31,-0.03376790123456796 363 | 2017-06-12,AMZN,967.0,964.91,-0.0021613236814891747 364 | 2017-06-13,AMZN,977.99,980.79,0.0028630149592531154 365 | 2017-06-14,AMZN,988.59,976.47,-0.01225988529117228 366 | 2017-06-15,AMZN,958.7,964.17,0.005705643058308035 367 | 2017-06-16,AMZN,996.0,987.71,-0.008323293172690727 368 | 2017-06-19,AMZN,1017.0,995.17,-0.02146509341199611 369 | 2017-06-20,AMZN,998.0,992.59,-0.005420841683366702 370 | 2017-06-21,AMZN,998.7,1002.23,0.0035345949734654778 371 | 2017-06-22,AMZN,1002.23,1001.3,-0.0009279307145067137 372 | 2017-06-23,AMZN,1002.54,1003.74,0.0011969597223053898 373 | 2017-06-26,AMZN,1008.5,993.98,-0.01439762022806146 374 | 2017-06-27,AMZN,990.69,976.78,-0.014040719094772412 375 | 2017-06-28,AMZN,978.55,990.33,0.012038219815032536 376 | 2017-06-29,AMZN,979.0,975.93,-0.0031358529111338612 377 | 2017-06-30,AMZN,980.12,968.0,-0.012365832755172841 378 | 2017-07-03,AMZN,972.79,953.66,-0.019665087017753057 379 | 2017-07-05,AMZN,961.53,971.4,0.010264890331034919 380 | 2017-07-06,AMZN,964.66,965.14,0.0004975846412207599 381 | 2017-07-07,AMZN,969.55,978.76,0.00949925223041621 382 | 2017-07-10,AMZN,985.0,996.47,0.011644670050761448 383 | 2017-07-11,AMZN,993.0,994.13,0.0011379657603222512 384 | 2017-07-12,AMZN,1000.65,1006.51,0.005856193474241757 385 | 2017-07-13,AMZN,1004.62,1000.63,-0.0039716509725070265 386 | 2017-07-14,AMZN,1002.4,1001.81,-0.0005885873902633997 387 | 2017-07-17,AMZN,1004.69,1010.04,0.005325025629796165 388 | 2017-07-18,AMZN,1006.0,1024.45,0.018339960238568633 389 | 2017-07-19,AMZN,1025.0,1026.87,0.0018243902439023325 390 | 2017-07-20,AMZN,1031.59,1028.7,-0.002801500596166959 391 | 2017-07-21,AMZN,1021.28,1025.67,0.004298527338242304 392 | 2017-07-24,AMZN,1028.34,1038.95,0.010317599237606364 393 | 2017-07-25,AMZN,1038.05,1039.87,0.0017532874139010032 394 | 2017-07-26,AMZN,1043.2,1052.8,0.009202453987729974 395 | 2017-07-27,AMZN,1069.55,1046.0,-0.02201860595577575 396 | 2017-07-28,AMZN,1012.14,1020.04,0.007805244333787794 397 | 2017-07-31,AMZN,1019.05,987.78,-0.03068544232373287 398 | 2017-08-01,AMZN,996.11,996.19,8.031241529554058e-05 399 | 2017-08-02,AMZN,1001.77,995.89,-0.005869610788903636 400 | 2017-08-03,AMZN,999.47,986.92,-0.012556655027164465 401 | 2017-08-04,AMZN,989.68,987.58,-0.0021218979872281033 402 | 2017-08-07,AMZN,990.65,992.27,0.0016352899611366321 403 | 2017-08-08,AMZN,994.35,989.84,-0.004535626288530186 404 | 2017-08-09,AMZN,982.6,982.01,-0.0006004477915734092 405 | 2017-08-10,AMZN,976.3,956.92,-0.019850455802519713 406 | 2017-08-11,AMZN,960.0,967.99,0.008322916666666676 407 | 2017-08-14,AMZN,978.41,983.3,0.004997904763851541 408 | 2017-08-15,AMZN,988.9,982.74,-0.0062291434927697125 409 | 2017-08-16,AMZN,981.65,978.18,-0.0035348647685020398 410 | 2017-08-17,AMZN,977.84,960.57,-0.01766137609424853 411 | 2017-08-18,AMZN,961.4,958.47,-0.0030476388599957873 412 | 2017-08-21,AMZN,957.57,953.29,-0.004469647127625225 413 | 2017-08-22,AMZN,955.52,966.9,0.011909745478901536 414 | 2017-08-23,AMZN,959.38,958.0,-0.0014384289853863906 415 | 2017-08-24,AMZN,957.42,952.45,-0.0051910342378474585 416 | 2017-08-25,AMZN,956.0,945.26,-0.011234309623430971 417 | 2017-08-28,AMZN,946.54,946.02,-0.0005493692818052928 418 | 2017-08-29,AMZN,940.0,954.06,0.01495744680851058 419 | 2017-08-30,AMZN,958.44,967.59,0.009546763490672319 420 | 2017-08-31,AMZN,974.7,980.6,0.0060531445572996586 421 | 2017-09-01,AMZN,984.2,978.25,-0.006045519203413986 422 | 2017-09-05,AMZN,975.4,965.27,-0.010385482878818941 423 | 2017-09-06,AMZN,968.32,967.8,-0.0005370125578322202 424 | 2017-09-07,AMZN,974.0,979.47,0.005616016427104751 425 | 2017-09-08,AMZN,979.1,965.9,-0.01348176897150449 426 | 2017-09-11,AMZN,974.46,977.96,0.0035917328571721772 427 | 2017-09-12,AMZN,983.27,982.58,-0.0007017401120749549 428 | 2017-09-13,AMZN,983.97,999.6,0.015884630628982585 429 | 2017-09-14,AMZN,996.8,992.21,-0.0046047351524878795 430 | 2017-09-15,AMZN,993.01,986.79,-0.006263783849105273 431 | 2017-09-18,AMZN,990.4,974.19,-0.016367124394184092 432 | 2017-09-19,AMZN,977.25,969.86,-0.007562036326426182 433 | 2017-09-20,AMZN,971.79,973.21,0.0014612210456992486 434 | 2017-09-21,AMZN,971.31,964.65,-0.006856719276029248 435 | 2017-09-22,AMZN,961.01,955.1,-0.0061497799190434735 436 | 2017-09-25,AMZN,949.31,939.79,-0.010028336370627068 437 | 2017-09-26,AMZN,945.49,938.6,-0.007287226728997648 438 | 2017-09-27,AMZN,948.0,950.87,0.0030274261603375576 439 | 2017-09-28,AMZN,951.86,956.4,0.004769608976109894 440 | 2017-09-29,AMZN,960.11,961.35,0.0012915186801512421 441 | 2017-10-02,AMZN,964.0,959.19,-0.004989626556016541 442 | 2017-10-03,AMZN,958.0,957.1,-0.0009394572025051954 443 | 2017-10-04,AMZN,954.21,965.45,0.011779377705117331 444 | 2017-10-05,AMZN,970.0,980.85,0.011185567010309302 445 | 2017-10-06,AMZN,975.64,989.58,0.014288057070230878 446 | 2017-10-09,AMZN,993.24,990.99,-0.0022653135193910837 447 | 2017-10-10,AMZN,996.67,987.2,-0.009501640462740841 448 | 2017-10-11,AMZN,991.27,995.0,0.0037628496776862187 449 | 2017-10-12,AMZN,996.81,1000.93,0.004133184859702456 450 | 2017-10-13,AMZN,1007.0,1002.94,-0.004031777557100244 451 | 2017-10-16,AMZN,1008.44,1006.34,-0.002082424338582387 452 | 2017-10-17,AMZN,1005.59,1009.13,0.003520321403355208 453 | 2017-10-18,AMZN,1009.27,997.0,-0.01215730181220088 454 | 2017-10-19,AMZN,990.0,986.61,-0.0034242424242424104 455 | 2017-10-20,AMZN,993.53,982.91,-0.010689158857810035 456 | 2017-10-23,AMZN,986.73,966.3,-0.02070475205983406 457 | 2017-10-24,AMZN,969.0,975.9,0.007120743034055704 458 | 2017-10-25,AMZN,978.0,972.91,-0.005204498977505145 459 | 2017-10-26,AMZN,980.33,972.43,-0.008058510909591761 460 | 2017-10-27,AMZN,1058.14,1100.95,0.04045778441416064 461 | 2017-10-30,AMZN,1095.01,1110.85,0.014465621318526696 462 | 2017-10-31,AMZN,1109.0,1105.28,-0.0033543733092876713 463 | 2017-11-01,AMZN,1105.4,1103.68,-0.0015559978288402633 464 | 2017-11-02,AMZN,1097.81,1094.22,-0.0032701469288856162 465 | 2017-11-03,AMZN,1091.15,1111.6,0.01874169454245504 466 | 2017-11-06,AMZN,1109.15,1120.66,0.01037731596267411 467 | 2017-11-07,AMZN,1124.74,1123.17,-0.0013958781585076874 468 | 2017-11-08,AMZN,1122.82,1132.88,0.008959583904811256 469 | 2017-11-09,AMZN,1125.96,1129.13,0.002815375324167886 470 | 2017-11-10,AMZN,1126.1,1125.35,-0.0006660154515584762 471 | 2017-11-13,AMZN,1123.0,1129.17,0.005494211932324197 472 | 2017-11-14,AMZN,1130.11,1136.84,0.005955172505331356 473 | 2017-11-15,AMZN,1127.01,1126.69,-0.00028393714341482006 474 | 2017-11-16,AMZN,1130.16,1137.29,0.006308841226020989 475 | 2017-11-17,AMZN,1138.28,1129.88,-0.007379555118248466 476 | 2017-11-20,AMZN,1129.77,1126.31,-0.0030625702576630963 477 | 2017-11-21,AMZN,1132.86,1139.49,0.0058524442561305986 478 | 2017-11-22,AMZN,1141.0,1156.16,0.013286590709903665 479 | 2017-11-24,AMZN,1160.7,1186.0,0.021797191350047346 480 | 2017-11-27,AMZN,1202.66,1195.83,-0.005679078043669994 481 | 2017-11-28,AMZN,1204.88,1193.6,-0.00936192815882096 482 | 2017-11-29,AMZN,1194.8,1161.27,-0.02806327418814862 483 | 2017-11-30,AMZN,1167.1,1176.75,0.008268357467226537 484 | 2017-12-01,AMZN,1172.05,1162.35,-0.008276097436116245 485 | 2017-12-04,AMZN,1173.85,1133.95,-0.033990714316139085 486 | 2017-12-05,AMZN,1128.26,1141.57,0.011796926240405532 487 | 2017-12-06,AMZN,1137.99,1152.35,0.012618740059227146 488 | 2017-12-07,AMZN,1156.59,1159.79,0.0027667539923395892 489 | 2017-12-08,AMZN,1170.4,1162.0,-0.007177033492823044 490 | 2017-12-11,AMZN,1164.6,1168.92,0.0037094281298301252 491 | 2017-12-12,AMZN,1166.51,1165.08,-0.0012258789037385566 492 | 2017-12-13,AMZN,1170.0,1164.13,-0.005017094017093924 493 | 2017-12-14,AMZN,1163.71,1174.26,0.00906583255278373 494 | 2017-12-15,AMZN,1179.03,1179.14,9.329703230632583e-05 495 | 2017-12-18,AMZN,1187.37,1190.58,0.0027034538517901217 496 | 2017-12-19,AMZN,1189.15,1187.38,-0.0014884581423705854 497 | 2017-12-20,AMZN,1190.5,1177.62,-0.010818983620327686 498 | 2017-12-21,AMZN,1175.9,1174.76,-0.0009694701930437112 499 | 2017-12-22,AMZN,1172.08,1168.36,-0.0031738447887516446 500 | 2017-12-26,AMZN,1168.36,1176.76,0.007189564860145924 501 | 2017-12-27,AMZN,1179.91,1182.26,0.001991677331321803 502 | 2017-12-28,AMZN,1189.0,1186.1,-0.0024390243902439788 503 | 2017-12-29,AMZN,1182.35,1169.47,-0.010893559436714918 504 | -------------------------------------------------------------------------------- /data/box_plot.csv: -------------------------------------------------------------------------------- 1 | Date,Name,Close,Open,Return 2 | 2016-01-04,IBM,135.95,135.6,0.0025811209439527607 3 | 2016-01-05,IBM,135.85,136.76,-0.006653992395437238 4 | 2016-01-06,IBM,135.17,134.38,0.00587885101949689 5 | 2016-01-07,IBM,132.86,133.7,-0.006282722513088819 6 | 2016-01-08,IBM,131.63,133.18,-0.011638384141763112 7 | 2016-01-11,IBM,133.23,131.81,0.010773082467187523 8 | 2016-01-12,IBM,132.9,133.65,-0.005611672278338945 9 | 2016-01-13,IBM,131.17,133.5,-0.017453183520599345 10 | 2016-01-14,IBM,132.91,131.93,0.007428181611460545 11 | 2016-01-15,IBM,130.03,130.01,0.00015383432043696818 12 | 2016-01-19,IBM,128.11,130.11,-0.015371608638844054 13 | 2016-01-20,IBM,121.86,118.46,0.028701671450278625 14 | 2016-01-21,IBM,122.91,121.3,0.013272877164056056 15 | 2016-01-22,IBM,122.5,124.67,-0.01740595171252107 16 | 2016-01-25,IBM,122.08,122.1,-0.00016380016380013122 17 | 2016-01-26,IBM,122.59,122.25,0.0027811860940695574 18 | 2016-01-27,IBM,120.96,122.73,-0.014421901735517072 19 | 2016-01-28,IBM,122.22,121.26,0.007916872835230033 20 | 2016-01-29,IBM,124.79,123.28,0.012248539909149944 21 | 2016-02-01,IBM,124.83,124.4,0.003456591639871323 22 | 2016-02-02,IBM,122.94,123.67,-0.005902805854289674 23 | 2016-02-03,IBM,124.72,123.99,0.005887571578353125 24 | 2016-02-04,IBM,127.65,125.08,0.020546850015989826 25 | 2016-02-05,IBM,128.57,127.22,0.010611539066184518 26 | 2016-02-08,IBM,126.98,126.0,0.00777777777777781 27 | 2016-02-09,IBM,124.07,126.12,-0.016254360926102215 28 | 2016-02-10,IBM,120.19,125.0,-0.03848000000000002 29 | 2016-02-11,IBM,117.85,118.78,-0.007829600942919741 30 | 2016-02-12,IBM,121.04,119.26,0.014925373134328367 31 | 2016-02-16,IBM,122.74,121.83,0.007469424608060384 32 | 2016-02-17,IBM,126.1,123.71,0.019319375959906238 33 | 2016-02-18,IBM,132.45,130.0,0.01884615384615376 34 | 2016-02-19,IBM,133.08,132.36,0.00543970988213961 35 | 2016-02-22,IBM,133.77,133.84,-0.0005230125523012042 36 | 2016-02-23,IBM,132.4,133.14,-0.005558059185819294 37 | 2016-02-24,IBM,132.8,131.55,0.009502090459901177 38 | 2016-02-25,IBM,134.5,133.29,0.009077950333858564 39 | 2016-02-26,IBM,132.03,134.51,-0.018437290907739125 40 | 2016-02-29,IBM,131.03,132.0,-0.00734848484848484 41 | 2016-03-01,IBM,134.37,132.24,0.01610707803992737 42 | 2016-03-02,IBM,136.3,133.7,0.019446522064323284 43 | 2016-03-03,IBM,137.8,137.22,0.004226789097799246 44 | 2016-03-04,IBM,137.8,137.54,0.0018903591682421065 45 | 2016-03-07,IBM,140.15,137.28,0.02090617715617719 46 | 2016-03-08,IBM,139.07,139.71,-0.004580917615059872 47 | 2016-03-09,IBM,140.41,139.31,0.007896059148661217 48 | 2016-03-10,IBM,140.19,141.24,-0.007434154630416393 49 | 2016-03-11,IBM,142.36,141.73,0.004445071615042855 50 | 2016-03-14,IBM,142.78,142.01,0.005422153369481095 51 | 2016-03-15,IBM,142.96,141.74,0.00860730915761252 52 | 2016-03-16,IBM,144.79,142.62,0.015215257327163003 53 | 2016-03-17,IBM,147.04,144.78,0.015609890868904483 54 | 2016-03-18,IBM,147.09,147.4,-0.002103120759837193 55 | 2016-03-21,IBM,148.63,147.3,0.00902919212491503 56 | 2016-03-22,IBM,148.1,148.06,0.00027016074564360424 57 | 2016-03-23,IBM,145.4,148.0,-0.01756756756756753 58 | 2016-03-24,IBM,147.95,144.98,0.020485584218512893 59 | 2016-03-28,IBM,148.4,147.75,0.004399323181049108 60 | 2016-03-29,IBM,149.33,147.59,0.011789416627142823 61 | 2016-03-30,IBM,148.41,149.95,-0.01027009003000995 62 | 2016-03-31,IBM,151.45,149.79,0.011082181721076152 63 | 2016-04-01,IBM,152.52,150.51,0.013354594379111151 64 | 2016-04-04,IBM,152.07,152.34,-0.0017723513194171604 65 | 2016-04-05,IBM,150.0,151.43,-0.009443307138611945 66 | 2016-04-06,IBM,150.02,149.9,0.0008005336891261143 67 | 2016-04-07,IBM,148.25,149.07,-0.005500771449654479 68 | 2016-04-08,IBM,149.35,149.06,0.0019455252918287405 69 | 2016-04-11,IBM,149.25,150.26,-0.006721682417143557 70 | 2016-04-12,IBM,149.63,149.61,0.0001336809036827873 71 | 2016-04-13,IBM,151.23,150.75,0.003184079601989982 72 | 2016-04-14,IBM,151.16,151.5,-0.002244224422442267 73 | 2016-04-15,IBM,151.72,151.04,0.004502118644067842 74 | 2016-04-18,IBM,152.53,151.75,0.005140032948929167 75 | 2016-04-19,IBM,144.0,146.47,-0.01686352154024714 76 | 2016-04-20,IBM,146.11,144.24,0.012964503605102637 77 | 2016-04-21,IBM,149.3,146.58,0.018556419702551497 78 | 2016-04-22,IBM,148.5,149.44,-0.006290149892933604 79 | 2016-04-25,IBM,148.81,148.16,0.004387149028077793 80 | 2016-04-26,IBM,149.08,148.65,0.0028927009754457235 81 | 2016-04-27,IBM,150.47,149.35,0.007499163039839335 82 | 2016-04-28,IBM,147.07,149.75,-0.01789649415692826 83 | 2016-04-29,IBM,145.94,146.49,-0.0037545224930030127 84 | 2016-05-02,IBM,145.27,146.56,-0.008801855895196452 85 | 2016-05-03,IBM,144.13,144.65,-0.003594884203249293 86 | 2016-05-04,IBM,144.25,143.36,0.006208147321428476 87 | 2016-05-05,IBM,146.47,145.95,0.003562863994518741 88 | 2016-05-06,IBM,147.29,144.86,0.016774817064752024 89 | 2016-05-09,IBM,147.34,147.7,-0.0024373730534866978 90 | 2016-05-10,IBM,149.97,148.24,0.01167026443604958 91 | 2016-05-11,IBM,148.95,149.71,-0.005076481196980958 92 | 2016-05-12,IBM,148.84,149.21,-0.002479726559882076 93 | 2016-05-13,IBM,147.72,148.79,-0.007191343504267715 94 | 2016-05-16,IBM,149.46,147.65,0.012258719945817828 95 | 2016-05-17,IBM,148.0,149.21,-0.008109376047181878 96 | 2016-05-18,IBM,147.34,147.99,-0.0043921886613960785 97 | 2016-05-19,IBM,144.93,146.48,-0.010581649371927793 98 | 2016-05-20,IBM,147.25,145.71,0.010568938302106869 99 | 2016-05-23,IBM,146.77,147.61,-0.005690671363728767 100 | 2016-05-24,IBM,148.31,146.88,0.009735838779956475 101 | 2016-05-25,IBM,151.69,148.93,0.018532196333848054 102 | 2016-05-26,IBM,152.44,151.55,0.005872649290663057 103 | 2016-05-27,IBM,152.84,152.35,0.003216278306531074 104 | 2016-05-31,IBM,153.74,152.56,0.007734661772417454 105 | 2016-06-01,IBM,152.51,153.0,-0.0032026143790850267 106 | 2016-06-02,IBM,153.5,152.59,0.005963693557900233 107 | 2016-06-03,IBM,152.89,152.4,0.0032152230971127338 108 | 2016-06-06,IBM,152.73,153.09,-0.0023515579071135516 109 | 2016-06-07,IBM,153.33,153.31,0.00013045463440095382 110 | 2016-06-08,IBM,154.0,153.53,0.003061290952908219 111 | 2016-06-09,IBM,153.42,152.92,0.0032696834946377195 112 | 2016-06-10,IBM,152.37,152.79,-0.0027488709994108744 113 | 2016-06-13,IBM,151.28,151.63,-0.0023082503462375143 114 | 2016-06-14,IBM,151.06,151.28,-0.001454257006874662 115 | 2016-06-15,IBM,150.68,151.46,-0.005149874554337786 116 | 2016-06-16,IBM,151.06,150.19,0.005792662627338734 117 | 2016-06-17,IBM,151.99,150.96,0.006822999470058301 118 | 2016-06-20,IBM,153.61,152.6,0.006618610747051241 119 | 2016-06-21,IBM,154.05,154.16,-0.0007135443694861522 120 | 2016-06-22,IBM,152.92,153.75,-0.005398373983739919 121 | 2016-06-23,IBM,155.35,153.45,0.012381883349625323 122 | 2016-06-24,IBM,146.59,149.97,-0.022537840901513607 123 | 2016-06-27,IBM,143.5,146.18,-0.018333561362703563 124 | 2016-06-28,IBM,145.7,144.78,0.00635446884928849 125 | 2016-06-29,IBM,148.46,146.5,0.01337883959044374 126 | 2016-06-30,IBM,151.78,148.86,0.019615746338841777 127 | 2016-07-01,IBM,152.35,152.19,0.0010513174321571497 128 | 2016-07-05,IBM,151.68,151.19,0.0032409550896223896 129 | 2016-07-06,IBM,152.37,151.85,0.0034244320052684244 130 | 2016-07-07,IBM,152.6,152.75,-0.000981996726677615 131 | 2016-07-08,IBM,154.46,154.0,0.002987012987013039 132 | 2016-07-11,IBM,155.33,154.6,0.004721862871927673 133 | 2016-07-12,IBM,157.04,156.0,0.006666666666666616 134 | 2016-07-13,IBM,158.02,157.75,0.0017115689381934087 135 | 2016-07-14,IBM,160.28,158.81,0.009256344058938347 136 | 2016-07-15,IBM,159.78,159.9,-0.0007504690431519984 137 | 2016-07-18,IBM,159.86,159.3,0.0035153797865662413 138 | 2016-07-19,IBM,159.58,161.78,-0.013598714303374884 139 | 2016-07-20,IBM,161.36,159.97,0.00868912921172729 140 | 2016-07-21,IBM,160.45,160.75,-0.0018662519440125125 141 | 2016-07-22,IBM,162.07,160.78,0.008023385993282697 142 | 2016-07-25,IBM,162.65,162.0,0.004012345679012381 143 | 2016-07-26,IBM,162.12,162.65,-0.0032585305871503296 144 | 2016-07-27,IBM,161.83,162.12,-0.001788798420922724 145 | 2016-07-28,IBM,161.37,161.38,-6.196554715572503e-05 146 | 2016-07-29,IBM,160.62,161.36,-0.004586018839861236 147 | 2016-08-01,IBM,161.45,160.65,0.004979769685651932 148 | 2016-08-02,IBM,160.58,161.27,-0.004278539095926072 149 | 2016-08-03,IBM,160.67,160.13,0.0033722600387184917 150 | 2016-08-04,IBM,161.55,160.86,0.004289444237224902 151 | 2016-08-05,IBM,163.5,162.0,0.009259259259259259 152 | 2016-08-08,IBM,162.04,162.73,-0.0042401523996804386 153 | 2016-08-09,IBM,161.77,162.22,-0.002774010602884901 154 | 2016-08-10,IBM,162.08,162.19,-0.0006782169060976954 155 | 2016-08-11,IBM,163.53,162.25,0.00788906009244993 156 | 2016-08-12,IBM,161.95,163.19,-0.007598504810343827 157 | 2016-08-15,IBM,161.88,162.4,-0.0032019704433498167 158 | 2016-08-16,IBM,160.7,161.11,-0.002544845136863168 159 | 2016-08-17,IBM,160.44,160.97,-0.003292538982419091 160 | 2016-08-18,IBM,161.36,160.89,0.002921250543850005 161 | 2016-08-19,IBM,160.04,160.84,-0.004973887092763065 162 | 2016-08-22,IBM,160.0,160.0,0.0 163 | 2016-08-23,IBM,160.26,160.33,-0.00043659951350353394 164 | 2016-08-24,IBM,159.05,159.89,-0.0052536118581523236 165 | 2016-08-25,IBM,158.63,159.0,-0.002327044025157261 166 | 2016-08-26,IBM,158.32,158.88,-0.0035246727089627535 167 | 2016-08-29,IBM,159.72,158.83,0.00560347541396453 168 | 2016-08-30,IBM,159.4,159.76,-0.0022533800701050656 169 | 2016-08-31,IBM,158.88,159.66,-0.0048853814355505525 170 | 2016-09-01,IBM,159.54,158.32,0.007705912076806461 171 | 2016-09-02,IBM,159.55,159.88,-0.0020640480360269208 172 | 2016-09-06,IBM,160.35,159.88,0.002939704778583931 173 | 2016-09-07,IBM,161.64,160.19,0.009051751045633239 174 | 2016-09-08,IBM,159.0,160.55,-0.009654313298038064 175 | 2016-09-09,IBM,155.69,158.03,-0.014807315066759497 176 | 2016-09-12,IBM,158.29,155.26,0.01951565116578643 177 | 2016-09-13,IBM,155.81,157.63,-0.011546025502759584 178 | 2016-09-14,IBM,154.05,155.7,-0.010597302504816811 179 | 2016-09-15,IBM,155.66,154.3,0.008813998703823624 180 | 2016-09-16,IBM,153.84,155.04,-0.007739938080495283 181 | 2016-09-19,IBM,154.87,154.87,0.0 182 | 2016-09-20,IBM,154.45,155.87,-0.009110155899146826 183 | 2016-09-21,IBM,155.53,154.91,0.004002323930023914 184 | 2016-09-22,IBM,156.11,156.15,-0.0002561639449247009 185 | 2016-09-23,IBM,154.98,155.62,-0.004112581930343239 186 | 2016-09-26,IBM,153.98,154.46,-0.003107600673313597 187 | 2016-09-27,IBM,156.77,154.32,0.015876101607050396 188 | 2016-09-28,IBM,158.29,156.99,0.008280782215427626 189 | 2016-09-29,IBM,158.11,158.63,-0.003278068461198902 190 | 2016-09-30,IBM,158.85,158.9,-0.00031466331025809544 191 | 2016-10-03,IBM,157.61,158.06,-0.002847020118942102 192 | 2016-10-04,IBM,156.46,157.67,-0.007674256358216399 193 | 2016-10-05,IBM,157.08,157.07,6.366588145425179e-05 194 | 2016-10-06,IBM,156.88,156.84,0.00025503698036210176 195 | 2016-10-07,IBM,155.67,157.14,-0.009354715540282544 196 | 2016-10-10,IBM,157.02,156.71,0.0019781762491225974 197 | 2016-10-11,IBM,154.79,156.73,-0.012377974861226299 198 | 2016-10-12,IBM,154.29,154.97,-0.004387946054075026 199 | 2016-10-13,IBM,153.72,153.7,0.0001301236174366313 200 | 2016-10-14,IBM,154.45,154.47,-0.00012947497896038216 201 | 2016-10-17,IBM,154.77,154.45,0.002071867918420341 202 | 2016-10-18,IBM,150.72,150.02,0.004666044527396271 203 | 2016-10-19,IBM,151.26,151.27,-6.610696106312769e-05 204 | 2016-10-20,IBM,151.52,151.28,0.0015864621893178813 205 | 2016-10-21,IBM,149.63,150.58,-0.006308938770089102 206 | 2016-10-24,IBM,150.57,150.4,0.001130319148936087 207 | 2016-10-25,IBM,150.88,150.69,0.0012608666799389324 208 | 2016-10-26,IBM,151.81,150.71,0.007298785747461975 209 | 2016-10-27,IBM,153.35,152.82,0.0034681324433974686 210 | 2016-10-28,IBM,152.61,154.05,-0.009347614410905534 211 | 2016-10-31,IBM,153.69,152.76,0.006087981146897139 212 | 2016-11-01,IBM,152.79,153.5,-0.004625407166123831 213 | 2016-11-02,IBM,151.95,152.48,-0.0034758656873032606 214 | 2016-11-03,IBM,152.37,152.51,-0.0009179725919610935 215 | 2016-11-04,IBM,152.43,152.4,0.00019685039370079485 216 | 2016-11-07,IBM,155.72,153.99,0.011234495746476976 217 | 2016-11-08,IBM,155.17,154.56,0.003946687370600319 218 | 2016-11-09,IBM,154.81,152.96,0.01209466527196649 219 | 2016-11-10,IBM,160.22,157.66,0.016237473043257657 220 | 2016-11-11,IBM,161.27,159.97,0.008126523723198172 221 | 2016-11-14,IBM,158.21,161.25,-0.018852713178294525 222 | 2016-11-15,IBM,158.67,158.42,0.0015780835753061483 223 | 2016-11-16,IBM,159.29,158.46,0.005237914931212824 224 | 2016-11-17,IBM,159.8,159.22,0.003642758447431306 225 | 2016-11-18,IBM,160.39,159.8,0.0036921151439297554 226 | 2016-11-21,IBM,162.77,160.69,0.012944178231377263 227 | 2016-11-22,IBM,162.67,163.0,-0.00202453987730069 228 | 2016-11-23,IBM,161.98,161.94,0.00024700506360375476 229 | 2016-11-25,IBM,163.14,161.83,0.008094914416362687 230 | 2016-11-28,IBM,164.52,163.2,0.00808823529411778 231 | 2016-11-29,IBM,163.53,164.0,-0.0028658536585365784 232 | 2016-11-30,IBM,162.22,163.35,-0.006917661463115981 233 | 2016-12-01,IBM,159.82,161.95,-0.013152207471441775 234 | 2016-12-02,IBM,160.02,159.0,0.0064150943396227055 235 | 2016-12-05,IBM,159.84,160.85,-0.006279142057817787 236 | 2016-12-06,IBM,160.35,160.13,0.0013738837194779171 237 | 2016-12-07,IBM,164.79,160.6,0.026089663760896626 238 | 2016-12-08,IBM,165.36,164.87,0.0029720385758476926 239 | 2016-12-09,IBM,166.52,165.18,0.008112362271461457 240 | 2016-12-12,IBM,165.5,166.72,-0.007317658349328208 241 | 2016-12-13,IBM,168.29,165.68,0.015753259295026467 242 | 2016-12-14,IBM,168.51,168.37,0.0008315020490585398 243 | 2016-12-15,IBM,168.02,168.01,5.952026665090963e-05 244 | 2016-12-16,IBM,166.73,168.97,-0.013256791146357395 245 | 2016-12-19,IBM,166.68,166.83,-0.0008991188635137905 246 | 2016-12-20,IBM,167.6,167.49,0.0006567556272015357 247 | 2016-12-21,IBM,167.33,166.25,0.006496240601503835 248 | 2016-12-22,IBM,167.06,167.36,-0.0017925430210325726 249 | 2016-12-23,IBM,166.71,167.0,-0.0017365269461077368 250 | 2016-12-27,IBM,167.14,166.98,0.0009581985866570643 251 | 2016-12-28,IBM,166.19,167.29,-0.006575407974176546 252 | 2016-12-29,IBM,166.6,166.02,0.003493554993374196 253 | 2016-12-30,IBM,165.99,166.44,-0.0027036770007209123 254 | 2016-01-04,JPM,63.62,63.95,-0.005160281469898442 255 | 2016-01-05,JPM,63.73,63.7,0.0004709576138146629 256 | 2016-01-06,JPM,62.81,62.72,0.0014349489795918912 257 | 2016-01-07,JPM,60.27,61.46,-0.01936218678815486 258 | 2016-01-08,JPM,58.92,61.13,-0.036152461966301334 259 | 2016-01-11,JPM,58.83,58.83,0.0 260 | 2016-01-12,JPM,58.96,59.45,-0.008242220353238048 261 | 2016-01-13,JPM,57.34,59.46,-0.03565422132526064 262 | 2016-01-14,JPM,58.2,58.16,0.0006877579092160635 263 | 2016-01-15,JPM,57.04,56.45,0.010451727192205426 264 | 2016-01-19,JPM,57.01,57.73,-0.012471851723540602 265 | 2016-01-20,JPM,55.51,55.63,-0.002157109473305852 266 | 2016-01-21,JPM,55.25,55.74,-0.008790814495873735 267 | 2016-01-22,JPM,56.95,56.44,0.009036144578313345 268 | 2016-01-25,JPM,55.66,56.48,-0.014518413597733718 269 | 2016-01-26,JPM,57.08,55.85,0.02202327663384059 270 | 2016-01-27,JPM,57.04,57.08,-0.0007007708479327111 271 | 2016-01-28,JPM,57.28,57.52,-0.004172461752433971 272 | 2016-01-29,JPM,59.5,57.83,0.028877745114992248 273 | 2016-02-01,JPM,58.86,59.16,-0.0050709939148072545 274 | 2016-02-02,JPM,57.03,57.88,-0.014685556323427806 275 | 2016-02-03,JPM,57.41,57.37,0.000697228516646316 276 | 2016-02-04,JPM,58.4,57.06,0.023484051875219 277 | 2016-02-05,JPM,57.75,58.58,-0.01416865824513483 278 | 2016-02-08,JPM,56.54,56.69,-0.0026459693067560166 279 | 2016-02-09,JPM,56.2,55.29,0.016458672454331774 280 | 2016-02-10,JPM,55.52,56.57,-0.01856107477461547 281 | 2016-02-11,JPM,53.07,53.9,-0.015398886827458224 282 | 2016-02-12,JPM,57.49,55.65,0.03306379155435765 283 | 2016-02-16,JPM,58.35,58.23,0.0020607934054611807 284 | 2016-02-17,JPM,58.77,58.85,-0.0013593882752760968 285 | 2016-02-18,JPM,57.81,58.84,-0.017505098572399746 286 | 2016-02-19,JPM,57.82,57.5,0.0055652173913043525 287 | 2016-02-22,JPM,58.57,58.51,0.0010254657323534827 288 | 2016-02-23,JPM,56.12,57.9,-0.03074265975820382 289 | 2016-02-24,JPM,56.14,55.2,0.017028985507246335 290 | 2016-02-25,JPM,57.01,56.13,0.015677890611081335 291 | 2016-02-26,JPM,57.54,57.64,-0.0017349063150590115 292 | 2016-02-29,JPM,56.3,57.41,-0.01933461069500086 293 | 2016-03-01,JPM,59.2,56.76,0.04298801973220587 294 | 2016-03-02,JPM,59.76,59.2,0.009459459459459377 295 | 2016-03-03,JPM,59.96,59.58,0.006377979187646905 296 | 2016-03-04,JPM,60.05,60.1,-0.0008319467554077248 297 | 2016-03-07,JPM,59.94,59.54,0.006718172657037262 298 | 2016-03-08,JPM,58.78,59.21,-0.0072622867758824474 299 | 2016-03-09,JPM,59.12,59.15,-0.0005071851225697571 300 | 2016-03-10,JPM,58.61,59.59,-0.01644571236784702 301 | 2016-03-11,JPM,59.34,59.39,-0.000841892574507445 302 | 2016-03-14,JPM,59.12,59.15,-0.0005071851225697571 303 | 2016-03-15,JPM,59.2,58.54,0.011274342330030811 304 | 2016-03-16,JPM,58.92,58.98,-0.0010172939979653302 305 | 2016-03-17,JPM,58.75,58.77,-0.0003403096818105007 306 | 2016-03-18,JPM,60.48,60.05,0.007160699417152369 307 | 2016-03-21,JPM,60.46,60.22,0.00398538691464633 308 | 2016-03-22,JPM,60.24,59.99,0.004167361226871145 309 | 2016-03-23,JPM,59.94,60.34,-0.006629101756712059 310 | 2016-03-24,JPM,59.48,59.3,0.0030354131534569935 311 | 2016-03-28,JPM,59.4,59.53,-0.0021837728876197304 312 | 2016-03-29,JPM,59.03,59.33,-0.005056463846283451 313 | 2016-03-30,JPM,59.71,59.46,0.004204507231752439 314 | 2016-03-31,JPM,59.22,59.45,-0.0038687973086628086 315 | 2016-04-01,JPM,59.87,59.02,0.014401897661809458 316 | 2016-04-04,JPM,59.2,59.44,-0.00403768506056519 317 | 2016-04-05,JPM,58.36,58.59,-0.003925584570745929 318 | 2016-04-06,JPM,58.81,58.18,0.010828463389480965 319 | 2016-04-07,JPM,57.32,58.26,-0.016134569172674182 320 | 2016-04-08,JPM,57.74,57.71,0.0005198405822214718 321 | 2016-04-11,JPM,58.2,57.91,0.005007770678639376 322 | 2016-04-12,JPM,59.28,58.34,0.016112444292080867 323 | 2016-04-13,JPM,61.79,60.48,0.02166005291005295 324 | 2016-04-14,JPM,62.59,61.69,0.014589074404279555 325 | 2016-04-15,JPM,61.87,62.88,-0.0160623409669212 326 | 2016-04-18,JPM,62.27,61.64,0.010220635950681418 327 | 2016-04-19,JPM,63.32,62.55,0.012310151878497252 328 | 2016-04-20,JPM,64.24,63.48,0.011972274732199088 329 | 2016-04-21,JPM,63.6,64.26,-0.010270774976657387 330 | 2016-04-22,JPM,63.97,63.64,0.0051854179761156236 331 | 2016-04-25,JPM,63.6,63.6,0.0 332 | 2016-04-26,JPM,63.93,63.81,0.0018805829807239842 333 | 2016-04-27,JPM,64.11,63.86,0.0039148136548700285 334 | 2016-04-28,JPM,63.6,63.64,-0.0006285355122564291 335 | 2016-04-29,JPM,63.2,63.09,0.0017435409732128614 336 | 2016-05-02,JPM,63.79,63.69,0.0015701051970482246 337 | 2016-05-03,JPM,62.56,62.9,-0.005405405405405347 338 | 2016-05-04,JPM,61.57,61.75,-0.0029149797570850156 339 | 2016-05-05,JPM,61.24,61.6,-0.005844155844155835 340 | 2016-05-06,JPM,61.6,60.7,0.014827018121911013 341 | 2016-05-09,JPM,61.21,61.37,-0.0026071370376404856 342 | 2016-05-10,JPM,62.04,61.55,0.007961007311129196 343 | 2016-05-11,JPM,61.81,61.97,-0.0025818944650636854 344 | 2016-05-12,JPM,61.77,62.27,-0.008029548739360848 345 | 2016-05-13,JPM,61.2,61.7,-0.008103727714748784 346 | 2016-05-16,JPM,61.66,61.21,0.007351739911779051 347 | 2016-05-17,JPM,61.66,61.43,0.003744098974442404 348 | 2016-05-18,JPM,64.04,61.7,0.03792544570502437 349 | 2016-05-19,JPM,63.39,63.53,-0.0022036832992287196 350 | 2016-05-20,JPM,63.51,63.86,-0.005480739116818061 351 | 2016-05-23,JPM,63.46,63.45,0.0001576044129235305 352 | 2016-05-24,JPM,64.54,63.94,0.009383797309978239 353 | 2016-05-25,JPM,65.52,64.94,0.008931321219587285 354 | 2016-05-26,JPM,65.03,65.57,-0.008235473539728413 355 | 2016-05-27,JPM,65.43,65.21,0.003373715687778149 356 | 2016-05-31,JPM,65.27,65.73,-0.006998326487144499 357 | 2016-06-01,JPM,65.69,64.76,0.014360716491661403 358 | 2016-06-02,JPM,65.81,65.52,0.004426129426129521 359 | 2016-06-03,JPM,64.64,64.25,0.006070038910505845 360 | 2016-06-06,JPM,65.28,64.64,0.00990099009900991 361 | 2016-06-07,JPM,65.06,65.45,-0.0059587471352177315 362 | 2016-06-08,JPM,65.25,64.93,0.0049283844139841855 363 | 2016-06-09,JPM,64.75,64.79,-0.0006173792251891688 364 | 2016-06-10,JPM,63.84,63.93,-0.0014077897700609464 365 | 2016-06-13,JPM,63.27,63.48,-0.003308128544423342 366 | 2016-06-14,JPM,62.08,62.68,-0.009572431397575007 367 | 2016-06-15,JPM,61.97,62.41,-0.007050152219195606 368 | 2016-06-16,JPM,62.22,61.45,0.012530512611879511 369 | 2016-06-17,JPM,62.28,62.3,-0.0003210272873193583 370 | 2016-06-20,JPM,62.37,63.45,-0.017021276595744764 371 | 2016-06-21,JPM,62.95,62.73,0.0035070938944684518 372 | 2016-06-22,JPM,62.71,62.95,-0.0038125496425735024 373 | 2016-06-23,JPM,64.05,63.7,0.005494505494505405 374 | 2016-06-24,JPM,59.6,60.48,-0.014550264550264477 375 | 2016-06-27,JPM,57.61,58.71,-0.018736160790325352 376 | 2016-06-28,JPM,59.52,59.19,0.005575266092245403 377 | 2016-06-29,JPM,61.2,60.36,0.013916500994035842 378 | 2016-06-30,JPM,62.14,61.63,0.008275190653902288 379 | 2016-07-01,JPM,61.26,61.52,-0.004226267880364192 380 | 2016-07-05,JPM,59.55,60.45,-0.014888337468982724 381 | 2016-07-06,JPM,60.19,59.01,0.0199966107439417 382 | 2016-07-07,JPM,60.58,60.52,0.000991407799074606 383 | 2016-07-08,JPM,61.83,61.33,0.008152616990053808 384 | 2016-07-11,JPM,62.27,62.42,-0.002403075937199593 385 | 2016-07-12,JPM,63.2,63.03,0.0026971283515786404 386 | 2016-07-13,JPM,63.16,63.08,0.0012682308180088505 387 | 2016-07-14,JPM,64.12,64.74,-0.009576768612913043 388 | 2016-07-15,JPM,64.18,64.75,-0.008803088803088699 389 | 2016-07-18,JPM,63.96,64.13,-0.002650865429596049 390 | 2016-07-19,JPM,63.86,63.61,0.003930199654142431 391 | 2016-07-20,JPM,63.93,64.11,-0.002807674309780061 392 | 2016-07-21,JPM,63.69,64.0,-0.0048437500000000355 393 | 2016-07-22,JPM,64.04,63.9,0.002190923317684001 394 | 2016-07-25,JPM,63.87,63.98,-0.0017192872772741393 395 | 2016-07-26,JPM,64.13,63.98,0.002344482650828362 396 | 2016-07-27,JPM,64.33,64.08,0.0039013732833957553 397 | 2016-07-28,JPM,64.1,64.0,0.0015624999999999112 398 | 2016-07-29,JPM,63.97,63.8,0.0026645768025078636 399 | 2016-08-01,JPM,63.8,64.15,-0.005455962587685245 400 | 2016-08-02,JPM,63.65,63.59,0.0009435445824814463 401 | 2016-08-03,JPM,64.66,63.69,0.015230020411367545 402 | 2016-08-04,JPM,64.56,64.49,0.0010854396030393456 403 | 2016-08-05,JPM,66.3,65.14,0.0178077985876573 404 | 2016-08-08,JPM,66.1,66.07,0.0004540638716512962 405 | 2016-08-09,JPM,65.87,66.18,-0.004684194620731373 406 | 2016-08-10,JPM,65.28,65.92,-0.009708737864077678 407 | 2016-08-11,JPM,65.46,65.27,0.002910985138654784 408 | 2016-08-12,JPM,65.32,64.97,0.005387101739264188 409 | 2016-08-15,JPM,65.72,65.56,0.0024405125076265495 410 | 2016-08-16,JPM,65.71,65.36,0.00535495716034263 411 | 2016-08-17,JPM,65.89,65.8,0.0013677811550152495 412 | 2016-08-18,JPM,65.95,65.62,0.005028954587016127 413 | 2016-08-19,JPM,65.86,65.72,0.0021302495435179636 414 | 2016-08-22,JPM,65.8,65.75,0.0007604562737642154 415 | 2016-08-23,JPM,65.77,66.07,-0.004540638716512747 416 | 2016-08-24,JPM,65.95,65.99,-0.0006061524473403855 417 | 2016-08-25,JPM,66.07,65.91,0.00242755272341066 418 | 2016-08-26,JPM,66.22,66.33,-0.0016583747927031423 419 | 2016-08-29,JPM,66.95,66.49,0.0069183335839977135 420 | 2016-08-30,JPM,67.5,66.96,0.008064516129032352 421 | 2016-08-31,JPM,67.5,67.46,0.0005929439667952306 422 | 2016-09-01,JPM,67.21,67.64,-0.0063571850975755 423 | 2016-09-02,JPM,67.49,67.4,0.0013353115727001363 424 | 2016-09-06,JPM,67.44,67.5,-0.0008888888888889225 425 | 2016-09-07,JPM,67.16,67.16,0.0 426 | 2016-09-08,JPM,67.25,67.22,0.0004462957453139116 427 | 2016-09-09,JPM,66.65,67.03,-0.0056691033865432705 428 | 2016-09-12,JPM,67.06,66.14,0.013909888116117352 429 | 2016-09-13,JPM,66.53,66.11,0.006353047950385746 430 | 2016-09-14,JPM,66.4,66.27,0.001961671948091288 431 | 2016-09-15,JPM,66.64,66.29,0.005279831045406461 432 | 2016-09-16,JPM,65.82,66.09,-0.00408533817521577 433 | 2016-09-19,JPM,66.19,66.15,0.0006046863189719129 434 | 2016-09-20,JPM,66.46,66.75,-0.004344569288389607 435 | 2016-09-21,JPM,66.84,66.84,0.0 436 | 2016-09-22,JPM,67.39,66.99,0.00597104045379916 437 | 2016-09-23,JPM,67.25,67.39,-0.0020774595637335002 438 | 2016-09-26,JPM,65.78,66.6,-0.012312312312312211 439 | 2016-09-27,JPM,66.36,65.41,0.014523773123375674 440 | 2016-09-28,JPM,66.71,66.58,0.0019525382997896583 441 | 2016-09-29,JPM,65.65,66.7,-0.01574212893553219 442 | 2016-09-30,JPM,66.59,66.08,0.007717917675544872 443 | 2016-10-03,JPM,66.51,66.35,0.0024114544084402533 444 | 2016-10-04,JPM,66.6,66.21,0.005890348889895795 445 | 2016-10-05,JPM,67.69,66.89,0.011959934220361745 446 | 2016-10-06,JPM,67.87,67.73,0.0020670308578178143 447 | 2016-10-07,JPM,68.11,67.79,0.004720460244873774 448 | 2016-10-10,JPM,68.64,68.34,0.004389815627743593 449 | 2016-10-11,JPM,68.31,68.5,-0.002773722627737193 450 | 2016-10-12,JPM,68.13,68.26,-0.0019044828596544046 451 | 2016-10-13,JPM,67.74,67.46,0.004150607767565982 452 | 2016-10-14,JPM,67.52,68.8,-0.018604651162790715 453 | 2016-10-17,JPM,67.17,67.42,-0.003708098487095817 454 | 2016-10-18,JPM,67.7,67.85,-0.0022107590272659027 455 | 2016-10-19,JPM,68.35,67.81,0.007963427223123315 456 | 2016-10-20,JPM,68.26,68.08,0.0026439482961223095 457 | 2016-10-21,JPM,68.49,67.81,0.010028019466155325 458 | 2016-10-24,JPM,68.87,68.97,-0.0014499057561257694 459 | 2016-10-25,JPM,68.8,68.88,-0.001161440185830405 460 | 2016-10-26,JPM,69.13,68.37,0.011115986543805629 461 | 2016-10-27,JPM,69.23,69.49,-0.0037415455461216134 462 | 2016-10-28,JPM,69.11,69.53,-0.006040558032503979 463 | 2016-10-31,JPM,69.26,69.43,-0.00244850928993233 464 | 2016-11-01,JPM,68.97,69.48,-0.007340241796200419 465 | 2016-11-02,JPM,68.68,68.65,0.0004369992716678971 466 | 2016-11-03,JPM,68.38,68.86,-0.006970665117630032 467 | 2016-11-04,JPM,67.76,68.49,-0.010658490290553217 468 | 2016-11-07,JPM,69.88,69.08,0.011580775911986063 469 | 2016-11-08,JPM,70.03,69.7,0.004734576757532256 470 | 2016-11-09,JPM,73.25,71.46,0.02504897844948232 471 | 2016-11-10,JPM,76.65,74.22,0.032740501212611246 472 | 2016-11-11,JPM,76.69,76.3,0.005111402359108789 473 | 2016-11-14,JPM,79.51,77.25,0.029255663430420777 474 | 2016-11-15,JPM,79.36,78.37,0.012632384841138124 475 | 2016-11-16,JPM,77.4,78.22,-0.010483252365123923 476 | 2016-11-17,JPM,78.02,77.93,0.001154882586936856 477 | 2016-11-18,JPM,77.71,77.96,-0.003206772703950744 478 | 2016-11-21,JPM,78.05,78.0,0.0006410256410256046 479 | 2016-11-22,JPM,78.53,78.34,0.0024253255042123783 480 | 2016-11-23,JPM,78.86,78.87,-0.00012679092177006612 481 | 2016-11-25,JPM,78.83,79.1,-0.003413400758533452 482 | 2016-11-28,JPM,78.32,78.18,0.001790739319518884 483 | 2016-11-29,JPM,78.92,78.39,0.006761066462559014 484 | 2016-11-30,JPM,80.17,79.92,0.003128128128128128 485 | 2016-12-01,JPM,81.79,80.65,0.014135151890886552 486 | 2016-12-02,JPM,81.6,81.8,-0.0024449877750611594 487 | 2016-12-05,JPM,83.26,82.3,0.011664641555285639 488 | 2016-12-06,JPM,83.69,83.6,0.001076555023923486 489 | 2016-12-07,JPM,84.07,83.55,0.0062238180730101265 490 | 2016-12-08,JPM,85.12,84.23,0.010566306541612258 491 | 2016-12-09,JPM,85.49,85.02,0.005528111032698175 492 | 2016-12-12,JPM,84.73,85.36,-0.007380506091846245 493 | 2016-12-13,JPM,84.76,84.98,-0.0025888444339844533 494 | 2016-12-14,JPM,84.73,83.88,0.010133524082022038 495 | 2016-12-15,JPM,86.0,85.4,0.007025761124121713 496 | 2016-12-16,JPM,84.94,86.29,-0.015644918298760094 497 | 2016-12-19,JPM,85.43,84.8,0.0074292452830189825 498 | 2016-12-20,JPM,86.53,85.79,0.008625713952675076 499 | 2016-12-21,JPM,86.75,86.43,0.003702418141848816 500 | 2016-12-22,JPM,86.89,86.44,0.005205923183711277 501 | 2016-12-23,JPM,87.05,87.0,0.0005747126436781283 502 | 2016-12-27,JPM,87.13,87.05,0.0009190120620332946 503 | 2016-12-28,JPM,86.5,87.16,-0.007572280862781053 504 | 2016-12-29,JPM,85.89,86.58,-0.007969507969507943 505 | 2016-12-30,JPM,86.29,86.1,0.0022067363530779553 506 | 2016-01-04,GOOGL,759.44,762.2,-0.003621096824980308 507 | 2016-01-05,GOOGL,761.53,764.1,-0.0033634341054836407 508 | 2016-01-06,GOOGL,759.33,750.37,0.011940775883897326 509 | 2016-01-07,GOOGL,741.0,746.49,-0.0073544186794196964 510 | 2016-01-08,GOOGL,730.91,747.8,-0.02258625300882587 511 | 2016-01-11,GOOGL,733.07,731.95,0.00153015916387732 512 | 2016-01-12,GOOGL,745.34,740.75,0.006196422544718234 513 | 2016-01-13,GOOGL,719.57,749.34,-0.039728294232257697 514 | 2016-01-14,GOOGL,731.39,724.44,0.009593617138755358 515 | 2016-01-15,GOOGL,710.49,709.99,0.0007042352709193087 516 | 2016-01-19,GOOGL,719.08,720.15,-0.0014858015691174566 517 | 2016-01-20,GOOGL,718.56,705.9,0.01793455163620905 518 | 2016-01-21,GOOGL,726.67,720.17,0.009025646722301679 519 | 2016-01-22,GOOGL,745.46,742.0,0.004663072776280372 520 | 2016-01-25,GOOGL,733.62,743.84,-0.013739513873951423 521 | 2016-01-26,GOOGL,733.79,735.21,-0.0019314209545573003 522 | 2016-01-27,GOOGL,717.58,735.89,-0.02488143608419729 523 | 2016-01-28,GOOGL,748.3,738.19,0.013695661008683266 524 | 2016-01-29,GOOGL,761.35,748.96,0.01654293954283271 525 | 2016-02-01,GOOGL,770.77,771.26,-0.0006353240152477882 526 | 2016-02-02,GOOGL,780.91,800.5,-0.024472204871955068 527 | 2016-02-03,GOOGL,749.38,786.28,-0.04692984687388714 528 | 2016-02-04,GOOGL,730.03,744.59,-0.019554385635047553 529 | 2016-02-05,GOOGL,703.76,725.5,-0.02996554100620263 530 | 2016-02-08,GOOGL,704.16,687.68,0.02396463471382041 531 | 2016-02-09,GOOGL,701.02,692.95,0.011645861894797513 532 | 2016-02-10,GOOGL,706.85,711.79,-0.006940249230812376 533 | 2016-02-11,GOOGL,706.36,696.34,0.014389522359766755 534 | 2016-02-12,GOOGL,706.89,712.21,-0.007469706968450386 535 | 2016-02-16,GOOGL,717.64,718.65,-0.00140541292701592 536 | 2016-02-17,GOOGL,731.97,727.0,0.00683631361760664 537 | 2016-02-18,GOOGL,717.51,733.96,-0.022412665540356484 538 | 2016-02-19,GOOGL,722.11,715.9,0.008674395865344372 539 | 2016-02-22,GOOGL,729.05,729.51,-0.0006305602390646274 540 | 2016-02-23,GOOGL,717.29,726.1,-0.012133314970389834 541 | 2016-02-24,GOOGL,720.9,710.61,0.014480516739139561 542 | 2016-02-25,GOOGL,729.12,722.93,0.008562378100231081 543 | 2016-02-26,GOOGL,724.86,733.6,-0.011913849509269369 544 | 2016-02-29,GOOGL,717.22,721.0,-0.005242718446601904 545 | 2016-03-01,GOOGL,742.17,721.3,0.028933869402467775 546 | 2016-03-02,GOOGL,739.48,742.87,-0.004563382556840344 547 | 2016-03-03,GOOGL,731.59,739.48,-0.010669659760913055 548 | 2016-03-04,GOOGL,730.22,734.8,-0.006232988568317811 549 | 2016-03-07,GOOGL,712.8,725.15,-0.017030959111907912 550 | 2016-03-08,GOOGL,713.53,708.39,0.007255890117025913 551 | 2016-03-09,GOOGL,725.41,715.16,0.014332457072543207 552 | 2016-03-10,GOOGL,732.17,727.79,0.006018219541351208 553 | 2016-03-11,GOOGL,744.87,739.95,0.006649097912021027 554 | 2016-03-14,GOOGL,750.24,744.97,0.007074110366860386 555 | 2016-03-15,GOOGL,750.57,746.02,0.006099032197528308 556 | 2016-03-16,GOOGL,757.36,749.05,0.011094052466457593 557 | 2016-03-17,GOOGL,758.48,757.65,0.0010954926417211653 558 | 2016-03-18,GOOGL,755.41,761.63,-0.008166695114425675 559 | 2016-03-21,GOOGL,762.16,753.91,0.010942950750089534 560 | 2016-03-22,GOOGL,760.05,758.44,0.0021227783344758976 561 | 2016-03-23,GOOGL,757.56,763.35,-0.007584987227353216 562 | 2016-03-24,GOOGL,754.84,751.2,0.004845580404685817 563 | 2016-03-28,GOOGL,753.28,756.17,-0.0038218919026144736 564 | 2016-03-29,GOOGL,765.89,753.68,0.016200509500053122 565 | 2016-03-30,GOOGL,768.34,768.21,0.00016922456099243105 566 | 2016-03-31,GOOGL,762.9,768.34,-0.007080198870291868 567 | 2016-04-01,GOOGL,769.67,757.16,0.01652226742036028 568 | 2016-04-04,GOOGL,765.12,769.51,-0.005704929110732787 569 | 2016-04-05,GOOGL,758.57,758.13,0.0005803753973593639 570 | 2016-04-06,GOOGL,768.07,757.84,0.013498891586614612 571 | 2016-04-07,GOOGL,760.12,765.32,-0.006794543458945337 572 | 2016-04-08,GOOGL,759.47,765.87,-0.00835650959040043 573 | 2016-04-11,GOOGL,757.54,765.45,-0.010333790580704267 574 | 2016-04-12,GOOGL,764.32,758.43,0.007766043009902167 575 | 2016-04-13,GOOGL,771.91,770.31,0.0020770858485545077 576 | 2016-04-14,GOOGL,775.39,775.36,3.869170449852032e-05 577 | 2016-04-15,GOOGL,780.0,775.5,0.005802707930367505 578 | 2016-04-18,GOOGL,787.68,780.19,0.009600225586075052 579 | 2016-04-19,GOOGL,776.25,790.5,-0.018026565464895637 580 | 2016-04-20,GOOGL,774.92,779.16,-0.005441757790440999 581 | 2016-04-21,GOOGL,780.0,777.31,0.0034606527640195736 582 | 2016-04-22,GOOGL,737.77,743.91,-0.008253686601873865 583 | 2016-04-25,GOOGL,742.21,735.35,0.009328891004283692 584 | 2016-04-26,GOOGL,725.37,744.42,-0.025590392520351356 585 | 2016-04-27,GOOGL,721.46,725.32,-0.005321789003474347 586 | 2016-04-28,GOOGL,705.06,723.29,-0.025204274910478535 587 | 2016-04-29,GOOGL,707.88,704.12,0.005339998863830016 588 | 2016-05-02,GOOGL,714.41,711.92,0.003497583998202058 589 | 2016-05-03,GOOGL,708.44,712.5,-0.005698245614035011 590 | 2016-05-04,GOOGL,711.37,706.77,0.006508482250237026 591 | 2016-05-05,GOOGL,714.71,715.0,-0.0004055944055943547 592 | 2016-05-06,GOOGL,725.18,712.2,0.018225217635495512 593 | 2016-05-09,GOOGL,729.13,726.7,0.0033438833081050638 594 | 2016-05-10,GOOGL,739.38,734.96,0.006013932731032926 595 | 2016-05-11,GOOGL,730.55,740.52,-0.013463512126613768 596 | 2016-05-12,GOOGL,728.07,732.0,-0.005368852459016325 597 | 2016-05-13,GOOGL,724.83,726.62,-0.0024634609562081467 598 | 2016-05-16,GOOGL,730.3,724.32,0.008256019438921892 599 | 2016-05-17,GOOGL,720.19,731.06,-0.014868820616638705 600 | 2016-05-18,GOOGL,721.78,718.5,0.004565066109951249 601 | 2016-05-19,GOOGL,715.31,718.3,-0.004162606153417805 602 | 2016-05-20,GOOGL,721.71,716.46,0.007327694497948245 603 | 2016-05-23,GOOGL,717.25,719.98,-0.003791771993666516 604 | 2016-05-24,GOOGL,733.03,719.85,0.01830937000764041 605 | 2016-05-25,GOOGL,738.1,735.0,0.004217687074829963 606 | 2016-05-26,GOOGL,736.93,736.0,0.0012635869565216713 607 | 2016-05-27,GOOGL,747.6,737.51,0.013681170424807843 608 | 2016-05-31,GOOGL,748.85,748.76,0.00012019872856460259 609 | 2016-06-01,GOOGL,748.46,748.47,-1.3360588934748092e-05 610 | 2016-06-02,GOOGL,744.27,746.1,-0.0024527543224769346 611 | 2016-06-03,GOOGL,735.86,741.49,-0.007592819862708863 612 | 2016-06-06,GOOGL,730.06,738.5,-0.011428571428571503 613 | 2016-06-07,GOOGL,731.09,733.27,-0.0029729840304389245 614 | 2016-06-08,GOOGL,742.93,739.5,0.004638269100743678 615 | 2016-06-09,GOOGL,742.52,737.07,0.007394141669040839 616 | 2016-06-10,GOOGL,733.19,735.95,-0.0037502547727427007 617 | 2016-06-13,GOOGL,731.88,729.82,0.0028226137951822988 618 | 2016-06-14,GOOGL,733.25,729.31,0.005402366620504388 619 | 2016-06-15,GOOGL,732.19,734.92,-0.0037146900342893167 620 | 2016-06-16,GOOGL,724.25,727.96,-0.005096433869992907 621 | 2016-06-17,GOOGL,704.25,721.39,-0.023759686161438316 622 | 2016-06-20,GOOGL,706.13,710.31,-0.0058847545437906695 623 | 2016-06-21,GOOGL,708.88,710.05,-0.0016477712837123571 624 | 2016-06-22,GOOGL,710.47,714.05,-0.005013654505986874 625 | 2016-06-23,GOOGL,714.87,710.55,0.006079797340088735 626 | 2016-06-24,GOOGL,685.2,690.17,-0.007201124360664639 627 | 2016-06-27,GOOGL,681.14,682.49,-0.001978050960453666 628 | 2016-06-28,GOOGL,691.26,691.37,-0.00015910438694188877 629 | 2016-06-29,GOOGL,695.19,694.26,0.0013395557860168578 630 | 2016-06-30,GOOGL,703.53,697.65,0.008428294990324655 631 | 2016-07-01,GOOGL,710.25,705.1,0.007303928520777162 632 | 2016-07-05,GOOGL,704.89,705.01,-0.00017021035162622451 633 | 2016-07-06,GOOGL,708.97,699.84,0.013045839048925461 634 | 2016-07-07,GOOGL,707.26,710.11,-0.004013462702961545 635 | 2016-07-08,GOOGL,717.78,710.56,0.010160999774825529 636 | 2016-07-11,GOOGL,727.2,719.42,0.010814267048455822 637 | 2016-07-12,GOOGL,732.51,731.92,0.0008060990272161327 638 | 2016-07-13,GOOGL,729.48,735.52,-0.008211877311289922 639 | 2016-07-14,GOOGL,735.8,733.94,0.002534267106302831 640 | 2016-07-15,GOOGL,735.63,741.0,-0.0072469635627530424 641 | 2016-07-18,GOOGL,753.2,737.91,0.020720684094266344 642 | 2016-07-19,GOOGL,753.41,749.87,0.004720818275167647 643 | 2016-07-20,GOOGL,757.08,754.05,0.004018301173662339 644 | 2016-07-21,GOOGL,754.41,757.0,-0.0034214002642008346 645 | 2016-07-22,GOOGL,759.28,757.32,0.002588073733692392 646 | 2016-07-25,GOOGL,757.52,757.68,-0.00021117094287821797 647 | 2016-07-26,GOOGL,757.65,757.52,0.00017161263068961275 648 | 2016-07-27,GOOGL,761.97,758.97,0.003952725404166173 649 | 2016-07-28,GOOGL,765.84,768.84,-0.003901982206961136 650 | 2016-07-29,GOOGL,791.34,797.71,-0.007985358087525547 651 | 2016-08-01,GOOGL,800.94,786.67,0.018139753645111795 652 | 2016-08-02,GOOGL,800.12,797.33,0.00349917850827131 653 | 2016-08-03,GOOGL,798.92,796.47,0.0030760731728752266 654 | 2016-08-04,GOOGL,797.25,798.24,-0.0012402285027059644 655 | 2016-08-05,GOOGL,806.93,800.11,0.008523827973653543 656 | 2016-08-08,GOOGL,805.23,806.0,-0.0009553349875930296 657 | 2016-08-09,GOOGL,807.48,804.49,0.0037166403560019504 658 | 2016-08-10,GOOGL,808.49,807.05,0.0017842760671582364 659 | 2016-08-11,GOOGL,808.2,810.47,-0.0028008439547422873 660 | 2016-08-12,GOOGL,807.05,805.09,0.0024345104274055354 661 | 2016-08-15,GOOGL,805.96,807.21,-0.0015485437494580096 662 | 2016-08-16,GOOGL,801.19,803.5,-0.0028749222153079596 663 | 2016-08-17,GOOGL,805.42,800.0,0.006774999999999949 664 | 2016-08-18,GOOGL,802.75,805.36,-0.003240786728916278 665 | 2016-08-19,GOOGL,799.65,799.79,-0.0001750459495617429 666 | 2016-08-22,GOOGL,796.95,798.51,-0.001953638651989262 667 | 2016-08-23,GOOGL,796.59,800.48,-0.004859584249450313 668 | 2016-08-24,GOOGL,793.6,796.86,-0.004091057400296151 669 | 2016-08-25,GOOGL,791.3,792.0,-0.0008838383838384412 670 | 2016-08-26,GOOGL,793.22,792.49,0.0009211472699971207 671 | 2016-08-29,GOOGL,795.82,793.05,0.0034928440829709293 672 | 2016-08-30,GOOGL,791.92,792.88,-0.0012107759055595252 673 | 2016-08-31,GOOGL,789.85,789.6,0.0003166160081053698 674 | 2016-09-01,GOOGL,791.4,791.98,-0.0007323417258012083 675 | 2016-09-02,GOOGL,796.87,795.27,0.002011895331145426 676 | 2016-09-06,GOOGL,808.02,798.39,0.012061774320820647 677 | 2016-09-07,GOOGL,807.99,807.93,7.426385949285101e-05 678 | 2016-09-08,GOOGL,802.84,805.22,-0.0029557139663694337 679 | 2016-09-09,GOOGL,788.48,798.77,-0.012882306546314915 680 | 2016-09-12,GOOGL,798.82,784.52,0.018227706113292292 681 | 2016-09-13,GOOGL,788.72,794.01,-0.006662384604727854 682 | 2016-09-14,GOOGL,790.46,787.53,0.0037204931875611897 683 | 2016-09-15,GOOGL,801.23,790.01,0.014202351868963719 684 | 2016-09-16,GOOGL,797.97,799.02,-0.0013141097844859384 685 | 2016-09-19,GOOGL,795.39,801.11,-0.007140093120794931 686 | 2016-09-20,GOOGL,799.78,800.0,-0.0002750000000000341 687 | 2016-09-21,GOOGL,805.03,801.26,0.004705089484062579 688 | 2016-09-22,GOOGL,815.95,810.0,0.0073456790123457355 689 | 2016-09-23,GOOGL,814.96,815.14,-0.00022082096327005174 690 | 2016-09-26,GOOGL,802.65,809.82,-0.00885381936726689 691 | 2016-09-27,GOOGL,810.73,801.83,0.011099609642941741 692 | 2016-09-28,GOOGL,810.06,804.08,0.007437070938214984 693 | 2016-09-29,GOOGL,802.64,807.23,-0.005686111764924534 694 | 2016-09-30,GOOGL,804.06,803.6,0.0005724240915877584 695 | 2016-10-03,GOOGL,800.38,802.55,-0.002703881378107232 696 | 2016-10-04,GOOGL,802.79,805.0,-0.0027453416149068777 697 | 2016-10-05,GOOGL,801.23,806.0,-0.005918114143920573 698 | 2016-10-06,GOOGL,803.08,804.08,-0.0012436573475276091 699 | 2016-10-07,GOOGL,800.71,805.93,-0.0064769893166899285 700 | 2016-10-10,GOOGL,814.17,803.93,0.012737427387956675 701 | 2016-10-11,GOOGL,809.57,814.17,-0.0056499256911946025 702 | 2016-10-12,GOOGL,811.77,811.96,-0.0002340016749594248 703 | 2016-10-13,GOOGL,804.08,806.07,-0.002468768221122246 704 | 2016-10-14,GOOGL,804.6,807.45,-0.0035296303176667564 705 | 2016-10-17,GOOGL,806.84,805.99,0.001054603655132226 706 | 2016-10-18,GOOGL,821.49,814.21,0.008941182250279378 707 | 2016-10-19,GOOGL,827.09,824.52,0.0031169650220735094 708 | 2016-10-20,GOOGL,821.63,827.56,-0.007165643578713266 709 | 2016-10-21,GOOGL,824.06,820.0,0.004951219512195055 710 | 2016-10-24,GOOGL,835.74,830.09,0.006806490862436575 711 | 2016-10-25,GOOGL,828.55,838.5,-0.011866428145497968 712 | 2016-10-26,GOOGL,822.1,827.12,-0.006069252345487936 713 | 2016-10-27,GOOGL,817.35,823.01,-0.006877194687792333 714 | 2016-10-28,GOOGL,819.56,829.94,-0.012506928211678084 715 | 2016-10-31,GOOGL,809.9,822.43,-0.015235339177802334 716 | 2016-11-01,GOOGL,805.48,810.87,-0.006647181422422813 717 | 2016-11-02,GOOGL,788.42,806.76,-0.022732906936387565 718 | 2016-11-03,GOOGL,782.19,784.5,-0.0029445506692159914 719 | 2016-11-04,GOOGL,781.1,771.3,0.012705821340593892 720 | 2016-11-07,GOOGL,802.03,794.95,0.008906220517013556 721 | 2016-11-08,GOOGL,811.98,802.03,0.012406019724948002 722 | 2016-11-09,GOOGL,805.59,801.83,0.004689273287355164 723 | 2016-11-10,GOOGL,780.29,810.0,-0.03667901234567906 724 | 2016-11-11,GOOGL,771.75,776.81,-0.006513819338062004 725 | 2016-11-14,GOOGL,753.22,771.76,-0.024023012335441022 726 | 2016-11-15,GOOGL,775.16,765.47,0.012658889309835709 727 | 2016-11-16,GOOGL,779.98,770.42,0.01240881597050967 728 | 2016-11-17,GOOGL,786.16,782.5,0.004677316293929672 729 | 2016-11-18,GOOGL,775.97,787.17,-0.01422818450906403 730 | 2016-11-21,GOOGL,784.8,778.1,0.00861071841665587 731 | 2016-11-22,GOOGL,785.0,788.99,-0.0050570983155680165 732 | 2016-11-23,GOOGL,779.0,789.52,-0.013324551626304568 733 | 2016-11-25,GOOGL,780.23,782.61,-0.0030411060426010343 734 | 2016-11-28,GOOGL,785.79,778.35,0.00955868182694153 735 | 2016-11-29,GOOGL,789.44,788.38,0.001344529287906922 736 | 2016-11-30,GOOGL,775.88,789.1,-0.01675326321125336 737 | 2016-12-01,GOOGL,764.33,778.55,-0.018264722882281054 738 | 2016-12-02,GOOGL,764.46,761.9,0.0033600210001313285 739 | 2016-12-05,GOOGL,778.22,770.0,0.010675324675324711 740 | 2016-12-06,GOOGL,776.18,780.19,-0.005139773644881509 741 | 2016-12-07,GOOGL,791.47,779.95,0.014770177575485583 742 | 2016-12-08,GOOGL,795.17,792.95,0.002799672110473439 743 | 2016-12-09,GOOGL,809.45,799.3,0.01269861128487438 744 | 2016-12-12,GOOGL,807.9,804.82,0.0038269426704106843 745 | 2016-12-13,GOOGL,815.34,812.39,0.0036312608476225033 746 | 2016-12-14,GOOGL,817.89,815.92,0.002414452397293886 747 | 2016-12-15,GOOGL,815.65,817.36,-0.002092101399628115 748 | 2016-12-16,GOOGL,809.84,818.31,-0.01035060062812371 749 | 2016-12-19,GOOGL,812.5,809.28,0.003978845393436174 750 | 2016-12-20,GOOGL,815.2,813.37,0.002249898570146478 751 | 2016-12-21,GOOGL,812.2,815.72,-0.004315206198205244 752 | 2016-12-22,GOOGL,809.68,809.1,0.0007168458781361107 753 | 2016-12-23,GOOGL,807.8,808.01,-0.0002598977735424517 754 | 2016-12-27,GOOGL,809.93,808.68,0.00154572884206361 755 | 2016-12-28,GOOGL,804.57,813.33,-0.010770535944819434 756 | 2016-12-29,GOOGL,802.88,802.33,0.0006855034711402471 757 | 2016-12-30,GOOGL,792.45,803.21,-0.013396247556678814 758 | 2016-01-04,AMZN,636.99,656.29,-0.029407731338280264 759 | 2016-01-05,AMZN,633.79,646.86,-0.02020529944655729 760 | 2016-01-06,AMZN,632.65,622.0,0.017122186495176814 761 | 2016-01-07,AMZN,607.94,621.8,-0.022290125442264233 762 | 2016-01-08,AMZN,607.05,619.66,-0.0203498692831553 763 | 2016-01-11,AMZN,617.74,612.48,0.008588035527690685 764 | 2016-01-12,AMZN,617.89,625.25,-0.01177129148340666 765 | 2016-01-13,AMZN,581.81,620.88,-0.06292681355495434 766 | 2016-01-14,AMZN,593.0,580.25,0.021973287376130978 767 | 2016-01-15,AMZN,570.18,572.24,-0.003599888158814587 768 | 2016-01-19,AMZN,574.48,577.09,-0.004522691434611609 769 | 2016-01-20,AMZN,571.77,564.36,0.013129917074207896 770 | 2016-01-21,AMZN,575.02,573.58,0.0025105477875796587 771 | 2016-01-22,AMZN,596.38,588.73,0.012994071985460189 772 | 2016-01-25,AMZN,596.53,597.99,-0.0024415123998729684 773 | 2016-01-26,AMZN,601.25,603.45,-0.003645703869417591 774 | 2016-01-27,AMZN,583.35,601.99,-0.03096396950115448 775 | 2016-01-28,AMZN,635.35,608.37,0.044348011900652594 776 | 2016-01-29,AMZN,587.0,571.98,0.02625965942865132 777 | 2016-02-01,AMZN,574.81,578.15,-0.00577704747902799 778 | 2016-02-02,AMZN,552.1,570.0,-0.03140350877192979 779 | 2016-02-03,AMZN,531.07,553.5,-0.04052393857271897 780 | 2016-02-04,AMZN,536.26,525.0,0.02144761904761903 781 | 2016-02-05,AMZN,502.13,529.28,-0.05129610036275691 782 | 2016-02-08,AMZN,488.1,486.47,0.003350669106008583 783 | 2016-02-09,AMZN,482.07,478.01,0.008493546160122179 784 | 2016-02-10,AMZN,490.48,491.76,-0.0026028957214901025 785 | 2016-02-11,AMZN,503.82,491.17,0.025754830303153647 786 | 2016-02-12,AMZN,507.08,510.7,-0.007088310162522038 787 | 2016-02-16,AMZN,521.1,519.48,0.0031185031185031273 788 | 2016-02-17,AMZN,534.1,528.74,0.010137307561372344 789 | 2016-02-18,AMZN,525.0,541.19,-0.02991555645891471 790 | 2016-02-19,AMZN,534.9,520.71,0.02725125309673319 791 | 2016-02-22,AMZN,559.5,542.2,0.03190704537071183 792 | 2016-02-23,AMZN,552.94,555.55,-0.004698046980469625 793 | 2016-02-24,AMZN,554.04,545.75,0.015190105359596818 794 | 2016-02-25,AMZN,555.15,555.52,-0.0006660426267281188 795 | 2016-02-26,AMZN,555.23,560.12,-0.008730272084553285 796 | 2016-02-29,AMZN,552.52,554.0,-0.002671480144404365 797 | 2016-03-01,AMZN,579.04,556.29,0.04089593557317227 798 | 2016-03-02,AMZN,580.21,581.75,-0.0026471852170175565 799 | 2016-03-03,AMZN,577.49,577.96,-0.0008132050660945866 800 | 2016-03-04,AMZN,575.14,581.07,-0.010205310891975258 801 | 2016-03-07,AMZN,562.8,573.54,-0.018725808138926683 802 | 2016-03-08,AMZN,560.26,557.87,0.0042841522218437745 803 | 2016-03-09,AMZN,559.47,559.56,-0.00016084066051883292 804 | 2016-03-10,AMZN,558.93,566.74,-0.013780569573349435 805 | 2016-03-11,AMZN,569.61,566.95,0.004691771761178178 806 | 2016-03-14,AMZN,573.37,567.0,0.011234567901234576 807 | 2016-03-15,AMZN,577.02,571.0,0.010542907180385258 808 | 2016-03-16,AMZN,574.27,576.64,-0.004110016648168709 809 | 2016-03-17,AMZN,559.44,569.51,-0.01768186686800923 810 | 2016-03-18,AMZN,552.08,560.94,-0.015794915677256056 811 | 2016-03-21,AMZN,553.98,548.91,0.009236486855768796 812 | 2016-03-22,AMZN,560.48,545.11,0.02819614389756197 813 | 2016-03-23,AMZN,569.63,561.0,0.015383244206773611 814 | 2016-03-24,AMZN,582.95,567.11,0.027931089206679537 815 | 2016-03-28,AMZN,579.87,584.4,-0.0077515400410677155 816 | 2016-03-29,AMZN,593.86,580.15,0.02363181935706289 817 | 2016-03-30,AMZN,598.69,596.71,0.003318194767977775 818 | 2016-03-31,AMZN,593.64,599.28,-0.009411293552262693 819 | 2016-04-01,AMZN,598.5,590.49,0.013565005334552644 820 | 2016-04-04,AMZN,593.19,599.0,-0.009699499165275368 821 | 2016-04-05,AMZN,586.14,590.77,-0.007837229378607572 822 | 2016-04-06,AMZN,602.08,587.52,0.024782135076252824 823 | 2016-04-07,AMZN,591.43,598.76,-0.012241966731244641 824 | 2016-04-08,AMZN,594.6,594.32,0.0004711266657692366 825 | 2016-04-11,AMZN,595.93,596.14,-0.0003522662461838434 826 | 2016-04-12,AMZN,603.17,598.4,0.007971256684491949 827 | 2016-04-13,AMZN,614.82,607.68,0.011749605055292425 828 | 2016-04-14,AMZN,620.75,615.07,0.009234721251239614 829 | 2016-04-15,AMZN,625.89,621.92,0.006383457679444346 830 | 2016-04-18,AMZN,635.35,625.35,0.015991045014791715 831 | 2016-04-19,AMZN,627.9,637.14,-0.014502307185234029 832 | 2016-04-20,AMZN,632.99,630.0,0.00474603174603176 833 | 2016-04-21,AMZN,631.0,631.0,0.0 834 | 2016-04-22,AMZN,620.5,624.47,-0.00635739106762539 835 | 2016-04-25,AMZN,626.2,616.61,0.015552780525778095 836 | 2016-04-26,AMZN,616.88,626.17,-0.014836226583835004 837 | 2016-04-27,AMZN,606.57,611.8,-0.008548545276233908 838 | 2016-04-28,AMZN,602.0,615.54,-0.021996945771192718 839 | 2016-04-29,AMZN,659.59,666.0,-0.009624624624624576 840 | 2016-05-02,AMZN,683.85,663.92,0.030018676949030102 841 | 2016-05-03,AMZN,671.32,677.36,-0.008916971772764798 842 | 2016-05-04,AMZN,670.9,662.59,0.012541692449327556 843 | 2016-05-05,AMZN,659.09,673.31,-0.02111954374656535 844 | 2016-05-06,AMZN,673.95,656.05,0.027284505754134734 845 | 2016-05-09,AMZN,679.75,673.95,0.008605979672082431 846 | 2016-05-10,AMZN,703.07,694.0,0.013069164265129754 847 | 2016-05-11,AMZN,713.23,705.79,0.010541379163774005 848 | 2016-05-12,AMZN,717.93,717.38,0.0007666787476650513 849 | 2016-05-13,AMZN,709.92,714.64,-0.006604724056867832 850 | 2016-05-16,AMZN,710.66,710.13,0.00074634221903028 851 | 2016-05-17,AMZN,695.27,709.9,-0.020608536413579372 852 | 2016-05-18,AMZN,697.45,689.56,0.011442079006903099 853 | 2016-05-19,AMZN,698.52,691.88,0.009597039949124106 854 | 2016-05-20,AMZN,702.8,701.05,0.0024962556165751375 855 | 2016-05-23,AMZN,696.75,704.25,-0.010649627263045794 856 | 2016-05-24,AMZN,704.2,698.01,0.008868067792725112 857 | 2016-05-25,AMZN,708.35,708.0,0.0004943502824859078 858 | 2016-05-26,AMZN,714.91,708.33,0.00928945547979039 859 | 2016-05-27,AMZN,712.24,715.0,-0.003860139860139847 860 | 2016-05-31,AMZN,722.79,712.33,0.014684205354259855 861 | 2016-06-01,AMZN,719.44,720.9,-0.002025246220002667 862 | 2016-06-02,AMZN,728.24,720.97,0.010083637321941247 863 | 2016-06-03,AMZN,725.54,726.74,-0.0016512095109668457 864 | 2016-06-06,AMZN,726.73,726.5,0.0003165863730213602 865 | 2016-06-07,AMZN,723.74,729.89,-0.00842592719450873 866 | 2016-06-08,AMZN,726.64,726.4,0.0003303964757709376 867 | 2016-06-09,AMZN,727.65,723.1,0.006292352371732754 868 | 2016-06-10,AMZN,717.91,722.35,-0.006146604831452972 869 | 2016-06-13,AMZN,715.24,714.01,0.001722664948670212 870 | 2016-06-14,AMZN,719.3,712.33,0.009784790757092798 871 | 2016-06-15,AMZN,714.26,722.0,-0.010720221606648213 872 | 2016-06-16,AMZN,717.51,712.05,0.007668000842637507 873 | 2016-06-17,AMZN,706.39,718.19,-0.01643019256742654 874 | 2016-06-20,AMZN,714.01,713.5,0.0007147862648913678 875 | 2016-06-21,AMZN,715.82,715.72,0.00013971944335776942 876 | 2016-06-22,AMZN,710.6,716.58,-0.008345195232911912 877 | 2016-06-23,AMZN,722.08,715.5,0.00919636617749831 878 | 2016-06-24,AMZN,698.96,693.0,0.008600288600288653 879 | 2016-06-27,AMZN,691.36,692.01,-0.0009392927847863142 880 | 2016-06-28,AMZN,707.95,700.0,0.011357142857142922 881 | 2016-06-29,AMZN,715.6,715.75,-0.00020957038071949322 882 | 2016-06-30,AMZN,715.62,717.2,-0.0022030117122142233 883 | 2016-07-01,AMZN,725.68,717.32,0.011654491719176796 884 | 2016-07-05,AMZN,728.1,722.8,0.00733259546209196 885 | 2016-07-06,AMZN,737.61,725.71,0.016397734632291102 886 | 2016-07-07,AMZN,736.57,739.33,-0.003733109707437803 887 | 2016-07-08,AMZN,745.81,740.14,0.007660712838111653 888 | 2016-07-11,AMZN,753.78,750.0,0.005039999999999964 889 | 2016-07-12,AMZN,748.21,756.86,-0.011428797928282611 890 | 2016-07-13,AMZN,742.63,746.76,-0.0055305586801649735 891 | 2016-07-14,AMZN,741.2,748.86,-0.010228881232807158 892 | 2016-07-15,AMZN,735.44,746.55,-0.014881789565333736 893 | 2016-07-18,AMZN,736.07,735.49,0.0007885899196454621 894 | 2016-07-19,AMZN,739.95,732.5,0.010170648464163885 895 | 2016-07-20,AMZN,745.72,744.0,0.002311827956989284 896 | 2016-07-21,AMZN,744.43,747.5,-0.004107023411371305 897 | 2016-07-22,AMZN,744.86,747.79,-0.003918212332339226 898 | 2016-07-25,AMZN,739.61,746.55,-0.00929609537204466 899 | 2016-07-26,AMZN,735.59,742.71,-0.009586514251861432 900 | 2016-07-27,AMZN,736.67,737.97,-0.001761589224494313 901 | 2016-07-28,AMZN,752.61,745.98,0.008887637738277158 902 | 2016-07-29,AMZN,758.81,765.0,-0.008091503267973928 903 | 2016-08-01,AMZN,767.74,759.87,0.010357034755945101 904 | 2016-08-02,AMZN,760.58,763.81,-0.0042288003561093785 905 | 2016-08-03,AMZN,754.64,757.06,-0.003196576229096715 906 | 2016-08-04,AMZN,760.77,753.7,0.009380390075626821 907 | 2016-08-05,AMZN,765.98,764.81,0.0015297917129745596 908 | 2016-08-08,AMZN,766.56,766.81,-0.0003260260038340658 909 | 2016-08-09,AMZN,768.31,767.39,0.0011988688932615217 910 | 2016-08-10,AMZN,768.56,769.8,-0.001610808002078474 911 | 2016-08-11,AMZN,771.24,769.94,0.0016884432553185371 912 | 2016-08-12,AMZN,772.56,768.46,0.0053353460167086236 913 | 2016-08-15,AMZN,768.49,771.9,-0.0044176706827308825 914 | 2016-08-16,AMZN,764.04,768.62,-0.005958731232598736 915 | 2016-08-17,AMZN,764.63,764.41,0.0002878036655721763 916 | 2016-08-18,AMZN,764.46,764.0,0.0006020942408377439 917 | 2016-08-19,AMZN,757.31,761.9,-0.006024412652579121 918 | 2016-08-22,AMZN,759.48,757.5,0.002613861386138638 919 | 2016-08-23,AMZN,762.45,763.31,-0.0011266719943403075 920 | 2016-08-24,AMZN,757.25,763.0,-0.007536041939711665 921 | 2016-08-25,AMZN,759.22,756.0,0.004259259259259295 922 | 2016-08-26,AMZN,769.0,760.05,0.01177554108282356 923 | 2016-08-29,AMZN,771.29,768.72,0.0033432198980121973 924 | 2016-08-30,AMZN,767.58,771.05,-0.004500356656507248 925 | 2016-08-31,AMZN,769.16,766.6,0.0033394208192015985 926 | 2016-09-01,AMZN,770.62,770.9,-0.00036321183032815243 927 | 2016-09-02,AMZN,772.44,774.11,-0.0021573161437004546 928 | 2016-09-06,AMZN,788.87,774.04,0.01915921657795468 929 | 2016-09-07,AMZN,784.48,789.53,-0.006396210403657815 930 | 2016-09-08,AMZN,784.06,783.89,0.00021686716248448006 931 | 2016-09-09,AMZN,760.14,779.36,-0.024661260521453534 932 | 2016-09-12,AMZN,771.49,757.35,0.018670363768402965 933 | 2016-09-13,AMZN,761.01,768.77,-0.010094046333753907 934 | 2016-09-14,AMZN,761.09,762.2,-0.0014563106796116683 935 | 2016-09-15,AMZN,769.69,762.0,0.010091863517060439 936 | 2016-09-16,AMZN,778.52,773.28,0.006776329402027738 937 | 2016-09-19,AMZN,775.1,779.97,-0.006243829890893245 938 | 2016-09-20,AMZN,780.22,776.0,0.005438144329896942 939 | 2016-09-21,AMZN,789.74,783.25,0.008285987871050123 940 | 2016-09-22,AMZN,804.7,794.27,0.013131554760975567 941 | 2016-09-23,AMZN,805.75,803.13,0.003262236499694949 942 | 2016-09-26,AMZN,799.16,801.8,-0.003292591668745306 943 | 2016-09-27,AMZN,816.11,801.85,0.017783874789549157 944 | 2016-09-28,AMZN,828.72,818.0,0.013105134474327661 945 | 2016-09-29,AMZN,829.05,828.26,0.0009538067756501142 946 | 2016-09-30,AMZN,837.31,832.61,0.005644899773002885 947 | 2016-10-03,AMZN,836.74,836.0,0.0008851674641148434 948 | 2016-10-04,AMZN,834.03,840.91,-0.00818161277663483 949 | 2016-10-05,AMZN,844.36,838.0,0.007589498806682594 950 | 2016-10-06,AMZN,841.66,843.7,-0.00241792106198895 951 | 2016-10-07,AMZN,839.43,845.79,-0.007519597063100786 952 | 2016-10-10,AMZN,841.71,843.25,-0.0018262674177289815 953 | 2016-10-11,AMZN,831.0,841.02,-0.011914104301919077 954 | 2016-10-12,AMZN,834.09,834.0,0.00010791366906478637 955 | 2016-10-13,AMZN,829.28,829.0,0.00033775633293120955 956 | 2016-10-14,AMZN,822.96,835.08,-0.014513579537289845 957 | 2016-10-17,AMZN,812.95,821.5,-0.010407790626901952 958 | 2016-10-18,AMZN,817.65,822.11,-0.005425064772354109 959 | 2016-10-19,AMZN,817.69,820.4,-0.003303266699171042 960 | 2016-10-20,AMZN,810.32,813.99,-0.004508654897480263 961 | 2016-10-21,AMZN,818.99,809.36,0.01189829000691904 962 | 2016-10-24,AMZN,838.09,824.95,0.015928238075034833 963 | 2016-10-25,AMZN,835.18,839.3,-0.004908852615274639 964 | 2016-10-26,AMZN,822.59,832.76,-0.012212402132667227 965 | 2016-10-27,AMZN,818.36,831.24,-0.015494923247196953 966 | 2016-10-28,AMZN,776.32,782.0,-0.007263427109974361 967 | 2016-10-31,AMZN,789.82,781.03,0.011254369230375373 968 | 2016-11-01,AMZN,785.41,799.0,-0.017008760951189025 969 | 2016-11-02,AMZN,765.56,783.93,-0.023433214700292124 970 | 2016-11-03,AMZN,767.03,765.05,0.0025880661394680326 971 | 2016-11-04,AMZN,755.05,762.79,-0.010146960500268762 972 | 2016-11-07,AMZN,784.93,771.64,0.017223057384272412 973 | 2016-11-08,AMZN,787.75,784.97,0.003541536619233821 974 | 2016-11-09,AMZN,771.88,764.0,0.010314136125654445 975 | 2016-11-10,AMZN,742.38,778.81,-0.046776492340878974 976 | 2016-11-11,AMZN,739.01,735.73,0.004458157204409189 977 | 2016-11-14,AMZN,719.07,745.51,-0.035465654384246946 978 | 2016-11-15,AMZN,743.24,730.0,0.018136986301369874 979 | 2016-11-16,AMZN,746.49,739.88,0.008933881169919465 980 | 2016-11-17,AMZN,756.4,749.32,0.009448566700475 981 | 2016-11-18,AMZN,760.16,761.0,-0.0011038107752957054 982 | 2016-11-21,AMZN,780.0,766.0,0.018276762402088774 983 | 2016-11-22,AMZN,785.33,788.17,-0.0036032835555780077 984 | 2016-11-23,AMZN,780.12,781.73,-0.002059534621928305 985 | 2016-11-25,AMZN,780.37,786.5,-0.007794024157660516 986 | 2016-11-28,AMZN,766.77,776.99,-0.01315332243658223 987 | 2016-11-29,AMZN,762.52,768.0,-0.00713541666666669 988 | 2016-11-30,AMZN,750.57,762.0,-0.014999999999999934 989 | 2016-12-01,AMZN,743.65,752.41,-0.011642588482343392 990 | 2016-12-02,AMZN,740.34,743.4,-0.0041162227602904835 991 | 2016-12-05,AMZN,759.36,745.0,0.019275167785234918 992 | 2016-12-06,AMZN,764.72,763.99,0.0009555098888729148 993 | 2016-12-07,AMZN,770.42,764.55,0.00767771891962593 994 | 2016-12-08,AMZN,767.33,771.87,-0.0058818194773730854 995 | 2016-12-09,AMZN,768.66,770.0,-0.0017402597402597815 996 | 2016-12-12,AMZN,760.12,766.4,-0.00819415448851771 997 | 2016-12-13,AMZN,774.34,764.96,0.012262079062957534 998 | 2016-12-14,AMZN,768.82,778.25,-0.012116929007388307 999 | 2016-12-15,AMZN,761.0,766.28,-0.006890431695985766 1000 | 2016-12-16,AMZN,757.77,765.0,-0.009450980392156886 1001 | 2016-12-19,AMZN,766.0,758.89,0.009368946751176077 1002 | 2016-12-20,AMZN,771.22,768.65,0.003343524360892539 1003 | 2016-12-21,AMZN,770.6,770.0,0.0007792207792208087 1004 | 2016-12-22,AMZN,766.34,768.12,-0.0023173462479820508 1005 | 2016-12-23,AMZN,760.59,764.55,-0.005179517363154696 1006 | 2016-12-27,AMZN,771.4,763.4,0.01047943411055803 1007 | 2016-12-28,AMZN,772.13,776.25,-0.005307568438003226 1008 | 2016-12-29,AMZN,765.15,772.4,-0.00938632832729156 1009 | 2016-12-30,AMZN,749.87,766.47,-0.021657729591503937 1010 | -------------------------------------------------------------------------------- /assets/built/index.js: -------------------------------------------------------------------------------- 1 | (()=>{var e={696:e=>{e.exports={line_chart:{Pandas:'\nimport matplotlib.dates as mdates\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\ndf_wide = df.pivot(\n index="Date", \n columns="Name", \n values="Close"\n) # Pandas requires variables in columns to plot them\n\ndf_wide.plot(\n title="Stock prices (2015 - 2017)", \n ylabel="Closing Price", \n ax=ax,\n)\nax.xaxis.set_major_formatter(\n mdates.DateFormatter("%b-%y")\n)\nfig # Not necessary if using a notebook\n',Matplotlib:'\nimport matplotlib.dates as mdates\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\nfor l, g in df.groupby("Name"):\n ax.plot(g["Date"], g["Close"], label=l)\n\nax.xaxis.set_major_formatter(\n mdates.DateFormatter("%b-%y")\n)\nax.tick_params(axis=\'x\', rotation=30)\n\nax.set_title("Stock prices (2015 - 2017)")\nax.set_ylabel("Close")\nax.set_xlabel("Date")\nax.legend(title="Name")\n\nfig # Not necessary if using a notebook\n',Seaborn:'\nimport matplotlib.dates as mdates\n\nfig, ax = plt.subplots(figsize=(6, 4))\nsns.lineplot(\n data=df, \n x="Date", \n y="Close", \n hue="Name", \n ax=ax\n)\nax.xaxis.set_major_formatter(\n mdates.DateFormatter("%b-%y")\n)\nax.tick_params(axis=\'x\', rotation=30)\nax.set_title("Stock Prices (2015 - 2017)")\nfig # Not necessary if using a notebook\n',"Plotly Express":'\nfig = px.line(\n df, \n x="Date", \n y="Close", \n color="Name", \n title="Stock Prices (2015 - 2017)"\n)\nfig.update_yaxes(tickprefix="$")\nplot(fig) # Replace this line by fig.show() to use in a notebook\n'},bar_chart:{Pandas:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\ndf.plot.bar(\n x="Year",\n y="Open",\n rot=0,\n ylabel="Opening price",\n title="Maximum opening price per year - AAPL",\n legend=None,\n ax=ax\n)\nax.yaxis.set_major_formatter(\n mticker.StrMethodFormatter("${x:1.0f}")\n)\nfig # Not necessary if using a notebook\n ',Matplotlib:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\nx = np.arange(len(df.Year))\nwidth = 0.5\n\nax.bar(x, df.Open, width, label="Open")\n\nax.set_xlabel("Year")\nax.set_ylabel("Opening price")\nax.set_title("Maximum opening price per year - AAPL")\n\nax.set_xticks(x)\nax.set_xticklabels(df.Year)\n\nax.yaxis.set_major_formatter(\n mticker.StrMethodFormatter("${x:1.0f}")\n)\nfig # Not necessary if using a notebook\n',Seaborn:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\nsns.barplot(\n data=df,\n x="Year",\n y="Open",\n color="blue",\n ax=ax\n)\n\nax.yaxis.set_major_formatter(\n mticker.StrMethodFormatter("${x:1.0f}")\n)\n\nax.set_title("Maximum opening price per year - AAPL")\nfig # Not necessary if using a notebook\n ',"Plotly Express":'\n fig = px.bar(\n df,\n x="Year",\n y="Open",\n title="Max opening price per year - AAPL",\n labels={"value": "Opening price"},\n)\nfig.update_yaxes(tickprefix="$")\nplot(fig) # Replace this line by fig.show() to use in a notebook\n'},grouped_bar_chart:{Pandas:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\ndf.plot.bar(\n x="Year",\n y=["Open", "Close"],\n rot=0,\n ylabel="Price",\n title="Maximum opening and closing price per year - AAPL",\n ax=ax\n)\nax.yaxis.set_major_formatter(\n mticker.StrMethodFormatter("${x:1.0f}")\n)\nfig # Not necessary if using a notebook\n ',Matplotlib:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\nx = np.arange(len(df.Year))\nwidth = 0.25\n\nax.bar(x - width / 2, df.Open, width, label="Open")\nax.bar(x + width / 2, df.Close, width, label="Close")\n\nax.set_xlabel("Year")\nax.set_ylabel("Price")\nax.set_title("Maximum opening and closing price per year - AAPL")\n\nax.set_xticks(x)\nax.set_xticklabels(df.Year)\n\nax.yaxis.set_major_formatter(\n mticker.StrMethodFormatter("${x:1.0f}")\n)\nax.legend()\nfig # Not necessary if using a notebook\n',Seaborn:'\nimport matplotlib.ticker as mticker\n\ndf_long = df.melt(\n id_vars="Year",\n value_vars=["Open", "Close"],\n var_name="Category",\n value_name="Price",\n) # Seaborn works better with long data\n\nfig, ax = plt.subplots(figsize=(6, 4))\nsns.barplot(data=df_long, x="Year", y="Price", hue="Category", ax=ax)\n\nax.yaxis.set_major_formatter(\n mticker.StrMethodFormatter("${x:1.0f}")\n)\n\nax.set_title("Maximum opening and closing price per year - AAPL")\nax.legend(title=None)\nfig # Not necessary if using a notebook\n ',"Plotly Express":'\nfig = px.bar(\n df,\n x="Year",\n y=["Open", "Close"],\n barmode="group",\n title="Max opening and closing price per year - AAPL",\n labels={"value": "Price"},\n)\nfig.update_yaxes(tickprefix="$")\nplot(fig) # Replace this line by fig.show() to use in a notebook\n'},stacked_bar_chart:{Pandas:'\nfig, ax = plt.subplots(figsize=(6, 4))\ndf_wide = df.pivot(\n index="Year", columns="Name", values="Volume"\n) # Pandas works better with wide data\ndf_wide.plot.bar(\n ylabel="Volume (billions of shares)",\n title="Trading volume per year for selected shares",\n stacked=True,\n ax=ax,\n rot=0\n)\nfig # Not necessary if using a notebook\n',Matplotlib:'\nfig, ax = plt.subplots(figsize=(6, 4))\n\nbottom = np.zeros(df.Year.nunique())\nfor i, g in df.groupby("Name"):\n ax.bar(\n g["Year"], \n g["Volume"], \n bottom=bottom, \n label=i, \n width=0.5\n )\n bottom += g["Volume"].values\n\nax.set_title("Trading volume per year for selected shares")\nax.set_ylabel("Volume (billions of shares)")\nax.set_xlabel("Year")\n\nax.legend()\n\nfig # Not necessary if using a notebook\n',Seaborn:'\nfig, ax = plt.subplots(figsize=(6, 4))\n\nax = sns.histplot(\n data=df,\n x="Year",\n hue="Name",\n weights="Volume",\n multiple="stack",\n shrink=0.5,\n discrete=True,\n hue_order=df.groupby("Name").Volume.sum().sort_values().index,\n)\n\nax.set_title("Trading volume per year for selected shares")\nax.set_ylabel("Volume (billions of shares)")\n\nlegend = ax.get_legend()\nlegend.set_bbox_to_anchor((1, 1))\nfig # Not necessary if using a notebook\n',"Plotly Express":'\nfig = px.bar(\n df,\n x="Year",\n y="Volume",\n color="Name",\n title="Trading volume per year for selected shares",\n barmode="stack",\n labels={"Volume": "Volume (billions of shares)"},\n)\nplot(fig) # Replace this line by fig.show() to use in a notebook\n'},stacked_area_chart:{Pandas:'\nimport matplotlib.dates as mdates\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\ndf_wide = df.pivot(\n index="Date", columns="Name", values="Volume Perc"\n) # Pandas works better with wide data\n\ndf_wide.plot.area(\n rot=0,\n title="Distribution of daily trading volume - 2017",\n stacked=True,\n ax=ax\n)\n\nax.tick_params(axis="x", rotation=30)\nax.yaxis.set_major_formatter(mticker.PercentFormatter(1))\nax.xaxis.set_major_formatter(mdates.DateFormatter("%b-%y"))\n\nfig # Not necessary if using a notebook\n',Matplotlib:'\nimport matplotlib.dates as mdates\nimport matplotlib.ticker as mticker\n\ndf_wide = df.pivot(\n index="Date", columns="Name", values="Volume Perc"\n)\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\nax.stackplot(\n df_wide.index, \n [df_wide[col].values for col in sorted(df.Name.unique())], \n labels=sorted(df.Name.unique())\n)\n\nax.set_title("Distribution of daily trading volume - 2017")\n\nax.tick_params(axis="x", rotation=30)\nax.yaxis.set_major_formatter(mticker.PercentFormatter(1))\nax.xaxis.set_major_formatter(mdates.DateFormatter("%b-%y"))\n\nfig # Not necessary if using a notebook\n',Seaborn:"# Seaborn does not support stacked area charts","Plotly Express":'\n # Plotly express\nfig = px.area(\n df,\n x="Date",\n y="Volume Perc",\n color="Name",\n title="Distribution of daily trading volume - 2017",\n)\nfig.update_layout(yaxis_tickformat=".0%")\nplot(fig) # Replace this line by fig.show() to use in a notebook\n'},donut_chart:{Pandas:'\nfig, ax = plt.subplots(figsize=(6, 6))\ndf.set_index("Name").plot.pie(\n y="Volume",\n wedgeprops=dict(width=0.5),\n autopct="%1.0f%%",\n pctdistance=0.75,\n title="Distribution of total trading volume for selected stocks (2006 - 2017)",\n ax=ax\n)\nfig # Not necessary if using a notebook\n',Matplotlib:'\nfig, ax = plt.subplots(figsize=(6, 6))\n\nax.pie(\n df.Volume,\n labels=df.Name,\n wedgeprops=dict(width=0.5),\n autopct="%1.0f%%",\n pctdistance=0.75,\n)\nax.set_title("Distribution of total trading volume for selected stocks (2006 - 2017)")\nax.legend()\nfig',Seaborn:"# Seaborn does not support donut charts","Plotly Express":'\nfig = px.pie(\n data_frame=df,\n values="Volume",\n names="Name",\n hole=0.5,\n color="Name",\n title="Distribution of trading volume for selected stocks (2006 - 2017)",\n)\nplot(fig) # Replace this line by fig.show() to use in a notebook\n'},pie_chart:{Pandas:'\nfig, ax = plt.subplots(figsize=(6, 6))\ndf.set_index("Name").plot.pie(\n y="Volume",\n autopct="%1.0f%%",\n pctdistance=0.75,\n title="Distribution of total trading volume for selected stocks (2006 - 2017)",\n ax=ax\n)\nfig \n ',Matplotlib:'\nfig, ax = plt.subplots(figsize=(6, 6))\n\nax.pie(\n df.Volume,\n labels=df.Name,\n autopct="%1.0f%%",\n pctdistance=0.75,\n)\nax.set_title("Distribution of total trading volume for selected stocks (2006 - 2017)")\nax.legend()\nfig',Seaborn:"# Seaborn does not support pie charts","Plotly Express":'\nfig = px.pie(\n data_frame=df,\n values="Volume",\n names="Name",\n color="Name",\n title="Distribution of trading volume for selected stocks (2006 - 2017)",\n)\nplot(fig) # Replace this line by fig.show() to use in a notebook\n'},histogram:{Pandas:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\ndf.plot.hist(\n y="Close",\n legend=None,\n ax=ax,\n title="Distribution of Closing Prices - GOOGL",\n xlabel="Closing Price"\n)\nax.xaxis.set_major_formatter(\n mticker.StrMethodFormatter("${x:1.0f}")\n)\n\nfig',Matplotlib:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\nax.hist(df.Close, alpha=0.75, bins=30)\n\nax.set_title("Distribution of Closing Prices - GOOGL")\nax.set_xlabel("Closing Price")\nax.xaxis.set_major_formatter(\n mticker.StrMethodFormatter("${x:1.0f}")\n)\n\nfig',Seaborn:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\nsns.histplot(data=df, x="Close", hue="Name", ax=ax)\n\nax.set_title("Distribution of Closing Prices - GOOGL")\nax.set_xlabel("Closing Price")\nax.xaxis.set_major_formatter(\n mticker.StrMethodFormatter("${x:1.0f}")\n)\n\nfig',"Plotly Express":'\nfig = px.histogram(\n df,\n x="Close",\n labels={"Close": "Closing Price"},\n title="Distribution of Closing Prices - GOOGL",\n nbins=30\n)\nplot(fig) # Replace this line by fig.show() to use in a notebook\n'},scatter_plot:{Pandas:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 6))\ndf_wide = df.pivot(index="Date", columns="Name", values="Return")\n\nax = df_wide.plot.scatter(\n x="GOOGL", \n y="AMZN", \n title="Daily returns - GOOGL vs. AMZN", \n ax=ax\n)\n\nax.yaxis.set_major_formatter(mticker.PercentFormatter(1))\nax.xaxis.set_major_formatter(mticker.PercentFormatter(1))\nfig',Matplotlib:'\nimport matplotlib.ticker as mticker\n\ndf_wide = df.pivot(\n index="Date", columns="Name", values="Return"\n)\n\nfig, ax = plt.subplots(figsize=(6, 6))\n\nax.scatter(x=df_wide["GOOGL"], y=df_wide["AMZN"])\n\nax.set_xlabel("GOOGL")\nax.set_ylabel("AMZN")\nax.set_title("Daily returns - GOOGL vs. AMZN")\n\nax.yaxis.set_major_formatter(mticker.PercentFormatter(1))\nax.xaxis.set_major_formatter(mticker.PercentFormatter(1))\nfig',Seaborn:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 6))\n\ndf_wide = df.pivot(index="Date", columns="Name", values="Return")\n\nsns.scatterplot(data=df_wide, x="GOOGL", y="AMZN", ax=ax)\n\nax.set_title("Daily returns - GOOGL vs AMZN")\nax.yaxis.set_major_formatter(mticker.PercentFormatter(1))\nax.xaxis.set_major_formatter(mticker.PercentFormatter(1))\nfig',"Plotly Express":'\nfig = px.scatter(\n data_frame=df_wide, \n x="GOOGL", \n y="AMZN", \n title="Daily returns - GOOGL vs. AMZN"\n)\nfig.update_layout(yaxis_tickformat=".0%", xaxis_tickformat=".0%")\nplot(fig) # Replace this line by fig.show() to use in a notebook\n'},box_plot:{Pandas:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\ndf_wide = df.pivot(\n index="Date", columns="Name", values="Return"\n)\ndf_wide.boxplot(\n column=["AMZN", "GOOGL", "IBM", "JPM"],\n ax=ax\n)\n\nax.set_ylabel("Daily returns")\nax.yaxis.set_major_formatter(mticker.PercentFormatter(1))\nfig # Not necessary if using a notebook\n',Matplotlib:'\nimport matplotlib.ticker as mticker\n\ndf_wide = df.pivot(index="Date", columns="Name", values="Return")\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\nax.boxplot(\n [df_wide[col] for col in sorted(df.Name.unique())], \n vert=True, \n autorange=True, \n labels=sorted(df.Name.unique())\n)\n\nax.set_ylabel("Daily returns")\nax.yaxis.set_major_formatter(mticker.PercentFormatter(1))\nfig # Not necessary if using a notebook\n',Seaborn:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\nsns.boxplot(\n data=df,\n x="Name", \n y="Return", \n order=sorted(df.Name.unique()),\n ax=ax\n)\n\nax.set_ylabel("Daily returns")\nax.yaxis.set_major_formatter(mticker.PercentFormatter(1))\nfig # Not necessary if using a notebook\n',"Plotly Express":'\nfig = px.box(\n df, \n x="Name", \n y="Return", \n category_orders={"Name": sorted(df.Name.unique())}\n)\nfig.update_layout(yaxis_tickformat=".0%")\nplot(fig)\n'},strip_plot:{Pandas:"# Pandas does not support strip plots",Matplotlib:"# Matplotlib does not support strip plots",Seaborn:'\nimport matplotlib.ticker as mticker\n\nfig, ax = plt.subplots(figsize=(6, 4))\n\nsns.stripplot(\n data=df,\n x="Name", \n y="Return", \n order=sorted(df.Name.unique()),\n alpha=0.3,\n ax=ax\n)\n\nax.set_ylabel("Daily returns")\nax.yaxis.set_major_formatter(mticker.PercentFormatter(1))\nfig # Not necessary if using a notebook\n',"Plotly Express":'\nfig = px.strip(\n df, \n x="Name", \n y="Return", \n category_orders={"Name": sorted(df.Name.unique())},\n color="Name"\n)\nfig.update_layout(yaxis_tickformat=".0%")\nplot(fig) # Replace this line by fig.show() to use in a notebook\n'},pair_plot:{Pandas:"# TBD",Matplotlib:"# Matplotlib does not support strip plots",Seaborn:'\nimport matplotlib.ticker as mticker\n\ndf_wide = df.pivot(\n index="Date", columns="Name", values="Return"\n) # Pair plots work with wide data\n\nfig = sns.pairplot(\n df_wide, \n kind="reg", \n corner=True,\n height=1.5,\n plot_kws={\n \'line_kws\':{\'color\':\'red\'}, \n \'scatter_kws\': {\'alpha\': 0.1}\n },\n diag_kws={\n "edgecolor": "black", \n "linewidth": 0.2\n },\n size=2\n)\n\nfor ax in fig.axes.flatten():\n if ax:\n ax.yaxis.set_major_formatter(mticker.PercentFormatter(1))\n ax.xaxis.set_major_formatter(mticker.PercentFormatter(1))\n\nfig # Not necessary if using a notebook\n',"Plotly Express":'\ndf_wide = df.pivot(\n index="Date", columns="Name", values="Return"\n) # Pair plots work with wide data\n\nfig = px.scatter_matrix(\n df_wide,\n title="Daily Returns",\n opacity=0.2\n)\n\nfig.update_layout(\n {"yaxis"+str(i+1): dict(tickformat=".0%") for i in range(16)}\n)\nfig.update_layout(\n {"xaxis"+str(i+1): dict(tickformat=".0%") for i in range(16)}\n)\n\nplot(fig) # Replace this line by fig.show() to use in a notebook\n'}}}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var a=t[i]={exports:{}};return e[i](a,a.exports,n),a.exports}(()=>{"use strict";var e,t,i,r,a=!1,o=!1,s=[];function l(e){let t=s.indexOf(e);-1!==t&&s.splice(t,1)}function c(){a=!1,o=!0;for(let e=0;e{(void 0===t||t.includes(n))&&(i.forEach((e=>e())),delete e._x_attributeCleanups[n])}))}var g=new MutationObserver(P),h=!1;function b(){g.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),h=!0}var y=[],v=!1;function k(e){if(!h)return e();(y=y.concat(g.takeRecords())).length&&!v&&(v=!0,queueMicrotask((()=>{P(y),y.length=0,v=!1}))),g.disconnect(),h=!1;let t=e();return b(),t}var w=!1,E=[];function P(e){if(w)return void(E=E.concat(e));let t=[],n=[],i=new Map,r=new Map;for(let a=0;a1===e.nodeType&&t.push(e))),e[a].removedNodes.forEach((e=>1===e.nodeType&&n.push(e)))),"attributes"===e[a].type)){let t=e[a].target,n=e[a].attributeName,o=e[a].oldValue,s=()=>{i.has(t)||i.set(t,[]),i.get(t).push({name:n,value:t.getAttribute(n)})},l=()=>{r.has(t)||r.set(t,[]),r.get(t).push(n)};t.hasAttribute(n)&&null===o?s():t.hasAttribute(n)?(l(),s()):l()}r.forEach(((e,t)=>{x(t,e)})),i.forEach(((e,t)=>{f.forEach((n=>n(t,e)))}));for(let e of n)if(!t.includes(e)&&(p.forEach((t=>t(e))),e._x_cleanups))for(;e._x_cleanups.length;)e._x_cleanups.pop()();t.forEach((e=>{e._x_ignoreSelf=!0,e._x_ignore=!0}));for(let e of t)n.includes(e)||e.isConnected&&(delete e._x_ignoreSelf,delete e._x_ignore,m.forEach((t=>t(e))),e._x_ignore=!0,e._x_ignoreSelf=!0);t.forEach((e=>{delete e._x_ignoreSelf,delete e._x_ignore})),t=null,n=null,i=null,r=null}function O(e){return C(A(e))}function N(e,t,n){return e._x_dataStack=[t,...A(n||e)],()=>{e._x_dataStack=e._x_dataStack.filter((e=>e!==t))}}function S(e,t){let n=e._x_dataStack[0];Object.entries(t).forEach((([e,t])=>{n[e]=t}))}function A(e){return e._x_dataStack?e._x_dataStack:"function"==typeof ShadowRoot&&e instanceof ShadowRoot?A(e.host):e.parentNode?A(e.parentNode):[]}function C(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap((e=>Object.keys(e))))),has:(t,n)=>e.some((e=>e.hasOwnProperty(n))),get:(n,i)=>(e.find((e=>{if(e.hasOwnProperty(i)){let n=Object.getOwnPropertyDescriptor(e,i);if(n.get&&n.get._x_alreadyBound||n.set&&n.set._x_alreadyBound)return!0;if((n.get||n.set)&&n.enumerable){let r=n.get,a=n.set,o=n;r=r&&r.bind(t),a=a&&a.bind(t),r&&(r._x_alreadyBound=!0),a&&(a._x_alreadyBound=!0),Object.defineProperty(e,i,{...o,get:r,set:a})}return!0}return!1}))||{})[i],set:(t,n,i)=>{let r=e.find((e=>e.hasOwnProperty(n)));return r?r[n]=i:e[e.length-1][n]=i,!0}});return t}function M(e){let t=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach((([r,{value:a,enumerable:o}])=>{if(!1===o||void 0===a)return;let s=""===i?r:`${i}.${r}`;var l;"object"==typeof a&&null!==a&&a._x_interceptor?n[r]=a.initialize(e,s,r):"object"!=typeof(l=a)||Array.isArray(l)||null===l||a===n||a instanceof Element||t(a,s)}))};return t(e)}function j(e,t=(()=>{})){let n={initialValue:void 0,_x_interceptor:!0,initialize(t,n,i){return e(this.initialValue,(()=>function(e,t){return t.split(".").reduce(((e,t)=>e[t]),e)}(t,n)),(e=>L(t,n,e)),n,i)}};return t(n),e=>{if("object"==typeof e&&null!==e&&e._x_interceptor){let t=n.initialize.bind(n);n.initialize=(i,r,a)=>{let o=e.initialize(i,r,a);return n.initialValue=o,t(i,r,a)}}else n.initialValue=e;return n}}function L(e,t,n){if("string"==typeof t&&(t=t.split(".")),1!==t.length){if(0===t.length)throw error;return e[t[0]]||(e[t[0]]={}),L(e[t[0]],t.slice(1),n)}e[t[0]]=n}var $={};function D(e,t){$[e]=t}function R(e,t){return Object.entries($).forEach((([n,i])=>{Object.defineProperty(e,`$${n}`,{get(){let[e,n]=te(t);return e={interceptor:j,...e},_(t,n),i(t,e)},enumerable:!1})})),e}function z(e,t,n,...i){try{return n(...i)}catch(n){T(n,e,t)}}function T(e,t,n){Object.assign(e,{el:t,expression:n}),console.warn(`Alpine Expression Error: ${e.message}\n\n${n?'Expression: "'+n+'"\n\n':""}`,t),setTimeout((()=>{throw e}),0)}var I=!0;function F(e,t,n={}){let i;return B(e,t)((e=>i=e),n),i}function B(...e){return G(...e)}var G=V;function V(e,t){let n={};R(n,e);let i=[n,...A(e)];if("function"==typeof t)return function(e,t){return(n=(()=>{}),{scope:i={},params:r=[]}={})=>{Y(n,t.apply(C([i,...e]),r))}}(i,t);let r=function(e,t,n){let i=function(e,t){if(q[e])return q[e];let n=Object.getPrototypeOf((async function(){})).constructor,i=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(() => { ${e} })()`:e,r=(()=>{try{return new n(["__self","scope"],`with (scope) { __self.result = ${i} }; __self.finished = true; return __self.result;`)}catch(n){return T(n,t,e),Promise.resolve()}})();return q[e]=r,r}(t,n);return(r=(()=>{}),{scope:a={},params:o=[]}={})=>{i.result=void 0,i.finished=!1;let s=C([a,...e]);if("function"==typeof i){let e=i(i,s).catch((e=>T(e,n,t)));i.finished?(Y(r,i.result,s,o,n),i.result=void 0):e.then((e=>{Y(r,e,s,o,n)})).catch((e=>T(e,n,t))).finally((()=>i.result=void 0))}}}(i,t,e);return z.bind(null,e,t,r)}var q={};function Y(e,t,n,i,r){if(I&&"function"==typeof t){let a=t.apply(n,i);a instanceof Promise?a.then((t=>Y(e,t,n,i))).catch((e=>T(e,r,t))):e(a)}else e(t)}var W="x-";function Z(e=""){return W+e}var K={};function U(e,t){K[e]=t}function H(e,t,n){if(t=Array.from(t),e._x_virtualDirectives){let n=Object.entries(e._x_virtualDirectives).map((([e,t])=>({name:e,value:t}))),i=J(n);n=n.map((e=>i.find((t=>t.name===e.name))?{name:`x-bind:${e.name}`,value:`"${e.value}"`}:e)),t=t.concat(n)}let i={},r=t.map(ie(((e,t)=>i[e]=t))).filter(oe).map(function(e,t){return({name:n,value:i})=>{let r=n.match(se()),a=n.match(/:([a-zA-Z0-9\-:]+)/),o=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=t||e[n]||n;return{type:r?r[1]:null,value:a?a[1]:null,modifiers:o.map((e=>e.replace(".",""))),expression:i,original:s}}}(i,n)).sort(ue);return r.map((t=>function(e,t){let n=K[t.type]||(()=>{}),[i,r]=te(e);!function(e,t,n){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(n)}(e,t.original,r);let a=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),Q?X.get(ee).push(n):n())};return a.runCleanups=r,a}(e,t)))}function J(e){return Array.from(e).map(ie()).filter((e=>!oe(e)))}var Q=!1,X=new Map,ee=Symbol();function te(e){let n=[],[r,a]=function(e){let n=()=>{};return[r=>{let a=t(r);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach((e=>e()))}),e._x_effects.add(a),n=()=>{void 0!==a&&(e._x_effects.delete(a),i(a))},a},()=>{n()}]}(e);return n.push(a),[{Alpine:Ze,effect:r,cleanup:e=>n.push(e),evaluateLater:B.bind(B,e),evaluate:F.bind(F,e)},()=>n.forEach((e=>e()))]}var ne=(e,t)=>({name:n,value:i})=>(n.startsWith(e)&&(n=n.replace(e,t)),{name:n,value:i});function ie(e=(()=>{})){return({name:t,value:n})=>{let{name:i,value:r}=re.reduce(((e,t)=>t(e)),{name:t,value:n});return i!==t&&e(i,t),{name:i,value:r}}}var re=[];function ae(e){re.push(e)}function oe({name:e}){return se().test(e)}var se=()=>new RegExp(`^${W}([^:^.]+)\\b`),le="DEFAULT",ce=["ignore","ref","data","id","bind","init","for","mask","model","modelable","transition","show","if",le,"teleport"];function ue(e,t){let n=-1===ce.indexOf(e.type)?le:e.type,i=-1===ce.indexOf(t.type)?le:t.type;return ce.indexOf(n)-ce.indexOf(i)}function de(e,t,n={}){e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}var fe=[],pe=!1;function me(e=(()=>{})){return queueMicrotask((()=>{pe||setTimeout((()=>{_e()}))})),new Promise((t=>{fe.push((()=>{e(),t()}))}))}function _e(){for(pe=!1;fe.length;)fe.shift()()}function xe(e,t){if("function"==typeof ShadowRoot&&e instanceof ShadowRoot)return void Array.from(e.children).forEach((e=>xe(e,t)));let n=!1;if(t(e,(()=>n=!0)),n)return;let i=e.firstElementChild;for(;i;)xe(i,t),i=i.nextElementSibling}function ge(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var he=[],be=[];function ye(){return he.map((e=>e()))}function ve(){return he.concat(be).map((e=>e()))}function ke(e){he.push(e)}function we(e){be.push(e)}function Ee(e,t=!1){return Pe(e,(e=>{if((t?ve():ye()).some((t=>e.matches(t))))return!0}))}function Pe(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),e.parentElement)return Pe(e.parentElement,t)}}function Oe(e,t=xe){!function(n){Q=!0;let i=Symbol();ee=i,X.set(i,[]);let r=()=>{for(;X.get(i).length;)X.get(i).shift()();X.delete(i)};t(e,((e,t)=>{H(e,e.attributes).forEach((e=>e())),e._x_ignore&&t()})),Q=!1,r()}()}function Ne(e,t){return Array.isArray(t)?Se(e,t.join(" ")):"object"==typeof t&&null!==t?function(e,t){let n=e=>e.split(" ").filter(Boolean),i=Object.entries(t).flatMap((([e,t])=>!!t&&n(e))).filter(Boolean),r=Object.entries(t).flatMap((([e,t])=>!t&&n(e))).filter(Boolean),a=[],o=[];return r.forEach((t=>{e.classList.contains(t)&&(e.classList.remove(t),o.push(t))})),i.forEach((t=>{e.classList.contains(t)||(e.classList.add(t),a.push(t))})),()=>{o.forEach((t=>e.classList.add(t))),a.forEach((t=>e.classList.remove(t)))}}(e,t):"function"==typeof t?Ne(e,t()):Se(e,t)}function Se(e,t){return t=!0===t?t="":t||"",n=t.split(" ").filter((t=>!e.classList.contains(t))).filter(Boolean),e.classList.add(...n),()=>{e.classList.remove(...n)};var n}function Ae(e,t){return"object"==typeof t&&null!==t?function(e,t){let n={};return Object.entries(t).forEach((([t,i])=>{n[t]=e.style[t],t.startsWith("--")||(t=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()),e.style.setProperty(t,i)})),setTimeout((()=>{0===e.style.length&&e.removeAttribute("style")})),()=>{Ae(e,n)}}(e,t):function(e,t){let n=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",n||"")}}(e,t)}function Ce(e,t=(()=>{})){let n=!1;return function(){n?t.apply(this,arguments):(n=!0,e.apply(this,arguments))}}function Me(e,t,n={}){e._x_transition||(e._x_transition={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(n=(()=>{}),i=(()=>{})){Le(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=(()=>{}),i=(()=>{})){Le(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}function je(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:je(t)}function Le(e,t,{during:n,start:i,end:r}={},a=(()=>{}),o=(()=>{})){if(e._x_transitioning&&e._x_transitioning.cancel(),0===Object.keys(n).length&&0===Object.keys(i).length&&0===Object.keys(r).length)return a(),void o();let s,l,c;!function(e,t){let n,i,r,a=Ce((()=>{k((()=>{n=!0,i||t.before(),r||(t.end(),_e()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning}))}));e._x_transitioning={beforeCancels:[],beforeCancel(e){this.beforeCancels.push(e)},cancel:Ce((function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();a()})),finish:a},k((()=>{t.start(),t.during()})),pe=!0,requestAnimationFrame((()=>{if(n)return;let a=1e3*Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s","")),o=1e3*Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""));0===a&&(a=1e3*Number(getComputedStyle(e).animationDuration.replace("s",""))),k((()=>{t.before()})),i=!0,requestAnimationFrame((()=>{n||(k((()=>{t.end()})),_e(),setTimeout(e._x_transitioning.finish,a+o),r=!0)}))}))}(e,{start(){s=t(e,i)},during(){l=t(e,n)},before:a,end(){s(),c=t(e,r)},after:o,cleanup(){l(),c()}})}function $e(e,t,n){if(-1===e.indexOf(t))return n;const i=e[e.indexOf(t)+1];if(!i)return n;if("scale"===t&&isNaN(i))return n;if("duration"===t){let e=i.match(/([0-9]+)ms/);if(e)return e[1]}return"origin"===t&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[i,e[e.indexOf(t)+2]].join(" "):i}U("transition",((e,{value:t,modifiers:n,expression:i},{evaluate:r})=>{"function"==typeof i&&(i=r(i)),i?function(e,t,n){Me(e,Ne,""),{enter:t=>{e._x_transition.enter.during=t},"enter-start":t=>{e._x_transition.enter.start=t},"enter-end":t=>{e._x_transition.enter.end=t},leave:t=>{e._x_transition.leave.during=t},"leave-start":t=>{e._x_transition.leave.start=t},"leave-end":t=>{e._x_transition.leave.end=t}}[n](t)}(e,i,t):function(e,t,n){Me(e,Ae);let i=!t.includes("in")&&!t.includes("out")&&!n,r=i||t.includes("in")||["enter"].includes(n),a=i||t.includes("out")||["leave"].includes(n);t.includes("in")&&!i&&(t=t.filter(((e,n)=>nn>t.indexOf("out"))));let o=!t.includes("opacity")&&!t.includes("scale"),s=o||t.includes("opacity")?0:1,l=o||t.includes("scale")?$e(t,"scale",95)/100:1,c=$e(t,"delay",0),u=$e(t,"origin","center"),d="opacity, transform",f=$e(t,"duration",150)/1e3,p=$e(t,"duration",75)/1e3,m="cubic-bezier(0.4, 0.0, 0.2, 1)";r&&(e._x_transition.enter.during={transformOrigin:u,transitionDelay:c,transitionProperty:d,transitionDuration:`${f}s`,transitionTimingFunction:m},e._x_transition.enter.start={opacity:s,transform:`scale(${l})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),a&&(e._x_transition.leave.during={transformOrigin:u,transitionDelay:c,transitionProperty:d,transitionDuration:`${p}s`,transitionTimingFunction:m},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:s,transform:`scale(${l})`})}(e,n,t)})),window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,n,i){const r="visible"===document.visibilityState?requestAnimationFrame:setTimeout;let a=()=>r(n);t?e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(n):a():e._x_transition?e._x_transition.in(n):a():(e._x_hidePromise=e._x_transition?new Promise(((t,n)=>{e._x_transition.out((()=>{}),(()=>t(i))),e._x_transitioning.beforeCancel((()=>n({isFromCancelledTransition:!0})))})):Promise.resolve(i),queueMicrotask((()=>{let t=je(e);t?(t._x_hideChildren||(t._x_hideChildren=[]),t._x_hideChildren.push(e)):r((()=>{let t=e=>{let n=Promise.all([e._x_hidePromise,...(e._x_hideChildren||[]).map(t)]).then((([e])=>e()));return delete e._x_hidePromise,delete e._x_hideChildren,n};t(e).catch((e=>{if(!e.isFromCancelledTransition)throw e}))}))})))};var De=!1;function Re(e,t=(()=>{})){return(...n)=>De?t(...n):e(...n)}function ze(t,n,i,r=[]){switch(t._x_bindings||(t._x_bindings=e({})),t._x_bindings[n]=i,n=r.includes("camel")?n.toLowerCase().replace(/-(\w)/g,((e,t)=>t.toUpperCase())):n){case"value":!function(e,t){if("radio"===e.type)void 0===e.attributes.value&&(e.value=t),window.fromModel&&(e.checked=Te(e.value,t));else if("checkbox"===e.type)Number.isInteger(t)?e.value=t:Number.isInteger(t)||Array.isArray(t)||"boolean"==typeof t||[null,void 0].includes(t)?Array.isArray(t)?e.checked=t.some((t=>Te(t,e.value))):e.checked=!!t:e.value=String(t);else if("SELECT"===e.tagName)!function(e,t){const n=[].concat(t).map((e=>e+""));Array.from(e.options).forEach((e=>{e.selected=n.includes(e.value)}))}(e,t);else{if(e.value===t)return;e.value=t}}(t,i);break;case"style":!function(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=Ae(e,t)}(t,i);break;case"class":!function(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=Ne(e,t)}(t,i);break;default:!function(e,t,n){[null,void 0,!1].includes(n)&&function(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}(t)?e.removeAttribute(t):(Ie(t)&&(n=t),function(e,t,n){e.getAttribute(t)!=n&&e.setAttribute(t,n)}(e,t,n))}(t,n,i)}}function Te(e,t){return e==t}function Ie(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function Fe(e,t){var n;return function(){var i=this,r=arguments,a=function(){n=null,e.apply(i,r)};clearTimeout(n),n=setTimeout(a,t)}}function Be(e,t){let n;return function(){let i=this,r=arguments;n||(e.apply(i,r),n=!0,setTimeout((()=>n=!1),t))}}var Ge={},Ve=!1,qe={};function Ye(e,t,n){let i=[];for(;i.length;)i.pop()();let r=Object.entries(t).map((([e,t])=>({name:e,value:t}))),a=J(r);r=r.map((e=>a.find((t=>t.name===e.name))?{name:`x-bind:${e.name}`,value:`"${e.value}"`}:e)),H(e,r,n).map((e=>{i.push(e.runCleanups),e()}))}var We={},Ze={get reactive(){return e},get release(){return i},get effect(){return t},get raw(){return r},version:"3.10.3",flushAndStopDeferringMutations:function(){w=!1,P(E),E=[]},dontAutoEvaluateFunctions:function(e){let t=I;I=!1,e(),I=t},disableEffectScheduling:function(e){u=!1,e(),u=!0},setReactivityEngine:function(n){e=n.reactive,i=n.release,t=e=>n.effect(e,{scheduler:e=>{u?function(e){var t;t=e,s.includes(t)||s.push(t),o||a||(a=!0,queueMicrotask(c))}(e):e()}}),r=n.raw},closestDataStack:A,skipDuringClone:Re,addRootSelector:ke,addInitSelector:we,addScopeToNode:N,deferMutations:function(){w=!0},mapAttributes:ae,evaluateLater:B,setEvaluator:function(e){G=e},mergeProxies:C,findClosest:Pe,closestRoot:Ee,interceptor:j,transition:Le,setStyles:Ae,mutateDom:k,directive:U,throttle:Be,debounce:Fe,evaluate:F,initTree:Oe,nextTick:me,prefixed:Z,prefix:function(e){W=e},plugin:function(e){e(Ze)},magic:D,store:function(t,n){if(Ve||(Ge=e(Ge),Ve=!0),void 0===n)return Ge[t];Ge[t]=n,"object"==typeof n&&null!==n&&n.hasOwnProperty("init")&&"function"==typeof n.init&&Ge[t].init(),M(Ge[t])},start:function(){var e;document.body||ge("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's `