{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2019-01-11T02:05:55.190413Z", "start_time": "2019-01-11T02:05:53.538437Z" } }, "outputs": [ { "data": { "text/html": [ "" ], "text/vnd.plotly.v1+html": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Data science imports\n", "import pandas as pd\n", "import numpy as np\n", "\n", "%load_ext autoreload\n", "%autoreload 2\n", "\n", "import sys\n", "sys.path.append('../..')\n", "\n", "# Options for pandas\n", "pd.options.display.max_columns = 20\n", "\n", "# Display all cell outputs\n", "from IPython.core.interactiveshell import InteractiveShell\n", "InteractiveShell.ast_node_interactivity = 'all'\n", "\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "import cufflinks\n", "cufflinks.go_offline()\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2019-01-11T02:06:39.171678Z", "start_time": "2019-01-11T02:06:39.130622Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
BirdIDKnownSexBillDepthBillWidthBillLengthHeadMassSkullSex
119962-62176M8.709.1224.6256.6177.0031.991
120962-62181M7.969.8025.0755.6868.0030.611
121962-62184F7.909.3023.6053.9063.9030.300
122962-62185F7.638.5624.2954.1970.4529.900
123962-62200F7.908.0023.0052.7066.0029.700
\n", "
" ], "text/plain": [ " BirdID KnownSex BillDepth BillWidth BillLength Head Mass \\\n", "119 962-62176 M 8.70 9.12 24.62 56.61 77.00 \n", "120 962-62181 M 7.96 9.80 25.07 55.68 68.00 \n", "121 962-62184 F 7.90 9.30 23.60 53.90 63.90 \n", "122 962-62185 F 7.63 8.56 24.29 54.19 70.45 \n", "123 962-62200 F 7.90 8.00 23.00 52.70 66.00 \n", "\n", " Skull Sex \n", "119 31.99 1 \n", "120 30.61 1 \n", "121 30.30 0 \n", "122 29.90 0 \n", "123 29.70 0 " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = pd.read_csv('data/blue_jays.csv', index_col=0)\n", "df.tail()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2019-01-11T02:14:34.877822Z", "start_time": "2019-01-11T02:14:34.623196Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "linkText": "Export to plot.ly", "plotlyServerURL": "https://plot.ly", "showLink": true }, "data": [ { "marker": { "color": "rgb(31, 119, 180)", "size": 6 }, "mode": "markers", "name": "F", "showlegend": false, "type": "scatter", "uid": "ed8d619d-9b4a-42cf-a213-b87cc0b4d470", "x": [ 53.77, 52.25, 52.83, 54.94, 54.69, 55.75, 53.05, 54.81, 54.09, 56.82, 55.39, 54.21, 56.37, 53.7, 55.83, 55.47, 54.49, 56.04, 54.13, 56.5, 54.31, 53.04, 55.58, 56.84, 53.74, 55.74, 55.37, 52.8, 54.2, 53.9, 53.9, 54, 55, 54.4, 53.6, 56.2, 56.7, 55.76, 55.7, 52.74, 55.97, 53.88, 54.04, 53.03, 55.65, 54.7, 51.6, 54.69, 54.58, 53.8, 54.15, 56.25, 54.8, 56.09, 55.82, 53.95, 56.28, 53.9, 54.19, 52.7 ], "xaxis": "x", "y": [ 53.77, 52.25, 52.83, 54.94, 54.69, 55.75, 53.05, 54.81, 54.09, 56.82, 55.39, 54.21, 56.37, 53.7, 55.83, 55.47, 54.49, 56.04, 54.13, 56.5, 54.31, 53.04, 55.58, 56.84, 53.74, 55.74, 55.37, 52.8, 54.2, 53.9, 53.9, 54, 55, 54.4, 53.6, 56.2, 56.7, 55.76, 55.7, 52.74, 55.97, 53.88, 54.04, 53.03, 55.65, 54.7, 51.6, 54.69, 54.58, 53.8, 54.15, 56.25, 54.8, 56.09, 55.82, 53.95, 56.28, 53.9, 54.19, 52.7 ], "yaxis": "y" }, { "marker": { "color": "rgb(255, 127, 14)", "size": 6 }, "mode": "markers", "name": "M", "showlegend": false, "type": "scatter", "uid": "5ed41c2c-c0f1-4936-88fb-936ffe769dfe", "x": [ 56.58, 56.36, 57.32, 57.32, 57.12, 60.67, 56.54, 56.48, 57.34, 58.7, 57.07, 55.79, 58.31, 54.51, 58.21, 56.8, 56.88, 55.96, 55.96, 56.59, 57.5, 56.01, 53.74, 56.8, 57.86, 56.82, 56.35, 56.4, 57, 56.86, 57.64, 57.86, 55.02, 57.3, 56.9, 57.3, 56.7, 56.3, 55.5, 56.1, 54.9, 59.2, 56.7, 55.5, 56.6, 57.5, 56.2, 56.48, 56.45, 54.76, 56.44, 58.5, 55.64, 57.56, 56, 55.91, 57.1, 56.85, 56.71, 57.25, 54.58, 56.61, 55.68 ], "xaxis": "x", "y": [ 56.58, 56.36, 57.32, 57.32, 57.12, 60.67, 56.54, 56.48, 57.34, 58.7, 57.07, 55.79, 58.31, 54.51, 58.21, 56.8, 56.88, 55.96, 55.96, 56.59, 57.5, 56.01, 53.74, 56.8, 57.86, 56.82, 56.35, 56.4, 57, 56.86, 57.64, 57.86, 55.02, 57.3, 56.9, 57.3, 56.7, 56.3, 55.5, 56.1, 54.9, 59.2, 56.7, 55.5, 56.6, 57.5, 56.2, 56.48, 56.45, 54.76, 56.44, 58.5, 55.64, 57.56, 56, 55.91, 57.1, 56.85, 56.71, 57.25, 54.58, 56.61, 55.68 ], "yaxis": "y" }, { "marker": { "color": "rgb(31, 119, 180)", "size": 6 }, "mode": "markers", "name": "F", "showlegend": true, "type": "scatter", "uid": "b63d9c4f-14b8-4c42-b0cb-911d9719d22a", "x": [ 65.5, 63.9, 64, 67.33, 71.5, 73.4, 65, 75.2, 75.2, 62.2, 72.3, 74, 73.97, 66.8, 78.3, 70.6, 69.4, 77.6, 70.5, 79.5, 65.3, 65.6, 67.83, 75.7, 58.8, 70.9, 66.3, 63.7, 72.8, 66, 65, 69, 68.5, 70, 69, 67.9, 81.5, 66.1, 69.8, 70, 69.3, 75.5, 73.25, 66.75, 73.2, 72.35, 64, 68.9, 73.8, 61.4, 61.2, 69.65, 77, 72.2, 76.55, 68.25, 78.8, 63.9, 70.45, 66 ], "xaxis": "x2", "y": [ 53.77, 52.25, 52.83, 54.94, 54.69, 55.75, 53.05, 54.81, 54.09, 56.82, 55.39, 54.21, 56.37, 53.7, 55.83, 55.47, 54.49, 56.04, 54.13, 56.5, 54.31, 53.04, 55.58, 56.84, 53.74, 55.74, 55.37, 52.8, 54.2, 53.9, 53.9, 54, 55, 54.4, 53.6, 56.2, 56.7, 55.76, 55.7, 52.74, 55.97, 53.88, 54.04, 53.03, 55.65, 54.7, 51.6, 54.69, 54.58, 53.8, 54.15, 56.25, 54.8, 56.09, 55.82, 53.95, 56.28, 53.9, 54.19, 52.7 ], "yaxis": "y2" }, { "marker": { "color": "rgb(255, 127, 14)", "size": 6 }, "mode": "markers", "name": "M", "showlegend": true, "type": "scatter", "uid": "ba8e45e6-cbf9-40a8-8b34-46cea7a65428", "x": [ 73.3, 75.1, 70.25, 74.9, 75.1, 78.1, 76.4, 78.2, 77, 75.7, 78.4, 70.6, 74.7, 70, 75.4, 74.5, 73.73, 75.18, 72.1, 70.2, 74, 69.67, 60.17, 67.5, 75.95, 77.5, 79.2, 69, 72.6, 73.9, 71.35, 73.9, 67.2, 73, 74, 76.3, 74, 76.3, 71.3, 73.8, 72.1, 80.9, 75.9, 70, 75.8, 69.7, 65.5, 74, 71.5, 68.5, 66.75, 76.5, 67.8, 71.9, 79.55, 73.5, 77.4, 73.4, 71.5, 77.53, 68.95, 77, 68 ], "xaxis": "x2", "y": [ 56.58, 56.36, 57.32, 57.32, 57.12, 60.67, 56.54, 56.48, 57.34, 58.7, 57.07, 55.79, 58.31, 54.51, 58.21, 56.8, 56.88, 55.96, 55.96, 56.59, 57.5, 56.01, 53.74, 56.8, 57.86, 56.82, 56.35, 56.4, 57, 56.86, 57.64, 57.86, 55.02, 57.3, 56.9, 57.3, 56.7, 56.3, 55.5, 56.1, 54.9, 59.2, 56.7, 55.5, 56.6, 57.5, 56.2, 56.48, 56.45, 54.76, 56.44, 58.5, 55.64, 57.56, 56, 55.91, 57.1, 56.85, 56.71, 57.25, 54.58, 56.61, 55.68 ], "yaxis": "y2" }, { "marker": { "color": "rgb(31, 119, 180)", "size": 6 }, "mode": "markers", "name": "F", "showlegend": false, "type": "scatter", "uid": "f874fc56-7e8e-45e9-8249-44d69c91c2b6", "x": [ 30.29, 30, 30.05, 30.33, 30.03, 31.83, 29.9, 29.81, 30.22, 31.42, 32.39, 30.77, 30.24, 30.57, 31.08, 30.55, 31.07, 31.58, 30.82, 30.2, 30.83, 28.97, 30.64, 31.54, 29.85, 32, 29.91, 29.2, 29.2, 30.8, 31.5, 30.6, 29.3, 29.8, 29.9, 31.4, 31.2, 30.71, 29.97, 29.19, 30.26, 30.28, 30.69, 30.15, 31.63, 30.8, 28.82, 30.77, 30.25, 29.2, 29.09, 31.05, 29.64, 31.15, 31.73, 30.27, 32.36, 30.3, 29.9, 29.7 ], "xaxis": "x3", "y": [ 53.77, 52.25, 52.83, 54.94, 54.69, 55.75, 53.05, 54.81, 54.09, 56.82, 55.39, 54.21, 56.37, 53.7, 55.83, 55.47, 54.49, 56.04, 54.13, 56.5, 54.31, 53.04, 55.58, 56.84, 53.74, 55.74, 55.37, 52.8, 54.2, 53.9, 53.9, 54, 55, 54.4, 53.6, 56.2, 56.7, 55.76, 55.7, 52.74, 55.97, 53.88, 54.04, 53.03, 55.65, 54.7, 51.6, 54.69, 54.58, 53.8, 54.15, 56.25, 54.8, 56.09, 55.82, 53.95, 56.28, 53.9, 54.19, 52.7 ], "yaxis": "y3" }, { "marker": { "color": "rgb(255, 127, 14)", "size": 6 }, "mode": "markers", "name": "M", "showlegend": false, "type": "scatter", "uid": "28847218-5225-4f7f-8d97-6ef2b943d218", "x": [ 30.66, 31.38, 31.25, 31.85, 31.77, 30.67, 30.82, 31.98, 31.73, 33.3, 31.15, 31.39, 32, 30.89, 31.55, 31.83, 32.02, 29.77, 31.72, 31.19, 32, 31.46, 29.82, 31.12, 31.31, 31.09, 32.06, 30.7, 30.88, 31.4, 31.06, 31.74, 30.09, 32.26, 31.4, 31.7, 32.3, 32.3, 31.8, 31.1, 30.6, 33.2, 31.2, 30.6, 31.3, 31.6, 28.9, 29.86, 31.67, 30.46, 30.12, 32.23, 29.73, 30.52, 30.12, 31.01, 31.2, 30.8, 30.93, 31.97, 30.36, 31.99, 30.61 ], "xaxis": "x3", "y": [ 56.58, 56.36, 57.32, 57.32, 57.12, 60.67, 56.54, 56.48, 57.34, 58.7, 57.07, 55.79, 58.31, 54.51, 58.21, 56.8, 56.88, 55.96, 55.96, 56.59, 57.5, 56.01, 53.74, 56.8, 57.86, 56.82, 56.35, 56.4, 57, 56.86, 57.64, 57.86, 55.02, 57.3, 56.9, 57.3, 56.7, 56.3, 55.5, 56.1, 54.9, 59.2, 56.7, 55.5, 56.6, 57.5, 56.2, 56.48, 56.45, 54.76, 56.44, 58.5, 55.64, 57.56, 56, 55.91, 57.1, 56.85, 56.71, 57.25, 54.58, 56.61, 55.68 ], "yaxis": "y3" }, { "marker": { "color": "rgb(31, 119, 180)", "size": 6 }, "mode": "markers", "name": "F", "showlegend": false, "type": "scatter", "uid": "4ba5eb88-be04-4583-a4dc-4875c508bf27", "x": [ 53.77, 52.25, 52.83, 54.94, 54.69, 55.75, 53.05, 54.81, 54.09, 56.82, 55.39, 54.21, 56.37, 53.7, 55.83, 55.47, 54.49, 56.04, 54.13, 56.5, 54.31, 53.04, 55.58, 56.84, 53.74, 55.74, 55.37, 52.8, 54.2, 53.9, 53.9, 54, 55, 54.4, 53.6, 56.2, 56.7, 55.76, 55.7, 52.74, 55.97, 53.88, 54.04, 53.03, 55.65, 54.7, 51.6, 54.69, 54.58, 53.8, 54.15, 56.25, 54.8, 56.09, 55.82, 53.95, 56.28, 53.9, 54.19, 52.7 ], "xaxis": "x4", "y": [ 65.5, 63.9, 64, 67.33, 71.5, 73.4, 65, 75.2, 75.2, 62.2, 72.3, 74, 73.97, 66.8, 78.3, 70.6, 69.4, 77.6, 70.5, 79.5, 65.3, 65.6, 67.83, 75.7, 58.8, 70.9, 66.3, 63.7, 72.8, 66, 65, 69, 68.5, 70, 69, 67.9, 81.5, 66.1, 69.8, 70, 69.3, 75.5, 73.25, 66.75, 73.2, 72.35, 64, 68.9, 73.8, 61.4, 61.2, 69.65, 77, 72.2, 76.55, 68.25, 78.8, 63.9, 70.45, 66 ], "yaxis": "y4" }, { "marker": { "color": "rgb(255, 127, 14)", "size": 6 }, "mode": "markers", "name": "M", "showlegend": false, "type": "scatter", "uid": "a645b59d-8061-4b7d-85a4-1729185be722", "x": [ 56.58, 56.36, 57.32, 57.32, 57.12, 60.67, 56.54, 56.48, 57.34, 58.7, 57.07, 55.79, 58.31, 54.51, 58.21, 56.8, 56.88, 55.96, 55.96, 56.59, 57.5, 56.01, 53.74, 56.8, 57.86, 56.82, 56.35, 56.4, 57, 56.86, 57.64, 57.86, 55.02, 57.3, 56.9, 57.3, 56.7, 56.3, 55.5, 56.1, 54.9, 59.2, 56.7, 55.5, 56.6, 57.5, 56.2, 56.48, 56.45, 54.76, 56.44, 58.5, 55.64, 57.56, 56, 55.91, 57.1, 56.85, 56.71, 57.25, 54.58, 56.61, 55.68 ], "xaxis": "x4", "y": [ 73.3, 75.1, 70.25, 74.9, 75.1, 78.1, 76.4, 78.2, 77, 75.7, 78.4, 70.6, 74.7, 70, 75.4, 74.5, 73.73, 75.18, 72.1, 70.2, 74, 69.67, 60.17, 67.5, 75.95, 77.5, 79.2, 69, 72.6, 73.9, 71.35, 73.9, 67.2, 73, 74, 76.3, 74, 76.3, 71.3, 73.8, 72.1, 80.9, 75.9, 70, 75.8, 69.7, 65.5, 74, 71.5, 68.5, 66.75, 76.5, 67.8, 71.9, 79.55, 73.5, 77.4, 73.4, 71.5, 77.53, 68.95, 77, 68 ], "yaxis": "y4" }, { "marker": { "color": "rgb(31, 119, 180)", "size": 6 }, "mode": "markers", "name": "F", "showlegend": false, "type": "scatter", "uid": "4bbb9c2a-cc5a-468d-a1d7-4ed7068f62c9", "x": [ 65.5, 63.9, 64, 67.33, 71.5, 73.4, 65, 75.2, 75.2, 62.2, 72.3, 74, 73.97, 66.8, 78.3, 70.6, 69.4, 77.6, 70.5, 79.5, 65.3, 65.6, 67.83, 75.7, 58.8, 70.9, 66.3, 63.7, 72.8, 66, 65, 69, 68.5, 70, 69, 67.9, 81.5, 66.1, 69.8, 70, 69.3, 75.5, 73.25, 66.75, 73.2, 72.35, 64, 68.9, 73.8, 61.4, 61.2, 69.65, 77, 72.2, 76.55, 68.25, 78.8, 63.9, 70.45, 66 ], "xaxis": "x5", "y": [ 65.5, 63.9, 64, 67.33, 71.5, 73.4, 65, 75.2, 75.2, 62.2, 72.3, 74, 73.97, 66.8, 78.3, 70.6, 69.4, 77.6, 70.5, 79.5, 65.3, 65.6, 67.83, 75.7, 58.8, 70.9, 66.3, 63.7, 72.8, 66, 65, 69, 68.5, 70, 69, 67.9, 81.5, 66.1, 69.8, 70, 69.3, 75.5, 73.25, 66.75, 73.2, 72.35, 64, 68.9, 73.8, 61.4, 61.2, 69.65, 77, 72.2, 76.55, 68.25, 78.8, 63.9, 70.45, 66 ], "yaxis": "y5" }, { "marker": { "color": "rgb(255, 127, 14)", "size": 6 }, "mode": "markers", "name": "M", "showlegend": false, "type": "scatter", "uid": "3598ad82-3555-46fe-bbec-a616f91f7bbd", "x": [ 73.3, 75.1, 70.25, 74.9, 75.1, 78.1, 76.4, 78.2, 77, 75.7, 78.4, 70.6, 74.7, 70, 75.4, 74.5, 73.73, 75.18, 72.1, 70.2, 74, 69.67, 60.17, 67.5, 75.95, 77.5, 79.2, 69, 72.6, 73.9, 71.35, 73.9, 67.2, 73, 74, 76.3, 74, 76.3, 71.3, 73.8, 72.1, 80.9, 75.9, 70, 75.8, 69.7, 65.5, 74, 71.5, 68.5, 66.75, 76.5, 67.8, 71.9, 79.55, 73.5, 77.4, 73.4, 71.5, 77.53, 68.95, 77, 68 ], "xaxis": "x5", "y": [ 73.3, 75.1, 70.25, 74.9, 75.1, 78.1, 76.4, 78.2, 77, 75.7, 78.4, 70.6, 74.7, 70, 75.4, 74.5, 73.73, 75.18, 72.1, 70.2, 74, 69.67, 60.17, 67.5, 75.95, 77.5, 79.2, 69, 72.6, 73.9, 71.35, 73.9, 67.2, 73, 74, 76.3, 74, 76.3, 71.3, 73.8, 72.1, 80.9, 75.9, 70, 75.8, 69.7, 65.5, 74, 71.5, 68.5, 66.75, 76.5, 67.8, 71.9, 79.55, 73.5, 77.4, 73.4, 71.5, 77.53, 68.95, 77, 68 ], "yaxis": "y5" }, { "marker": { "color": "rgb(31, 119, 180)", "size": 6 }, "mode": "markers", "name": "F", "showlegend": false, "type": "scatter", "uid": "9fffc96f-b71d-4baf-9694-c0977ee7479a", "x": [ 30.29, 30, 30.05, 30.33, 30.03, 31.83, 29.9, 29.81, 30.22, 31.42, 32.39, 30.77, 30.24, 30.57, 31.08, 30.55, 31.07, 31.58, 30.82, 30.2, 30.83, 28.97, 30.64, 31.54, 29.85, 32, 29.91, 29.2, 29.2, 30.8, 31.5, 30.6, 29.3, 29.8, 29.9, 31.4, 31.2, 30.71, 29.97, 29.19, 30.26, 30.28, 30.69, 30.15, 31.63, 30.8, 28.82, 30.77, 30.25, 29.2, 29.09, 31.05, 29.64, 31.15, 31.73, 30.27, 32.36, 30.3, 29.9, 29.7 ], "xaxis": "x6", "y": [ 65.5, 63.9, 64, 67.33, 71.5, 73.4, 65, 75.2, 75.2, 62.2, 72.3, 74, 73.97, 66.8, 78.3, 70.6, 69.4, 77.6, 70.5, 79.5, 65.3, 65.6, 67.83, 75.7, 58.8, 70.9, 66.3, 63.7, 72.8, 66, 65, 69, 68.5, 70, 69, 67.9, 81.5, 66.1, 69.8, 70, 69.3, 75.5, 73.25, 66.75, 73.2, 72.35, 64, 68.9, 73.8, 61.4, 61.2, 69.65, 77, 72.2, 76.55, 68.25, 78.8, 63.9, 70.45, 66 ], "yaxis": "y6" }, { "marker": { "color": "rgb(255, 127, 14)", "size": 6 }, "mode": "markers", "name": "M", "showlegend": false, "type": "scatter", "uid": "1594c7f0-065f-4e7d-9dfc-3dd66a9fb3af", "x": [ 30.66, 31.38, 31.25, 31.85, 31.77, 30.67, 30.82, 31.98, 31.73, 33.3, 31.15, 31.39, 32, 30.89, 31.55, 31.83, 32.02, 29.77, 31.72, 31.19, 32, 31.46, 29.82, 31.12, 31.31, 31.09, 32.06, 30.7, 30.88, 31.4, 31.06, 31.74, 30.09, 32.26, 31.4, 31.7, 32.3, 32.3, 31.8, 31.1, 30.6, 33.2, 31.2, 30.6, 31.3, 31.6, 28.9, 29.86, 31.67, 30.46, 30.12, 32.23, 29.73, 30.52, 30.12, 31.01, 31.2, 30.8, 30.93, 31.97, 30.36, 31.99, 30.61 ], "xaxis": "x6", "y": [ 73.3, 75.1, 70.25, 74.9, 75.1, 78.1, 76.4, 78.2, 77, 75.7, 78.4, 70.6, 74.7, 70, 75.4, 74.5, 73.73, 75.18, 72.1, 70.2, 74, 69.67, 60.17, 67.5, 75.95, 77.5, 79.2, 69, 72.6, 73.9, 71.35, 73.9, 67.2, 73, 74, 76.3, 74, 76.3, 71.3, 73.8, 72.1, 80.9, 75.9, 70, 75.8, 69.7, 65.5, 74, 71.5, 68.5, 66.75, 76.5, 67.8, 71.9, 79.55, 73.5, 77.4, 73.4, 71.5, 77.53, 68.95, 77, 68 ], "yaxis": "y6" }, { "marker": { "color": "rgb(31, 119, 180)", "size": 6 }, "mode": "markers", "name": "F", "showlegend": false, "type": "scatter", "uid": "8186162f-170b-4ccd-a3ca-f5e271a43fe7", "x": [ 53.77, 52.25, 52.83, 54.94, 54.69, 55.75, 53.05, 54.81, 54.09, 56.82, 55.39, 54.21, 56.37, 53.7, 55.83, 55.47, 54.49, 56.04, 54.13, 56.5, 54.31, 53.04, 55.58, 56.84, 53.74, 55.74, 55.37, 52.8, 54.2, 53.9, 53.9, 54, 55, 54.4, 53.6, 56.2, 56.7, 55.76, 55.7, 52.74, 55.97, 53.88, 54.04, 53.03, 55.65, 54.7, 51.6, 54.69, 54.58, 53.8, 54.15, 56.25, 54.8, 56.09, 55.82, 53.95, 56.28, 53.9, 54.19, 52.7 ], "xaxis": "x7", "y": [ 30.29, 30, 30.05, 30.33, 30.03, 31.83, 29.9, 29.81, 30.22, 31.42, 32.39, 30.77, 30.24, 30.57, 31.08, 30.55, 31.07, 31.58, 30.82, 30.2, 30.83, 28.97, 30.64, 31.54, 29.85, 32, 29.91, 29.2, 29.2, 30.8, 31.5, 30.6, 29.3, 29.8, 29.9, 31.4, 31.2, 30.71, 29.97, 29.19, 30.26, 30.28, 30.69, 30.15, 31.63, 30.8, 28.82, 30.77, 30.25, 29.2, 29.09, 31.05, 29.64, 31.15, 31.73, 30.27, 32.36, 30.3, 29.9, 29.7 ], "yaxis": "y7" }, { "marker": { "color": "rgb(255, 127, 14)", "size": 6 }, "mode": "markers", "name": "M", "showlegend": false, "type": "scatter", "uid": "c4b2acf4-2f06-4f0b-81be-6f1dc095ad11", "x": [ 56.58, 56.36, 57.32, 57.32, 57.12, 60.67, 56.54, 56.48, 57.34, 58.7, 57.07, 55.79, 58.31, 54.51, 58.21, 56.8, 56.88, 55.96, 55.96, 56.59, 57.5, 56.01, 53.74, 56.8, 57.86, 56.82, 56.35, 56.4, 57, 56.86, 57.64, 57.86, 55.02, 57.3, 56.9, 57.3, 56.7, 56.3, 55.5, 56.1, 54.9, 59.2, 56.7, 55.5, 56.6, 57.5, 56.2, 56.48, 56.45, 54.76, 56.44, 58.5, 55.64, 57.56, 56, 55.91, 57.1, 56.85, 56.71, 57.25, 54.58, 56.61, 55.68 ], "xaxis": "x7", "y": [ 30.66, 31.38, 31.25, 31.85, 31.77, 30.67, 30.82, 31.98, 31.73, 33.3, 31.15, 31.39, 32, 30.89, 31.55, 31.83, 32.02, 29.77, 31.72, 31.19, 32, 31.46, 29.82, 31.12, 31.31, 31.09, 32.06, 30.7, 30.88, 31.4, 31.06, 31.74, 30.09, 32.26, 31.4, 31.7, 32.3, 32.3, 31.8, 31.1, 30.6, 33.2, 31.2, 30.6, 31.3, 31.6, 28.9, 29.86, 31.67, 30.46, 30.12, 32.23, 29.73, 30.52, 30.12, 31.01, 31.2, 30.8, 30.93, 31.97, 30.36, 31.99, 30.61 ], "yaxis": "y7" }, { "marker": { "color": "rgb(31, 119, 180)", "size": 6 }, "mode": "markers", "name": "F", "showlegend": false, "type": "scatter", "uid": "0933a0b7-3b34-4ebe-84a7-d0fcdf58d785", "x": [ 65.5, 63.9, 64, 67.33, 71.5, 73.4, 65, 75.2, 75.2, 62.2, 72.3, 74, 73.97, 66.8, 78.3, 70.6, 69.4, 77.6, 70.5, 79.5, 65.3, 65.6, 67.83, 75.7, 58.8, 70.9, 66.3, 63.7, 72.8, 66, 65, 69, 68.5, 70, 69, 67.9, 81.5, 66.1, 69.8, 70, 69.3, 75.5, 73.25, 66.75, 73.2, 72.35, 64, 68.9, 73.8, 61.4, 61.2, 69.65, 77, 72.2, 76.55, 68.25, 78.8, 63.9, 70.45, 66 ], "xaxis": "x8", "y": [ 30.29, 30, 30.05, 30.33, 30.03, 31.83, 29.9, 29.81, 30.22, 31.42, 32.39, 30.77, 30.24, 30.57, 31.08, 30.55, 31.07, 31.58, 30.82, 30.2, 30.83, 28.97, 30.64, 31.54, 29.85, 32, 29.91, 29.2, 29.2, 30.8, 31.5, 30.6, 29.3, 29.8, 29.9, 31.4, 31.2, 30.71, 29.97, 29.19, 30.26, 30.28, 30.69, 30.15, 31.63, 30.8, 28.82, 30.77, 30.25, 29.2, 29.09, 31.05, 29.64, 31.15, 31.73, 30.27, 32.36, 30.3, 29.9, 29.7 ], "yaxis": "y8" }, { "marker": { "color": "rgb(255, 127, 14)", "size": 6 }, "mode": "markers", "name": "M", "showlegend": false, "type": "scatter", "uid": "f6e9ce04-bdce-46ea-bd1c-a7bc6781d148", "x": [ 73.3, 75.1, 70.25, 74.9, 75.1, 78.1, 76.4, 78.2, 77, 75.7, 78.4, 70.6, 74.7, 70, 75.4, 74.5, 73.73, 75.18, 72.1, 70.2, 74, 69.67, 60.17, 67.5, 75.95, 77.5, 79.2, 69, 72.6, 73.9, 71.35, 73.9, 67.2, 73, 74, 76.3, 74, 76.3, 71.3, 73.8, 72.1, 80.9, 75.9, 70, 75.8, 69.7, 65.5, 74, 71.5, 68.5, 66.75, 76.5, 67.8, 71.9, 79.55, 73.5, 77.4, 73.4, 71.5, 77.53, 68.95, 77, 68 ], "xaxis": "x8", "y": [ 30.66, 31.38, 31.25, 31.85, 31.77, 30.67, 30.82, 31.98, 31.73, 33.3, 31.15, 31.39, 32, 30.89, 31.55, 31.83, 32.02, 29.77, 31.72, 31.19, 32, 31.46, 29.82, 31.12, 31.31, 31.09, 32.06, 30.7, 30.88, 31.4, 31.06, 31.74, 30.09, 32.26, 31.4, 31.7, 32.3, 32.3, 31.8, 31.1, 30.6, 33.2, 31.2, 30.6, 31.3, 31.6, 28.9, 29.86, 31.67, 30.46, 30.12, 32.23, 29.73, 30.52, 30.12, 31.01, 31.2, 30.8, 30.93, 31.97, 30.36, 31.99, 30.61 ], "yaxis": "y8" }, { "marker": { "color": "rgb(31, 119, 180)", "size": 6 }, "mode": "markers", "name": "F", "showlegend": false, "type": "scatter", "uid": "b63dece2-4f4e-4918-b39e-30b48a1000cc", "x": [ 30.29, 30, 30.05, 30.33, 30.03, 31.83, 29.9, 29.81, 30.22, 31.42, 32.39, 30.77, 30.24, 30.57, 31.08, 30.55, 31.07, 31.58, 30.82, 30.2, 30.83, 28.97, 30.64, 31.54, 29.85, 32, 29.91, 29.2, 29.2, 30.8, 31.5, 30.6, 29.3, 29.8, 29.9, 31.4, 31.2, 30.71, 29.97, 29.19, 30.26, 30.28, 30.69, 30.15, 31.63, 30.8, 28.82, 30.77, 30.25, 29.2, 29.09, 31.05, 29.64, 31.15, 31.73, 30.27, 32.36, 30.3, 29.9, 29.7 ], "xaxis": "x9", "y": [ 30.29, 30, 30.05, 30.33, 30.03, 31.83, 29.9, 29.81, 30.22, 31.42, 32.39, 30.77, 30.24, 30.57, 31.08, 30.55, 31.07, 31.58, 30.82, 30.2, 30.83, 28.97, 30.64, 31.54, 29.85, 32, 29.91, 29.2, 29.2, 30.8, 31.5, 30.6, 29.3, 29.8, 29.9, 31.4, 31.2, 30.71, 29.97, 29.19, 30.26, 30.28, 30.69, 30.15, 31.63, 30.8, 28.82, 30.77, 30.25, 29.2, 29.09, 31.05, 29.64, 31.15, 31.73, 30.27, 32.36, 30.3, 29.9, 29.7 ], "yaxis": "y9" }, { "marker": { "color": "rgb(255, 127, 14)", "size": 6 }, "mode": "markers", "name": "M", "showlegend": false, "type": "scatter", "uid": "0f4b2d05-ed41-479a-95d1-a3c344447d4f", "x": [ 30.66, 31.38, 31.25, 31.85, 31.77, 30.67, 30.82, 31.98, 31.73, 33.3, 31.15, 31.39, 32, 30.89, 31.55, 31.83, 32.02, 29.77, 31.72, 31.19, 32, 31.46, 29.82, 31.12, 31.31, 31.09, 32.06, 30.7, 30.88, 31.4, 31.06, 31.74, 30.09, 32.26, 31.4, 31.7, 32.3, 32.3, 31.8, 31.1, 30.6, 33.2, 31.2, 30.6, 31.3, 31.6, 28.9, 29.86, 31.67, 30.46, 30.12, 32.23, 29.73, 30.52, 30.12, 31.01, 31.2, 30.8, 30.93, 31.97, 30.36, 31.99, 30.61 ], "xaxis": "x9", "y": [ 30.66, 31.38, 31.25, 31.85, 31.77, 30.67, 30.82, 31.98, 31.73, 33.3, 31.15, 31.39, 32, 30.89, 31.55, 31.83, 32.02, 29.77, 31.72, 31.19, 32, 31.46, 29.82, 31.12, 31.31, 31.09, 32.06, 30.7, 30.88, 31.4, 31.06, 31.74, 30.09, 32.26, 31.4, 31.7, 32.3, 32.3, 31.8, 31.1, 30.6, 33.2, 31.2, 30.6, 31.3, 31.6, 28.9, 29.86, 31.67, 30.46, 30.12, 32.23, 29.73, 30.52, 30.12, 31.01, 31.2, 30.8, 30.93, 31.97, 30.36, 31.99, 30.61 ], "yaxis": "y9" } ], "layout": { "height": 800, "showlegend": true, "title": "Scatterplot Matrix", "width": 800, "xaxis": { "anchor": "y", "domain": [ 0, 0.2888888888888889 ] }, "xaxis2": { "anchor": "y2", "domain": [ 0.35555555555555557, 0.6444444444444445 ] }, "xaxis3": { "anchor": "y3", "domain": [ 0.7111111111111111, 1 ] }, "xaxis4": { "anchor": "y4", "domain": [ 0, 0.2888888888888889 ] }, "xaxis5": { "anchor": "y5", "domain": [ 0.35555555555555557, 0.6444444444444445 ] }, "xaxis6": { "anchor": "y6", "domain": [ 0.7111111111111111, 1 ] }, "xaxis7": { "anchor": "y7", "domain": [ 0, 0.2888888888888889 ], "title": "Head" }, "xaxis8": { "anchor": "y8", "domain": [ 0.35555555555555557, 0.6444444444444445 ], "title": "Mass" }, "xaxis9": { "anchor": "y9", "domain": [ 0.7111111111111111, 1 ], "title": "Skull" }, "yaxis": { "anchor": "x", "domain": [ 0.7333333333333333, 1 ], "title": "Head" }, "yaxis2": { "anchor": "x2", "domain": [ 0.7333333333333333, 1 ] }, "yaxis3": { "anchor": "x3", "domain": [ 0.7333333333333333, 1 ] }, "yaxis4": { "anchor": "x4", "domain": [ 0.36666666666666664, 0.6333333333333333 ], "title": "Mass" }, "yaxis5": { "anchor": "x5", "domain": [ 0.36666666666666664, 0.6333333333333333 ] }, "yaxis6": { "anchor": "x6", "domain": [ 0.36666666666666664, 0.6333333333333333 ] }, "yaxis7": { "anchor": "x7", "domain": [ 0, 0.26666666666666666 ], "title": "Skull" }, "yaxis8": { "anchor": "x8", "domain": [ 0, 0.26666666666666666 ] }, "yaxis9": { "anchor": "x9", "domain": [ 0, 0.26666666666666666 ] } } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from plotly.offline import iplot\n", "import plotly.figure_factory as ff\n", "\n", "figure = ff.create_scatterplotmatrix(df[['KnownSex', 'Head', 'Mass', 'Skull']], \n", " index='KnownSex', height=800, width=800)\n", "iplot(figure)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "ExecuteTime": { "end_time": "2019-01-11T14:14:49.646877Z", "start_time": "2019-01-11T14:14:49.502483Z" } }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "linkText": "Export to plot.ly", "plotlyServerURL": "https://plot.ly", "showLink": true }, "data": [ { "colorscale": "RdBu", "reversescale": false, "showscale": true, "type": "heatmap", "uid": "36c8d682-1319-400e-b871-28ecaeac1555", "x": [ "BillDepth", "BillWidth", "BillLength", "Head", "Mass", "Skull", "Sex" ], "y": [ "BillDepth", "BillWidth", "BillLength", "Head", "Mass", "Skull", "Sex" ], "z": [ [ 1, 0.27, 0.55, 0.56, 0.47, 0.25, 0.56 ], [ 0.27, 1, 0.3, 0.36, 0.29, 0.24, 0.18 ], [ 0.55, 0.3, 1, 0.81, 0.41, 0.11, 0.55 ], [ 0.56, 0.36, 0.81, 1, 0.63, 0.67, 0.65 ], [ 0.47, 0.29, 0.41, 0.63, 1, 0.55, 0.36 ], [ 0.25, 0.24, 0.11, 0.67, 0.55, 1, 0.42 ], [ 0.56, 0.18, 0.55, 0.65, 0.36, 0.42, 1 ] ] } ], "layout": { "annotations": [ { "font": { "color": "#000000" }, "showarrow": false, "text": "1.0", "x": "BillDepth", "xref": "x", "y": "BillDepth", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.27", "x": "BillWidth", "xref": "x", "y": "BillDepth", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.55", "x": "BillLength", "xref": "x", "y": "BillDepth", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.56", "x": "Head", "xref": "x", "y": "BillDepth", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.47", "x": "Mass", "xref": "x", "y": "BillDepth", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.25", "x": "Skull", "xref": "x", "y": "BillDepth", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.56", "x": "Sex", "xref": "x", "y": "BillDepth", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.27", "x": "BillDepth", "xref": "x", "y": "BillWidth", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "1.0", "x": "BillWidth", "xref": "x", "y": "BillWidth", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.3", "x": "BillLength", "xref": "x", "y": "BillWidth", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.36", "x": "Head", "xref": "x", "y": "BillWidth", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.29", "x": "Mass", "xref": "x", "y": "BillWidth", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.24", "x": "Skull", "xref": "x", "y": "BillWidth", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.18", "x": "Sex", "xref": "x", "y": "BillWidth", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.55", "x": "BillDepth", "xref": "x", "y": "BillLength", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.3", "x": "BillWidth", "xref": "x", "y": "BillLength", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "1.0", "x": "BillLength", "xref": "x", "y": "BillLength", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.81", "x": "Head", "xref": "x", "y": "BillLength", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.41", "x": "Mass", "xref": "x", "y": "BillLength", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.11", "x": "Skull", "xref": "x", "y": "BillLength", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.55", "x": "Sex", "xref": "x", "y": "BillLength", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.56", "x": "BillDepth", "xref": "x", "y": "Head", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.36", "x": "BillWidth", "xref": "x", "y": "Head", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.81", "x": "BillLength", "xref": "x", "y": "Head", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "1.0", "x": "Head", "xref": "x", "y": "Head", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.63", "x": "Mass", "xref": "x", "y": "Head", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.67", "x": "Skull", "xref": "x", "y": "Head", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.65", "x": "Sex", "xref": "x", "y": "Head", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.47", "x": "BillDepth", "xref": "x", "y": "Mass", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.29", "x": "BillWidth", "xref": "x", "y": "Mass", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.41", "x": "BillLength", "xref": "x", "y": "Mass", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.63", "x": "Head", "xref": "x", "y": "Mass", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "1.0", "x": "Mass", "xref": "x", "y": "Mass", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.55", "x": "Skull", "xref": "x", "y": "Mass", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.36", "x": "Sex", "xref": "x", "y": "Mass", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.25", "x": "BillDepth", "xref": "x", "y": "Skull", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.24", "x": "BillWidth", "xref": "x", "y": "Skull", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.11", "x": "BillLength", "xref": "x", "y": "Skull", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.67", "x": "Head", "xref": "x", "y": "Skull", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.55", "x": "Mass", "xref": "x", "y": "Skull", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "1.0", "x": "Skull", "xref": "x", "y": "Skull", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.42", "x": "Sex", "xref": "x", "y": "Skull", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.56", "x": "BillDepth", "xref": "x", "y": "Sex", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.18", "x": "BillWidth", "xref": "x", "y": "Sex", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.55", "x": "BillLength", "xref": "x", "y": "Sex", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "0.65", "x": "Head", "xref": "x", "y": "Sex", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.36", "x": "Mass", "xref": "x", "y": "Sex", "yref": "y" }, { "font": { "color": "#FFFFFF" }, "showarrow": false, "text": "0.42", "x": "Skull", "xref": "x", "y": "Sex", "yref": "y" }, { "font": { "color": "#000000" }, "showarrow": false, "text": "1.0", "x": "Sex", "xref": "x", "y": "Sex", "yref": "y" } ], "xaxis": { "dtick": 1, "gridcolor": "rgb(0, 0, 0)", "side": "top", "ticks": "" }, "yaxis": { "dtick": 1, "ticks": "", "ticksuffix": " " } } }, "text/html": [ "
" ], "text/vnd.plotly.v1+html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "corrs = df.corr()\n", "\n", "figure = ff.create_annotated_heatmap(z=corrs.round(2).values, x = list(corrs.columns), y = list(corrs.index), showscale=True)\n", "iplot(figure)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "ExecuteTime": { "end_time": "2019-01-11T02:19:21.612242Z", "start_time": "2019-01-11T02:19:21.377117Z" } }, "outputs": [ { "ename": "TypeError", "evalue": "can't multiply sequence by non-int of type 'float'", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m figure = ff.create_scatterplotmatrix(df[['KnownSex', 'Head', 'Mass', 'Skull']], \n\u001b[1;32m 2\u001b[0m \u001b[0mindex\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'KnownSex'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mheight\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m800\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mwidth\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m800\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcolormap\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m'M'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'blue'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'F'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;34m'orange'\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 3\u001b[0;31m diag='histogram', title='Blue Jays Scatterplot Matrix')\n\u001b[0m\u001b[1;32m 4\u001b[0m \u001b[0miplot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfigure\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.6/site-packages/plotly/figure_factory/_scatterplot.py\u001b[0m in \u001b[0;36mcreate_scatterplotmatrix\u001b[0;34m(df, index, endpts, diag, height, width, size, title, colormap, colormap_type, dataframe, headers, index_vals, **kwargs)\u001b[0m\n\u001b[1;32m 1080\u001b[0m \u001b[0;31m# Validate colormap\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1081\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcolormap\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdict\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1082\u001b[0;31m \u001b[0mcolormap\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mutils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalidate_colors_dict\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcolormap\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'rgb'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1083\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1084\u001b[0m \u001b[0mcolormap\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mutils\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvalidate_colors\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcolormap\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'rgb'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.6/site-packages/plotly/figure_factory/utils.py\u001b[0m in \u001b[0;36mvalidate_colors_dict\u001b[0;34m(colors, colortype)\u001b[0m\n\u001b[1;32m 382\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mcolortype\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'rgb'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 383\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcolors\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 384\u001b[0;31m \u001b[0mcolors\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcolor_parser\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcolors\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mconvert_to_RGB_255\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 385\u001b[0m \u001b[0mcolors\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcolor_parser\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcolors\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlabel_rgb\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 386\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.6/site-packages/plotly/figure_factory/utils.py\u001b[0m in \u001b[0;36mcolor_parser\u001b[0;34m(colors, function)\u001b[0m\n\u001b[1;32m 277\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mnumbers\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mNumber\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 278\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcolors\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 279\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfunction\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcolors\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 280\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 281\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcolors\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtuple\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcolors\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNumber\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", "\u001b[0;32m/usr/local/lib/python3.6/site-packages/plotly/figure_factory/utils.py\u001b[0m in \u001b[0;36mconvert_to_RGB_255\u001b[0;34m(colors)\u001b[0m\n\u001b[1;32m 239\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 240\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mcomponent\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcolors\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 241\u001b[0;31m rounded_num = decimal.Decimal(str(component*255.0)).quantize(\n\u001b[0m\u001b[1;32m 242\u001b[0m \u001b[0mdecimal\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mDecimal\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'1'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrounding\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdecimal\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mROUND_HALF_EVEN\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 243\u001b[0m )\n", "\u001b[0;31mTypeError\u001b[0m: can't multiply sequence by non-int of type 'float'" ] } ], "source": [ "figure = ff.create_scatterplotmatrix(df[['KnownSex', 'Head', 'Mass', 'Skull']], \n", " index='KnownSex', height=800, width=800,\n", " diag='histogram', title='Blue Jays Scatterplot Matrix')\n", "iplot(figure)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "hide_input": false, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.5" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }