```python
from jupyterthemes import get_themes
from jupyterthemes.stylefx import set_nb_theme
themes = get_themes()
set_nb_theme(themes[1])
```

<style> @font-face {
 font-family: 'Droid Sans Mono';
 font-weight: normal;
 font-style: normal;
 src: local('Droid Sans Mono'), url('fonts/droid-sans-mono.woff') format('woff');
}
@font-face {
 font-family: 'Exo_2';
 font-weight: normal;
 font-style: normal;
 src: local('Exo_2'), url('fonts/exo-II-regular.ttf') format('truetype');
}
@font-face {
 font-family: 'Fira Code';
 font-weight: normal;
 font-style: normal;
 src: local('Fira Code'), url('fonts/firacode.otf') format('opentype');
}
@font-face {
 font-family: 'Lora';
 font-weight: normal;
 font-style: normal;
 src: local('Lora'), url('fonts/Lora-Regular.ttf') format('truetype');
}
div#notebook {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 line-height: 170%;
 color: #303030;
}
body,
div.body {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 color: #303030;
 background-color: #ffffff;
 background: #ffffff;
}
body.notebook_app {
 padding: 0;
 background-color: #ffffff;
 background: #ffffff;
 padding-right: 0px !important;
 overflow-y: hidden;
}
a {
 font-family: "Exo_2", sans-serif;
 color: #303030;
}
a:hover,
a:focus {
 color: #2f2f2f;
}
.list_header,
div#notebook_list_header.row.list_header {
 font-size: 14pt;
 color: #2f2f2f;
 background-color: #ffffff;
}
div#cluster_list_header.row.list_header,
div#running .row.list_header {
 font-size: 14pt;
 color: #303030;
 background: #eeeeee;
 background-color: #eeeeee;
 border-bottom: 2px solid rgba(180,180,180,.30);
}
div#cluster_list > div.list_item.row,
div#cluster_list > div.list_item.row:hover {
 background: #f7f7f7;
 background-color: #f7f7f7;
}
div#clusters.tab-pane.active {
 font-size: 12.0pt;
 padding: 4px 0 4px 0;
}
#running .panel-group .panel .panel-heading {
 font-size: 14pt;
 color: #303030;
 padding: 8px 8px;
 background: #eeeeee;
 background-color: #eeeeee;
}
#running .panel-group .panel .panel-heading a {
 font-size: 14pt;
 color: #303030;
}
#running .panel-group .panel .panel-heading a:focus,
#running .panel-group .panel .panel-heading a:hover {
 font-size: 14pt;
 color: #303030;
}
#running .panel-group .panel .panel-body .list_container .list_item {
 background: #f7f7f7;
 background-color: #f7f7f7;
 padding: 2px;
 border-bottom: 2px solid rgba(180,180,180,.30);
}
#running .panel-group .panel .panel-body .list_container .list_item:hover {
 background: #f7f7f7;
 background-color: #f7f7f7;
}
#running .panel-group .panel .panel-body {
 padding: 2px;
}
div.running_list_info.toolbar_info {
 font-size: 12.0pt;
 padding: 4px 0 4px 0;
 height: inherit;
 line-height: inherit;
 text-shadow: none;
}
.list_placeholder {
 font-weight: normal;
}
#tree-selector {
 padding: 0px;
}
#project_name > ul > li > a > i.fa.fa-home {
 color: #ff7823;
 font-size: 17pt;
 display: inline-block;
 position: static;
 padding: 0px 0px;
 font-weight: normal;
 text-align: center;
 vertical-align: text-top;
}
#project_name {
 display: inline-flex;
 padding-left: 7px;
 margin-left: -2px;
 margin-bottom: -20px;
 text-align: -webkit-auto;
 vertical-align: text-top;
}
div#notebook_toolbar div.dynamic-instructions {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
}
.toolbar_info {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 color: #303030;
 text-shadow: none;
 border: none;
 height: inherit;
 line-height: inherit;
}
.list_container {
 font-size: 12.0pt;
 color: #303030;
 border: none;
 text-shadow: none !important;
}
.list_container > div {
 border-bottom: 1px solid rgba(180,180,180,.14);
 font-size: 12.0pt;
}
.list_header > div,
.list_item > div {
 padding-left: 0px;
}
.list_header > div input,
.list_item > div input {
 top: 0px;
}
.list_header > div .item_link,
.list_item > div .item_link {
 margin-left: -1px;
 vertical-align: middle;
 line-height: 22px;
 font-size: 12.0pt;
}
.item_icon {
 font-size: 12.0pt;
 vertical-align: middle;
}
.list_item input:not([type="checkbox"]) {
 padding-right: 0px;
 height: auto;
 width: 20%;
 margin: 6px 0 0;
 margin-top: 1px;
}
#button-select-all {
 height: auto;
 font-size: 12.0pt;
 padding: 5px;
 min-width: 65px;
 z-index: 0;
}
button#tree-selector-btn {
 height: auto;
 font-size: 12.0pt;
 padding: 5px;
}
input#select-all.pull-left.tree-selector {
 margin-left: 7px;
 margin-right: 2px;
 margin-top: 5px;
}
input[type="radio"],
input[type="checkbox"] {
 margin: 6px 0 0;
 margin-top: 1px;
 line-height: normal;
}
.list_container a {
 font-size: 17px;
 color: #303030;
 border: none;
 text-shadow: none !important;
 font-weight: normal;
 font-style: normal;
}
div.list_container a:hover {
 color: #2f2f2f;
}
div.list_item:hover {
 background-color: #fafafa;
}
.breadcrumb > li {
 font-size: 12.0pt;
 color: #303030;
 border: none;
 text-shadow: none !important;
}
ul#tabs a {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 font-weight: normal;
 font-style: normal;
 border-color: transparent;
 text-shadow: none !important;
}
.nav-tabs {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 font-weight: normal;
 font-style: normal;
 background: #ffffff;
 text-shadow: none !important;
 border-color: transparent;
 border-bottom-color: rgba(180,180,180,.30);
}
.nav-tabs > li > a:hover {
 color: #2f2f2f;
 background-color: rgba(180,180,180,.14);
}
.nav-tabs > li > a:active,
.nav-tabs > li > a:focus,
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
 color: #1c1c1c;
 background-color: #eeeeee;
 border: 1px solid transparent;
 border-bottom-color: transparent;
 cursor: default;
}
.nav > li > a:hover,
.nav > li > a:focus {
 text-decoration: none;
 background-color: rgba(180,180,180,.14);
}
.nav > li.disabled > a,
.nav > li.disabled > a:hover {
 color: #aaaaaa;
}
div#notebook {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 padding-top: 4px;
}
.notebook_app {
 background-color: #ffffff;
}
#notebook-container {
 padding: 13px;
 background-color: #ffffff;
 min-height: 0px;
 box-shadow: none;
 width: 980px;
 margin-right: auto;
 margin-left: auto;
}
div#ipython-main-app.container {
 width: 980px;
 margin-right: auto;
 margin-left: auto;
 margin-right: auto;
 margin-left: auto;
}
.container {
 width: 980px;
 margin-right: auto;
 margin-left: auto;
}
.notebook_app #header {
 box-shadow: none !important;
 background-color: #ffffff;
 border-bottom: 2px solid rgba(180,180,180,.14);
}
#header {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 box-shadow: none;
 background-color: #ffffff;
}
#header .header-bar {
 background: #ffffff;
 background-color: #ffffff;
}
body > #header .header-bar {
 width: 100%;
 background: #ffffff;
}
#menubar {
 background-color: #ffffff;
}
#menubar .navbar,
.navbar-default {
 background-color: #ffffff;
 margin-bottom: 0px;
}
.navbar {
 border: none;
}
.navbar-default {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 background-color: #ffffff;
 border-color: rgba(180,180,180,.14);
 line-height: 1.5em;
 padding-bottom: 0px;
}
.navbar-default .navbar-nav > li > a {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 color: #303030;
 display: block;
 line-height: 1.5em;
 padding-top: 8px;
 padding-bottom: 6px;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
 color: #2f2f2f;
 background-color: rgba(180,180,180,.14);
 border-color: rgba(180,180,180,.14);
 line-height: 1.5em;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
 color: #1c1c1c;
 background-color: rgba(180,180,180,.14);
 border-color: rgba(180,180,180,.14);
 line-height: 1.5em;
}
.edit_mode .modal_indicator:before {
 font-size: 13pt;
 color: #2c85f7;
 content: "\f040";
}
.item_icon {
 color: #126dce;
}
.item_buttons .kernel-name {
 font-size: 13pt;
 color: #126dce;
 line-height: 22px;
}
.running_notebook_icon:before {
 color: #009e07 !important;
}
.item_buttons .running-indicator {
 padding-top: 2px;
 color: #009e07;
}
#modal_indicator {
 float: right !important;
 color: #126dce;
 background: #ffffff;
 background-color: #ffffff;
}
#kernel_indicator {
 float: right !important;
 color: #ff7823;
 background: #ffffff;
 background-color: #ffffff;
 font-size: 14.5pt;
 border-left: 2px solid #ff7823;
 padding-bottom: 2px;
}
#kernel_indicator .kernel_indicator_name {
 color: #ff7823;
 background: #ffffff;
 background-color: #ffffff;
 font-size: 14.5pt;
 padding-left: 5px;
 padding-right: 5px;
}
div.notification_widget.info,
.notification_widget.info,
.notification_widget:active:hover,
.notification_widget.active:hover,
.open > .dropdown-toggle.notification_widget:hover,
.notification_widget:active:focus,
.notification_widget.active:focus,
.open > .dropdown-toggle.notification_widget:focus,
.notification_widget:active.focus,
.notification_widget.active.focus,
.open > .dropdown-toggle.notification_widget.focus,
div#notification_notebook.notification_widget.btn.btn-xs.navbar-btn,
div#notification_notebook.notification_widget.btn.btn-xs.navbar-btn:hover,
div#notification_notebook.notification_widget.btn.btn-xs.navbar-btn:focus {
 color: #126dce;
 background-color: #ffffff;
 border-color: #ffffff;
}
#notification_area,
div.notification_area {
 float: right !important;
 position: static;
}
#kernel_logo_widget,
#kernel_logo_widget .current_kernel_logo {
 display: none;
}
div#ipython_notebook {
 display: none;
}
i.fa.fa-icon {
 -webkit-font-smoothing: antialiased;
 -moz-osx-font-smoothing: grayscale;
 text-rendering: auto;
}
.fa {
 display: inline-block;
 font: normal normal normal 12pt/1 "FontAwesome", "Exo_2", sans-serif;
 text-rendering: auto;
 -webkit-font-smoothing: antialiased;
 -moz-osx-font-smoothing: grayscale;
}
.dropdown-menu {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 box-shadow: none;
 padding: 0px;
 text-align: left;
 border: 2px solid rgba(180,180,180,.30);
 background-color: #ffffff;
 background: #ffffff;
 line-height: 1.3;
 margin: 0px;
}
.dropdown-menu:hover {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 border: 2px solid rgba(180,180,180,.30);
 background-color: #ffffff;
 box-shadow: none;
 line-height: 1.3;
}
.dropdown-header {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 display: block;
 color: #ff7823;
 text-decoration: underline;
 white-space: nowrap;
 padding: 8px 0px 0px 6px;
 line-height: 1.3;
}
.dropdown-menu > li > a {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 line-height: 1.3;
 display: block;
 padding: 10px 25px 10px 14px;
 color: #303030;
 background-color: #ffffff;
 background: #ffffff;
}
.dropdown-menu > li > a:hover {
 color: #2f2f2f;
 background-color: rgba(180,180,180,.14);
 background: rgba(180,180,180,.14);
 border-color: rgba(180,180,180,.14);
}
.dropdown-menu .divider {
 height: 2px;
 margin: 0px 0px;
 overflow: hidden;
 background-color: rgba(180,180,180,.30);
}
.dropdown-submenu > .dropdown-menu {
 top: 0;
 left: 100%;
 margin-top: -2px;
 margin-left: 0px;
 padding-top: 0px;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 font-weight: normal;
 color: #aaaaaa;
 padding: none;
 display: block;
 clear: both;
 line-height: 1.2;
 white-space: nowrap;
}
.dropdown-submenu > a:after {
 color: #303030;
 margin-right: -16px;
}
.dropdown-submenu:hover > a:after,
.dropdown-submenu:active > a:after,
.dropdown-submenu:focus > a:after,
.dropdown-submenu:visited > a:after {
 color: #ff7823;
 margin-right: -16px;
}
div.kse-dropdown > .dropdown-menu,
.kse-dropdown > .dropdown-menu {
 min-width: 0;
 top: 94%;
}
.btn,
.btn-default {
 font-family: "Exo_2", sans-serif;
 color: #303030;
 background: #ebebeb;
 background-color: #ebebeb;
 border: 2px solid #e8e8e8;
 font-weight: normal;
 box-shadow: none;
 text-shadow: none;
 border-radius: 2px;
 font-size: inherit;
}
.btn:hover,
.btn:active:hover,
.btn.active:hover,
.btn-default:hover,
.open > .dropdown-toggle.btn-default:hover,
.open > .dropdown-toggle.btn:hover {
 color: #2f2f2f;
 background-color: #e4e4e4;
 background: #e4e4e4;
 border-color: #e4e4e4;
 background-image: none;
 box-shadow: none !important;
 border-radius: 2px;
}
.btn:active,
.btn.active,
.btn:active:focus,
.btn.active:focus,
.btn:active.focus,
.btn.active.focus,
.btn-default:focus,
.btn-default.focus,
.btn-default:active,
.btn-default.active,
.btn-default:active:hover,
.btn-default.active:hover,
.btn-default:active:focus,
.btn-default.active:focus,
.btn-default:active.focus,
.btn-default.active.focus,
.open > .dropdown-toggle.btn:focus,
.open > .dropdown-toggle.btn.focus,
.open > .dropdown-toggle.btn-default {
 color: #1c1c1c;
 background-color: #e4e4e4;
 background: #e4e4e4;
 border-color: #e4e4e4;
 background-image: none;
 box-shadow: none !important;
 border-radius: 2px;
}
.item_buttons > .btn,
.item_buttons > .btn-group,
.item_buttons > .input-group {
 margin-left: 5px;
 background: #eeeeee;
 background-color: #eeeeee;
 border: 2px solid #eeeeee;
}
.item_buttons > .btn:hover,
.item_buttons > .btn-group:hover,
.item_buttons > .input-group:hover {
 margin-left: 5px;
 background: #e9e9e9;
 background-color: #e9e9e9;
 border: 2px solid #e9e9e9;
}
.btn-group > .btn-mini,
.btn-sm,
.btn-group-sm > .btn,
.btn-xs,
.btn-group-xs > .btn,
.alternate_upload .btn-upload,
.btn-group,
.btn-group-vertical {
 font-size: 12.0pt;
 font-weight: normal;
}
.btn-xs,
.btn-group-xs > .btn {
 font-size: 12.0pt;
 background-image: none;
 font-weight: normal;
 text-shadow: none;
 display: inline-table;
}
.alternate_upload .btn-upload {
 display: none;
}
.alternate_upload input.fileinput {
 display: none;
}
button.close {
 border: 0px none;
 font-family: sans-serif;
 font-size: 25pt;
}
.dynamic-buttons {
 font-size: inherit;
 padding-top: 0px;
 display: inline-block;
}
.close {
 color: #de143d;
 opacity: .5;
 text-shadow: none;
}
.close:hover {
 color: #de143d;
 opacity: 1;
}
div.btn.btn-default.output_collapsed {
 background: #eeeeee;
 background-color: #eeeeee;
 border-color: #eeeeee;
}
div.btn.btn-default.output_collapsed:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border-color: #e9e9e9;
}
div.nbext-enable-btns .btn[disabled],
div.nbext-enable-btns .btn[disabled]:hover,
.btn-default.disabled,
.btn-default[disabled],
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled.focus,
.btn-default[disabled].focus,
fieldset[disabled] .btn-default.focus {
 color: #4a4a4a;
 background: #e8e8e8;
 background-color: #e8e8e8;
 border-color: #e8e8e8;
}
.input-group-addon {
 padding: 2px 5px;
 font-size: 12.0pt;
 font-weight: normal;
 height: auto;
 color: #303030;
 text-align: center;
 background-color: #ffffff;
 border: none;
}
.btn-group > .btn + .dropdown-toggle {
 padding-left: 8px;
 padding-right: 8px;
 height: 100%;
 border-left: 2px solid #ff7823 !important;
}
.btn-group > .btn + .dropdown-toggle:hover {
 border-left: 2px solid #ff7823 !important;
}
.input-group-btn {
 position: relative;
 font-size: inherit;
 white-space: nowrap;
}
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group {
 background: #eeeeee;
 background-color: #eeeeee;
 border: 1px solid #e9e9e9;
 margin: 2px;
 font-size: inherit;
}
.input-group-btn:first-child > .btn:hover,
.input-group-btn:first-child > .btn-group:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border: 1px solid #e9e9e9;
 margin: 2px;
 font-size: inherit;
}
div.modal .btn-group > .btn:first-child {
 background: #eeeeee;
 background-color: #eeeeee;
 border: 1px solid #e9e9e9;
 margin-top: 0px !important;
 margin-left: 0px;
 margin-bottom: 2px;
}
div.modal .btn-group > .btn:first-child:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border: 1px solid #e9e9e9;
}
div.modal > button,
div.modal-footer > button {
 background: #eeeeee;
 background-color: #eeeeee;
 border-color: #eeeeee;
}
div.modal > button:hover,
div.modal-footer > button:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border-color: #e9e9e9;
}
.modal-content {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 position: relative;
 background: #eeeeee;
 background-color: #eeeeee;
 border: none;
 border-radius: 1px;
 background-clip: padding-box;
 outline: none;
}
.modal-header {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 color: #303030;
 background: #eeeeee;
 background-color: #eeeeee;
 border-color: rgba(180,180,180,.30);
 padding: 12px;
 min-height: 16.4286px;
}
.modal-content h4 {
 font-family: "Exo_2", sans-serif;
 font-size: 16pt;
 color: #303030;
 padding: 5px;
}
.modal-body {
 background-color: #ffffff;
 position: relative;
 padding: 15px;
}
.modal-footer {
 padding: 10px;
 text-align: right;
 background-color: #f7f7f7;
 border-top: 1px solid rgba(180,180,180,.30);
}
.alert-info {
 background-color: #fdfdfd;
 border-color: rgba(180,180,180,.30);
 color: #303030;
}
.modal-header .close {
 margin-top: -5px;
 font-size: 25pt;
}
.modal-backdrop,
.modal-backdrop.in {
 opacity: 0.75;
 background-color: #eeeeee;
}
div.panel,
div.panel-default,
.panel,
.panel-default {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 background-color: #f7f7f7;
 color: #303030;
 margin-bottom: 14px;
 border: 0;
 box-shadow: none;
}
div.panel > .panel-heading,
div.panel-default > .panel-heading {
 font-size: 14pt;
 color: #303030;
 background: #eeeeee;
 background-color: #eeeeee;
 border: 0;
}
.modal .modal-dialog {
 min-width: 950px;
 margin: 50px auto;
}
div.container-fluid {
 margin-right: auto;
 margin-left: auto;
 padding-left: 7px;
 padding-right: 12px;
}
div.form-control,
.form-control {
 font-family: "Exo_2", sans-serif;
 font-size: inherit;
 color: #303030;
 background-color: #ffffff;
 border: 2px solid #e7e7e7;
 margin-left: 2px;
 height: auto;
 box-shadow: none;
 padding: 6px 12px;
 transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
}
.form-group.list-group-item {
 color: #303030;
 background-color: #f7f7f7;
 border-color: rgba(180,180,180,.30);
 margin-bottom: 0px;
}
input,
button,
select,
textarea {
 background-color: #ffffff;
 font-weight: normal;
 border: 2px solid rgba(180,180,180,.30);
}
select.form-control.select-xs {
 height: auto;
}
div.output.output_scroll {
 box-shadow: none;
}
::-webkit-scrollbar-track {
 -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.11);
 background-color: #d0d0d0;
 border-radius: 6px;
}
::-webkit-scrollbar {
 width: 14px;
 height: 10px;
 background-color: #d0d0d0;
 border-radius: 6px;
}
::-webkit-scrollbar-thumb {
 background-color: #ffffff;
 background-image: -webkit-gradient(linear,40% 0%,75% 86%,from(#ff6b0f ),color-stop(0.5,#ff8b42 ),to(#ff6b0f ));
 min-height: 60px;
 border-radius: 2px;
}
div.input_area {
 background-color: #efefef;
 padding-right: 1.2em;
 border: 0px;
 border-top-left-radius: 0px;
 border-top-right-radius: 2px;
 border-bottom-left-radius: 0px;
 border-bottom-right-radius: 0px;
}
div.cell {
 padding: 0px;
 background: #efefef;
 background-color: #efefef;
 border: medium solid #ffffff;
 border-top-right-radius: 2px;
 border-top-left-radius: 2px;
}
div.cell.selected {
 background: #efefef;
 background-color: #efefef;
 border: medium solid #ff7823;
 padding: 0px;
 border-top-right-radius: 2px;
 border-top-left-radius: 2px;
}
.edit_mode div.cell.selected {
 padding: 0px;
 background: #efefef;
 background-color: #efefef;
 border: medium solid #ffd5bb;
 border-top-right-radius: 2px;
 border-top-left-radius: 2px;
}
div.cell.edit_mode {
 padding: 0px;
 background: #efefef;
 background-color: #efefef;
 border: medium solid #ffd5bb;
 border-top-right-radius: 2px;
 border-top-left-radius: 2px;
}
div.prompt,
.prompt {
 font-family: "Fira Code", monospace;
 font-size: 9.5pt;
 font-weight: normal;
 color: #aaaaaa;
 line-height: 170%;
 padding: 0px;
 padding-top: 4px;
 padding-left: .25em;
 text-align: left !important;
 min-width: 12ex;
 width: 12ex;
}
div.prompt.input_prompt {
 background-color: #efefef;
 border-right: 2px solid rgba(240,147,43,.50);
 border-top-left-radius: 2px;
 border-top-right-radius: 0px;
 border-bottom-left-radius: 0px;
 border-bottom-right-radius: 0px;
 min-width: 12ex;
 width: 12ex !important;
}
div.output_wrapper {
 background-color: #ffffff;
 border: 0px;
 margin-bottom: 0em;
 margin-top: 0em;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 border-bottom-left-radius: 2px;
 border-bottom-right-radius: 2px;
}
div.output_subarea.output_text.output_stream.output_stdout,
div.output_subarea.output_text {
 font-family: "Droid Sans Mono", monospace;
 font-size: 10.0pt;
 line-height: 150% !important;
 background-color: #ffffff;
 color: #303030;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 border-bottom-left-radius: 2px;
 border-bottom-right-radius: 2px;
}
div.output_area pre {
 font-family: "Droid Sans Mono", monospace;
 font-size: 10.0pt;
 line-height: 150% !important;
 color: #303030;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 border-bottom-left-radius: 2px;
 border-bottom-right-radius: 2px;
}
div.output_area {
 display: -webkit-box;
}
div.output_html {
 font-family: "Droid Sans Mono", monospace;
 font-size: 10.0pt;
 color: #353535;
 background-color: #ffffff;
 background: #ffffff;
}
div.output_subarea {
 overflow-x: auto;
 padding: .8em;
 -webkit-box-flex: 1;
 -moz-box-flex: 1;
 box-flex: 1;
 flex: 1;
 max-width: 90%;
}
div.prompt.output_prompt {
 font-family: "Fira Code", monospace;
 font-size: 9.5pt;
 background-color: #ffffff;
 color: #ffffff;
 border-bottom-left-radius: 2px;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 border-bottom-right-radius: 0px;
 min-width: 12ex;
 width: 12ex;
}
div.out_prompt_overlay.prompt {
 font-family: "Fira Code", monospace;
 font-size: 9.5pt;
 background-color: #ffffff;
 border-bottom-left-radius: 2px;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 border-bottom-right-radius: 0px;
 min-width: 12ex;
 width: 12ex;
}
div.out_prompt_overlay.prompt:hover {
 background-color: #ffffff;
 box-shadow: #e8e8e8 2px 1px 2px 2.5px inset;
 border-bottom-left-radius: 2px;
 -webkit-border-: 2px;
 -moz-border-radius: 2px;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 min-width: 12ex;
 width: 12ex !important;
}
div.text_cell,
div.text_cell_render pre,
div.text_cell_render {
 font-family: "Lora", serif;
 font-size: 13pt;
 line-height: 170% !important;
 color: #353535;
 background: #ffffff;
 background-color: #ffffff;
 border-radius: 2px;
}
div.cell.text_cell.rendered.selected {
 font-family: "Lora", serif;
 border: medium solid #126dce;
 line-height: 170% !important;
 background: #ffffff;
 background-color: #ffffff;
 border-radius: 2px;
}
div.cell.text_cell.unrendered.selected {
 font-family: "Lora", serif;
 line-height: 170% !important;
 background: #ffffff;
 background-color: #ffffff;
 border: medium solid #126dce;
 border-radius: 2px;
}
div.cell.text_cell.selected {
 font-family: "Lora", serif;
 line-height: 170% !important;
 border: medium solid #126dce;
 background: #ffffff;
 background-color: #ffffff;
 border-radius: 2px;
}
.edit_mode div.cell.text_cell.selected {
 font-family: "Lora", serif;
 line-height: 170% !important;
 background: #ffffff;
 background-color: #ffffff;
 border: medium solid #87b0db;
 border-radius: 2px;
}
div.text_cell.unrendered,
div.text_cell.unrendered.selected,
div.edit_mode div.text_cell.unrendered {
 font-family: "Lora", serif;
 line-height: 170% !important;
 background: #ffffff;
 background-color: #ffffff;
 border-radius: 2px;
}
div.cell.text_cell.rendered .input_prompt {
 font-family: "Fira Code", monospace;
 font-size: 9.5pt;
 font-weight: normal;
 color: #aaaaaa;
 text-align: left !important;
 min-width: 0ex;
 width: 0ex !important;
 background-color: #ffffff;
 border-right: 2px solid transparent;
}
div.cell.text_cell.unrendered .input_prompt {
 font-family: "Fira Code", monospace;
 font-size: 9.5pt;
 font-weight: normal;
 color: #aaaaaa;
 text-align: left !important;
 min-width: 0ex;
 width: 0ex !important;
 border-right: 2px solid transparent;
}
div.rendered_html code {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt;
 padding-top: 3px;
 color: #303030;
 background: #efefef;
 background-color: #efefef;
}
pre,
code,
kbd,
samp {
 white-space: pre-wrap;
}
code {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt !important;
 line-height: 170% !important;
 color: #353535;
 background: #efefef;
 background-color: #efefef;
}
kbd {
 padding: 4px;
 font-size: 11pt;
 color: #303030;
 background-color: #efefef;
 border: 0;
 box-shadow: none;
}
pre {
 display: block;
 padding: 8.5px;
 margin: 0 0 9px;
 font-size: 12.0pt;
 line-height: 1.42857143;
 color: #303030;
 background-color: #efefef;
 border: 1px solid #e7e7e7;
 border-radius: 2px;
}
div.rendered_html {
 color: #353535;
}
div.rendered_html pre,
div.text_cell_render pre {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt !important;
 line-height: 170% !important;
 color: #353535;
 background: #efefef;
 background-color: #efefef;
 border: 2px #e7e7e7  solid;
 max-width: 86%;
 border-radius: 2px;
 padding: 5px;
}
div.text_cell_render h1,
div.rendered_html h1,
div.text_cell_render h2,
div.rendered_html h2,
div.text_cell_render h3,
div.rendered_html h3,
div.text_cell_render h4,
div.rendered_html h4,
div.text_cell_render h5,
div.rendered_html h5 {
 font-family: "Exo_2", sans-serif;
}
.rendered_html h1:first-child,
.rendered_html h2:first-child,
.rendered_html h3:first-child,
.rendered_html h4:first-child,
.rendered_html h5:first-child,
.rendered_html h6:first-child {
 margin-top: 0.2em;
}
.rendered_html h1,
.text_cell_render h1 {
 color: #126dce;
 font-size: 220%;
 text-align: center;
 font-weight: lighter;
}
.rendered_html h2,
.text_cell_render h2 {
 text-align: left;
 font-size: 170%;
 color: #126dce;
 font-style: normal;
 font-weight: lighter;
}
.rendered_html h3,
.text_cell_render h3 {
 font-size: 150%;
 color: #126dce;
 font-weight: lighter;
 text-decoration: italic;
 font-style: normal;
}
.rendered_html h4,
.text_cell_render h4 {
 font-size: 120%;
 color: #126dce;
 font-weight: underline;
 font-style: normal;
}
.rendered_html h5,
.text_cell_render h5 {
 font-size: 100%;
 color: #2f2f2f;
 font-weight: lighter;
 text-decoration: underline;
}
.rendered_html table,
.rendered_html tr,
.rendered_html td {
 font-family: "Fira Code", monospace;
 font-size: 10.0pt !important;
 line-height: 150% !important;
 border: 1px solid #d6d6d6;
 color: #353535;
 background-color: #ffffff;
 background: #ffffff;
}
table.dataframe,
.rendered_html tr,
.dataframe * {
 font-family: "Fira Code", monospace;
 font-size: 10.0pt !important;
 border: 1px solid #d6d6d6;
}
.dataframe th,
.rendered_html th {
 font-family: "Exo_2", sans-serif;
 font-size: 11pt !important;
 font-weight: bold;
 border: 1px solid #c4c4c4;
 background: #eeeeee;
}
.dataframe td,
.rendered_html td {
 font-family: "Fira Code", monospace;
 font-size: 10.0pt !important;
 color: #353535;
 background: #ffffff;
 border: 1px solid #d6d6d6;
 text-align: left;
 min-width: 4em;
}
.dataframe-summary-row tr:last-child,
.dataframe-summary-col td:last-child {
 font-family: "Exo_2", sans-serif;
 font-size: 11pt !important;
 font-weight: bold;
 color: #353535;
 border: 1px solid #d6d6d6;
 background: #eeeeee;
}
div.widget-area {
 background-color: #ffffff;
 background: #ffffff;
 color: #303030;
}
div.widget-area a {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 font-weight: normal;
 font-style: normal;
 color: #303030;
 text-shadow: none !important;
}
div.widget-area a:hover,
div.widget-area a:focus {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 font-weight: normal;
 font-style: normal;
 color: #2f2f2f;
 background: rgba(180,180,180,.14);
 background-color: rgba(180,180,180,.14);
 border-color: transparent;
 background-image: none;
 text-shadow: none !important;
}
div.widget_item.btn-group > button.btn.btn-default.widget-combo-btn,
div.widget_item.btn-group > button.btn.btn-default.widget-combo-btn:hover {
 background: #eeeeee;
 background-color: #eeeeee;
 border: 2px solid #eeeeee !important;
 font-size: inherit;
 z-index: 0;
}
div.jupyter-widgets.widget-hprogress.widget-hbox,
div.widget-hbox,
.widget-hbox {
 display: inline-table;
}
div.jupyter-widgets.widget-hprogress.widget-hbox .widget-label,
div.widget-hbox .widget-label,
.widget-hbox .widget-label {
 font-size: 11pt;
 min-width: 100%;
 padding-top: 5px;
 padding-right: 10px;
 text-align: left;
 vertical-align: text-top;
}
.progress {
 overflow: hidden;
 height: 20px;
 margin-bottom: 10px;
 padding-left: 10px;
 background-color: #c6c6c6;
 border-radius: 4px;
 -webkit-box-shadow: none;
 box-shadow: none;
}
.rendered_html :link {
 font-family: "Exo_2", sans-serif;
 font-size: 100%;
 color: #2c85f7;
 text-decoration: underline;
}
.rendered_html :visited,
.rendered_html :visited:active,
.rendered_html :visited:focus {
 color: #2e6eb2;
}
.rendered_html :visited:hover,
.rendered_html :link:hover {
 font-family: "Exo_2", sans-serif;
 font-size: 100%;
 color: #eb6a18;
}
a.anchor-link:link:hover {
 font-size: inherit;
 color: #eb6a18;
}
a.anchor-link:link {
 font-size: inherit;
 text-decoration: none;
 padding: 0px 20px;
 visibility: none;
 color: #126dce;
}
div#nbextensions-configurator-container.container {
 width: 980px;
 margin-right: 0;
 margin-left: 0;
}
div.nbext-selector > nav > .nav > li > a {
 font-family: "Exo_2", sans-serif;
 font-size: 12pt;
}
div.nbext-readme > .nbext-readme-contents > .rendered_html {
 font-family: "Exo_2", sans-serif;
 font-size: 12pt;
 line-height: 145%;
 padding: 1em 1em;
 color: #353535;
 background-color: #ffffff;
 -webkit-box-shadow: none;
 -moz-box-shadow: none;
 box-shadow: none;
}
.nbext-icon,
.nbext-desc,
.nbext-compat-div,
.nbext-enable-btns,
.nbext-params {
 margin-bottom: 8px;
 font-size: 12pt;
}
div.nbext-readme > .nbext-readme-contents {
 padding: 0;
 overflow-y: hidden;
}
div.nbext-readme > .nbext-readme-contents:not(:empty) {
 margin-top: 0.5em;
 margin-bottom: 2em;
 border: none;
 border-top-color: rgba(180,180,180,.30);
}
.nbext-showhide-incompat {
 padding-bottom: 0.5em;
 color: #4a4a4a;
 font-size: 12.0pt;
}
.shortcut_key,
span.shortcut_key {
 display: inline-block;
 width: 16ex;
 text-align: right;
 font-family: monospace;
}
mark,
.mark {
 background-color: #ffffff;
 color: #353535;
 padding: .15em;
}
a.text-warning,
a.text-warning:hover {
 color: #aaaaaa;
}
a.text-warning.bg-warning {
 background-color: #ffffff;
}
span.bg-success.text-success {
 background-color: transparent;
 color: #009e07;
}
span.bg-danger.text-danger {
 background-color: #ffffff;
 color: #de143d;
}
.has-success .input-group-addon {
 color: #009e07;
 border-color: transparent;
 background: inherit;
 background-color: rgba(83,180,115,.10);
}
.has-success .form-control {
 border-color: #009e07;
 -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.025);
 box-shadow: inset 0 1px 1px rgba(0,0,0,0.025);
}
.has-error .input-group-addon {
 color: #de143d;
 border-color: transparent;
 background: inherit;
 background-color: rgba(192,57,67,.10);
}
.has-error .form-control {
 border-color: #de143d;
 -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.025);
 box-shadow: inset 0 1px 1px rgba(0,0,0,0.025);
}
.kse-input-group-pretty > kbd {
 font-family: "Droid Sans Mono", monospace;
 color: #303030;
 font-weight: normal;
 background: transparent;
}
.kse-input-group-pretty > kbd {
 font-family: "Droid Sans Mono", monospace;
 color: #303030;
 font-weight: normal;
 background: transparent;
}
div.nbext-enable-btns .btn[disabled],
div.nbext-enable-btns .btn[disabled]:hover,
.btn-default.disabled,
.btn-default[disabled] {
 background: #e8e8e8;
 background-color: #e8e8e8;
 color: #282828;
}
label#Keyword-Filter {
 display: none;
}
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
 color: #ffffff;
 background-color: #126dce;
}
.input-group .nbext-list-btn-add,
.input-group-btn:last-child > .btn-group > .btn {
 background: #eeeeee;
 background-color: #eeeeee;
 border-color: #eeeeee;
}
.input-group .nbext-list-btn-add:hover,
.input-group-btn:last-child > .btn-group > .btn:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border-color: #e9e9e9;
}
#notebook-container > div.cell.code_cell.rendered.selected > div.widget-area > div.widget-subarea > div > div.widget_item.btn-group > button.btn.btn-default.dropdown-toggle.widget-combo-carrot-btn {
 background: #eeeeee;
 background-color: #eeeeee;
 border-color: #eeeeee;
}
#notebook-container > div.cell.code_cell.rendered.selected > div.widget-area > div.widget-subarea > div > div.widget_item.btn-group > button.btn.btn-default.dropdown-toggle.widget-combo-carrot-btn:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border-color: #e9e9e9;
}
input.raw_input {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt !important;
 color: #303030;
 background-color: #efefef;
 border-color: #ececec;
 background: #ececec;
 width: auto;
 vertical-align: baseline;
 padding: 0em 0.25em;
 margin: 0em 0.25em;
 -webkit-box-shadow: none;
 box-shadow: none;
}
audio,
video {
 display: inline;
 vertical-align: middle;
 align-content: center;
 margin-left: 20%;
}
.cmd-palette .modal-body {
 padding: 0px;
 margin: 0px;
}
.cmd-palette form {
 background: #eeeeee;
 background-color: #eeeeee;
}
.typeahead-field input:last-child,
.typeahead-hint {
 background: #eeeeee;
 background-color: #eeeeee;
 z-index: 1;
}
.typeahead-field input {
 font-family: "Exo_2", sans-serif;
 color: #303030;
 border: none;
 font-size: 28pt;
 display: inline-block;
 line-height: inherit;
 padding: 3px 10px;
 height: 70px;
}
.typeahead-select {
 background-color: #eeeeee;
}
body > div.modal.cmd-palette.typeahead-field {
 display: table;
 border-collapse: separate;
 background-color: #f7f7f7;
}
.typeahead-container button {
 font-family: "Exo_2", sans-serif;
 font-size: 28pt;
 background-color: #d0d0d0;
 border: none;
 display: inline-block;
 line-height: inherit;
 padding: 3px 10px;
 height: 70px;
}
.typeahead-search-icon {
 min-width: 40px;
 min-height: 55px;
 display: block;
 vertical-align: middle;
 text-align: center;
}
.typeahead-container button:focus,
.typeahead-container button:hover {
 color: #2f2f2f;
 background-color: #ff7823;
 border-color: #ff7823;
}
.typeahead-list > li.typeahead-group.active > a,
.typeahead-list > li.typeahead-group > a,
.typeahead-list > li.typeahead-group > a:focus,
.typeahead-list > li.typeahead-group > a:hover {
 display: none;
}
.typeahead-dropdown > li > a,
.typeahead-list > li > a {
 color: #303030;
 text-decoration: none;
}
.typeahead-dropdown,
.typeahead-list {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 color: #303030;
 background-color: #ffffff;
 border: none;
 background-clip: padding-box;
 margin-top: 0px;
 padding: 3px 2px 3px 0px;
 line-height: 1.7;
}
.typeahead-dropdown > li.active > a,
.typeahead-dropdown > li > a:focus,
.typeahead-dropdown > li > a:hover,
.typeahead-list > li.active > a,
.typeahead-list > li > a:focus,
.typeahead-list > li > a:hover {
 color: #2f2f2f;
 background-color: #f7f7f7;
 border-color: #f7f7f7;
}
.command-shortcut:before {
 content: "(command)";
 padding-right: 3px;
 color: #aaaaaa;
}
.edit-shortcut:before {
 content: "(edit)";
 padding-right: 3px;
 color: #aaaaaa;
}
ul.typeahead-list i {
 margin-left: 1px;
 width: 18px;
 margin-right: 10px;
}
ul.typeahead-list {
 max-height: 50vh;
 overflow: auto;
}
.typeahead-list > li {
 position: relative;
 border: none;
}
div.input.typeahead-hint,
input.typeahead-hint,
body > div.modal.cmd-palette.in > div > div > div > form > div > div.typeahead-field > span.typeahead-query > input.typeahead-hint {
 color: #aaaaaa !important;
 background-color: transparent;
 padding: 3px 10px;
}
.typeahead-dropdown > li > a,
.typeahead-list > li > a {
 display: block;
 padding: 5px;
 clear: both;
 font-weight: 400;
 line-height: 1.7;
 border: 1px solid #ffffff;
 border-bottom-color: rgba(180,180,180,.30);
}
body > div.modal.cmd-palette.in > div {
 min-width: 750px;
 margin: 150px auto;
}
.typeahead-container strong {
 font-weight: bolder;
 color: #ff7823;
}
#find-and-replace #replace-preview .match,
#find-and-replace #replace-preview .insert {
 color: #ffffff;
 background-color: #ff7823;
 border-color: #ff7823;
 border-style: solid;
 border-width: 1px;
 border-radius: 0px;
}
#find-and-replace #replace-preview .replace .match {
 background-color: #de143d;
 border-color: #de143d;
 border-radius: 0px;
}
#find-and-replace #replace-preview .replace .insert {
 background-color: #009e07;
 border-color: #009e07;
 border-radius: 0px;
}
div.CodeMirror,
div.CodeMirror pre {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt;
 line-height: 170%;
 color: #303030;
}
div.CodeMirror-lines {
 padding-bottom: .6em;
 padding-left: .5em;
 padding-right: 1.5em;
 padding-top: 4px;
}
span.ansiblack {
 color: #dc4384;
}
span.ansiblue {
 color: #009e07;
}
span.ansigray {
 color: #ff7823;
}
span.ansigreen {
 color: #333333;
}
span.ansipurple {
 color: #653bc5;
}
span.ansicyan {
 color: #055be0;
}
span.ansiyellow {
 color: #ff7823;
}
span.ansired {
 color: #de143d;
}
div.output-stderr {
 background-color: #ebb5b7;
}
div.output-stderr pre {
 color: #000000;
}
div.js-error {
 color: #de143d;
}
.ipython_tooltip {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt;
 line-height: 170%;
 border: 2px solid #dadada;
 background: #eeeeee;
 background-color: #eeeeee;
 border-radius: 2px;
 overflow-x: visible;
 overflow-y: visible;
 box-shadow: none;
 position: absolute;
 z-index: 1000;
}
.ipython_tooltip .tooltiptext pre {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt;
 line-height: 170%;
 background: #eeeeee;
 background-color: #eeeeee;
 color: #303030;
 overflow-x: visible;
 overflow-y: visible;
 max-width: 900px;
}
div#tooltip.ipython_tooltip {
 overflow-x: wrap;
 overflow-y: visible;
 max-width: 800px;
}
div.tooltiptext.bigtooltip {
 overflow-x: visible;
 overflow-y: scroll;
 height: 400px;
 max-width: 800px;
}
.cm-s-ipython.CodeMirror {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt;
 background: #efefef;
 color: #303030;
 border-radius: 2px;
 font-style: normal;
 font-weight: normal;
}
.cm-s-ipython div.CodeMirror-selected {
 background: #e0e1e3;
}
.cm-s-ipython .CodeMirror-gutters {
 background: #e0e1e3;
 border: none;
 border-radius: 0px;
}
.cm-s-ipython .CodeMirror-linenumber {
 color: #aaaaaa;
}
.cm-s-ipython .CodeMirror-cursor {
 border-left: 2px solid #ff711a;
}
.cm-s-ipython span.cm-comment {
 color: #8d8d8d;
 font-style: italic;
}
.cm-s-ipython span.cm-atom {
 color: #055be0;
}
.cm-s-ipython span.cm-number {
 color: #ff8132;
}
.cm-s-ipython span.cm-property {
 color: #e22978;
}
.cm-s-ipython span.cm-attribute {
 color: #de143d;
}
.cm-s-ipython span.cm-keyword {
 color: #713bc5;
 font-weight: normal;
}
.cm-s-ipython span.cm-string {
 color: #009e07;
}
.cm-s-ipython span.cm-meta {
 color: #aa22ff;
}
.cm-s-ipython span.cm-operator {
 color: #055be0;
}
.cm-s-ipython span.cm-builtin {
 color: #e22978;
}
.cm-s-ipython span.cm-variable {
 color: #303030;
}
.cm-s-ipython span.cm-variable-2 {
 color: #de143d;
}
.cm-s-ipython span.cm-variable-3 {
 color: #aa22ff;
}
.cm-s-ipython span.cm-def {
 color: #e22978;
 font-weight: normal;
}
.cm-s-ipython span.cm-error {
 background: rgba(191,97,106,.40);
}
.cm-s-ipython span.cm-tag {
 color: #e22978;
}
.cm-s-ipython span.cm-link {
 color: #ff7823;
}
.cm-s-ipython span.cm-storage {
 color: #055be0;
}
.cm-s-ipython span.cm-entity {
 color: #e22978;
}
.cm-s-ipython span.cm-quote {
 color: #009e07;
}
div.CodeMirror span.CodeMirror-matchingbracket {
 color: #1c1c1c;
 background-color: rgba(30,112,199,.30);
}
div.CodeMirror span.CodeMirror-nonmatchingbracket {
 color: #1c1c1c;
 background: rgba(191,97,106,.40) !important;
}
div.cell.text_cell .cm-s-default .cm-header {
 color: #126dce;
}
div.cell.text_cell .cm-s-default span.cm-variable-2 {
 color: #353535;
}
div.cell.text_cell .cm-s-default span.cm-variable-3 {
 color: #aa22ff;
}
.cm-s-default span.cm-comment {
 color: #8d8d8d;
}
.cm-s-default .cm-tag {
 color: #009fb7;
}
.cm-s-default .cm-builtin {
 color: #e22978;
}
.cm-s-default .cm-string {
 color: #009e07;
}
.cm-s-default .cm-keyword {
 color: #713bc5;
}
.cm-s-default .cm-number {
 color: #ff8132;
}
.cm-s-default .cm-error {
 color: #055be0;
}
.CodeMirror-cursor {
 border-left: 2px solid #ff711a;
 border-right: none;
 width: 0;
}
.cm-s-default div.CodeMirror-selected {
 background: #e0e1e3;
}
.cm-s-default .cm-selected {
 background: #e0e1e3;
}
div#maintoolbar {
 display: none !important;
}
#header-container {
 display: none !important;
}

/**********************************
 MathJax Settings and Style Script
**********************************/
.MathJax_Display,
.MathJax nobr>span.math>span {
    border: 0 !important;
    font-size: 110% !important;
    text-align: center !important;
    margin: 0em !important;
}
/* Prevents MathJax from jittering */
/* cell position when cell is selected */
.MathJax:focus, body :focus .MathJax {
    display: inline-block !important;
}

 </style>

```python
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import rankdata, spearmanr, pearsonr

# 1. magic for inline plot
# 2. magic to print version
# 3. magic so that the notebook will reload external python modules
%matplotlib inline
%load_ext watermark
%load_ext autoreload
%autoreload 2

%watermark -a 'Ethen' -d -t -v -p numpy,matplotlib,jupyterthemes
```

    Ethen 2017-02-05 15:35:19

    CPython 3.5.2
    IPython 4.2.0

    numpy 1.12.0
    matplotlib 2.0.0
    jupyterthemes 0.13.9

# Correlation

A correlation coefficient measures the extent to which two variables tend to change together. The coefficient describes both the strength and the direction of the relationship. The two most popular types of correlation are **Pearson correlation** and **Spearman correlation**.

The Pearson correlation evaluates the linear relationship between two continuous variables. A relationship is linear when a change in one variable is associated with a constant proportional change in the other variable. On the other hand, the Spearman correlation evaluates the monotonic relationship between two continuous or ordinal variables. In a monotonic relationship, the variables tend to change together, but not necessarily at a constant rate. The Spearman correlation coefficient is based on the ranked values for each variable rather than the raw data.

The Pearson and Spearman correlation coefficients can range in value from −1 to +1. For the Pearson correlation coefficient to be +1, when one variable increases then the other variable increases by a consistent amount. This relationship forms a perfect line. The Spearman correlation coefficient is also +1 in this case.

```python
plt.rcParams['figure.figsize'] = 8, 6

# y1 is simply 3 times x, so 1 unit
# increase in x increases y by 3 unit
x = np.arange(1, 101)
y1 = 3 * x
plt.scatter(x, y1)
plt.show()
```

```python
print( 'pearson: ', pearsonr(x, x)[0] )
print( 'spearman: ', spearmanr(x, x)[0] )
```

    pearson:  1.0
    spearman:  1.0

If the relationship is that one variable increases when the other increases, but the amount is not consistent, the Pearson correlation coefficient is positive but less than +1. The Spearman coefficient still equals +1 in this case.

```python
# y2 is the exponential of x,
# thus the despite the fact that
# y2 will increase when x is increased
# by a unit, but the relationship is not a constant
y2 = np.exp(x)
plt.scatter(x, y2)
plt.show()
```

```python
print( 'pearson: ', pearsonr(x, y2)[0] )
print( 'spearman: ', spearmanr(x, y2)[0] )
```

    pearson:  0.252032033904
    spearman:  1.0

The idea can be generalized to negative relationships and when a relationship is random or non-existent, then both correlation coefficients are nearly zero.

It is always a good idea to examine the relationship between variables with a scatterplot. Correlation coefficients only measure linear (Pearson) or monotonic (Spearman) relationships. Other relationships are possible.

```python
# create 1000 equally spaced points between -10 and 10
# calculate the y value for each element of the x vector
x3 = np.linspace(-10, 10, 1000)
y3 = x3 ** 2 + 2 * x3 + np.random.normal(loc = 0, scale = 5)
plt.scatter(x3, y3)
plt.show()
```

```python
print( 'pearson: ', pearsonr(x3, y3)[0] )
print( 'spearman: ', spearmanr(x3, y3)[0] )
```

    pearson:  0.360844075487
    spearman:  0.269785169785

From the plot above, we can see an obvious parabola relationship, thus the Pearson coefficient and Spearman coefficient will not be very helpful in discovering the pattern.

To understand how Spearman coefficient is calculated, we need to know that it is a rank correlation coefficient. Rank correlations are performed on ranks instead of the raw data itself. This can be very advantageous when dealing with data with outliers. For example, given two sets of data, say x = [5.05, 6.75, 3.21, 2.66] and y = [1.65, 26.5, -5.93, 7.96], with some ordering (here numerical) we can give them the ranks [3, 4, 2, 1] and [2, 4, 1, 3] respectively.

Tied ranks are usually assigned using the midrank method, whereby those entries receive the mean of the ranks they would have received had they not been tied. Thus z = [1.65, 2.64, 2.64, 6.95] would yield ranks [1, 2.5, 2.5, 4] using the midrank method.

```python
x = [5.05, 6.75, 3.21, 2.66]
rankdata(x)
```

    array([ 3.,  4.,  2.,  1.])

```python
# the default method is average (tied rank)
z = [1.65, 2.64, 2.64, 6.95]
rankdata(z, method = 'average')
```

    array([ 1. ,  2.5,  2.5,  4. ])

After obtaining the rank of the data, we can then use the following formula to perform the computation.

\begin{align}
\rho &= 1 - \frac{6 \sum_i (d_i)^2 }{ n(n^2 - 1) }
\end{align}

Where $d$ is the difference between the two ranks and $n$ is the number of elements in the vector.

```python
def compute_spearman(a, b):
    """pass in the two vectors a and b"""
    rank1 = rankdata(a)
    rank2 = rankdata(b)
    n = rank1.shape[0]
    spearman = 1 - 6 * np.sum( (rank2 - rank1) ** 2 ) / ( n * (n ** 2 - 1) )
    return spearman
```

```python
compute_spearman(x3, y3)
```

    0.26978516978516975

## Reference

- [Blog: Using Python (and R) to calculate Rank Correlations](http://www2.warwick.ac.uk/fac/sci/moac/people/students/peter_cock/python/rank_correlations/)
- [Blog: Spearman Rank Correlation (Spearman’s Rho): Definition and How to Calculate it](http://www.statisticshowto.com/spearman-rank-correlation-definition-calculate/)
- [StackExchange: How to choose between Pearson and Spearman correlation?](http://stats.stackexchange.com/questions/8071/how-to-choose-between-pearson-and-spearman-correlation)
- [Minitab Support: A comparison of the Pearson and Spearman correlation methods](http://support.minitab.com/en-us/minitab-express/1/help-and-how-to/modeling-statistics/regression/supporting-topics/basics/a-comparison-of-the-pearson-and-spearman-correlation-methods/)