From 6d6840352ad6a349094fadcd068c2957241b4ca4 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:48:40 +0000 Subject: [PATCH 01/35] Automatically backed up by Learn --- index.ipynb | 308 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 307 insertions(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index cd283629c8d..76371cc1950 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1 +1,307 @@ -{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["# Python For loops Lab"]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Learning Objectives"]}, {"cell_type": "markdown", "metadata": {}, "source": ["* Understand how for loops can help us reduce repetition\n", "* Understand the syntax of for loops "]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Picking up where we last left off"]}, {"cell_type": "markdown", "metadata": {}, "source": ["In the last lesson, we worked with some of our travel data. Let's retrieve a list with our travel information again from excel. First, we read the information from excel as a list of dictionaries, with each dictionary representing a location. And we assign this list to the variable `cities`."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["import pandas\n", "file_name = './cities.xlsx'\n", "travel_df = pandas.read_excel(file_name)\n", "cities = travel_df.to_dict('records')"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Next, we retrieve the first three city names, stored as the `'City'` attribute of each dictionary, and `'Population'` of each of the cities. Then we plot the names as our `x_values` and the populations as our `y_values`."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["import plotly\n", "\n", "plotly.offline.init_notebook_mode(connected=True)\n", "\n", "x_values = [cities[0]['City'], cities[1]['City'], cities[2]['City']]\n", "y_values = [cities[0]['Population'], cities[1]['Population'], cities[2]['Population']]\n", "trace_first_three_pops = {'x': x_values, 'y': y_values, 'type': 'bar'}\n", "plotly.offline.iplot([trace_first_three_pops])"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Of course, as you may have spotted, there is a good amount of repetition in displaying this data. Just take a look at how we retrieved the data for our `x_values` and `y_values`. "]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["x_values = [cities[0]['City'], cities[1]['City'], cities[2]['City']]\n", "y_values = [cities[0]['Population'], cities[1]['Population'], cities[2]['Population']]"]}, {"cell_type": "markdown", "metadata": {}, "source": ["So in this lesson, we will use our `for` loop to display information about our travel locations with less repetition."]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Working with the For Loop"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Our `cities` list contains information about the top 12 cities by population. For our upcoming iteration tasks, it will be useful to have a list of the numbers 0 through 11. Use what we know about `len` and `range`to generate a list of numbers 0 through 11. Assign this to a variable called `city_indices`."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["city_indices = None\n", "city_indices # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Now we want to create labels for each of the cities. We'll provide a list of the `city_names` for you. "]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["city_names = ['Buenos Aires',\n", " 'Toronto',\n", " 'Marakesh',\n", " 'Albuquerque',\n", " 'Los Cabos',\n", " 'Greenville',\n", " 'Archipelago Sea',\n", " 'Pyeongchang',\n", " 'Walla Walla Valley',\n", " 'Salina Island',\n", " 'Solta',\n", " 'Iguazu Falls']"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Your task is to assign the variable `names_and_ranks` to a list, with each element equal to the city name and it's corresponding rank. For example, the first element would be, `\"1. Buenos Aires\"` and the second would be `\"2. Toronto\"`. Use a `for` loop and the lists `city_indices` and `city_names` to accomplish this. We'll need to perform some nifty string interpolation to format our strings properly. Check out [f-string interpolation](https://www.programiz.com/python-programming/string-interpolation#f) to see how we can pass values into a string. Remember that list indices start at zero, but we want our `names_and_ranks` list to start at one!"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["names_and_ranks = [] \n", "# write a for loop that adds the properly formatted string to the names_and_ranks list"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["names_and_ranks[0] # '1. Buenos Aires'\n", "names_and_ranks[1] # '2. Toronto'\n", "names_and_ranks[-1] # '12. Iguazu Falls'"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Ok, now let's create a new variable called `city_populations`. Use a `for` loop to iterate through `cities` and have `city_populations` equal to each of the populations."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["city_populations = []"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["city_populations[0] # 2891\n", "city_populations[1] # 2732\n", "city_populations[-1] # 0"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Great! Now we can begin to plot this data. First, let's create a trace of our populations and set it to the variable `trace_populations`."]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["trace_populations = {'x': names_and_ranks, \n", " 'y': city_populations, \n", " 'text': names_and_ranks, \n", " 'type': 'bar', \n", " 'name': 'populations'}"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["import plotly\n", "plotly.offline.init_notebook_mode(connected=True)\n", "plotly.offline.iplot([trace_populations])"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Now we want declare a variable called `city_areas` that points to a list of all of the areas of the cities. Let's use a `for` loop to iterate through our `cities` and have `city_areas` equal to each area of the city. "]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["city_areas = []"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["trace_areas = {'x': names_and_ranks, 'y': city_areas, 'text': names_and_ranks, 'type': 'bar', 'name': 'areas'}"]}, {"cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": ["import plotly\n", "plotly.offline.init_notebook_mode(connected=True)\n", "plotly.offline.iplot([trace_populations, trace_areas])"]}, {"cell_type": "markdown", "metadata": {}, "source": ["### Summary"]}, {"cell_type": "markdown", "metadata": {}, "source": ["In this section we saw how we can use `for` loops to go through elements of a list and perform the same operation on each. By using `for` loops we were able to reduce the amount of code that we wrote and while also writing more expressive code."]}], "metadata": {"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.6"}}, "nbformat": 4, "nbformat_minor": 2} \ No newline at end of file +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Python For loops Lab" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Learning Objectives" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "* Understand how for loops can help us reduce repetition\n", + "* Understand the syntax of for loops " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Picking up where we last left off" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the last lesson, we worked with some of our travel data. Let's retrieve a list with our travel information again from excel. First, we read the information from excel as a list of dictionaries, with each dictionary representing a location. And we assign this list to the variable `cities`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas\n", + "file_name = './cities.xlsx'\n", + "travel_df = pandas.read_excel(file_name)\n", + "cities = travel_df.to_dict('records')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Next, we retrieve the first three city names, stored as the `'City'` attribute of each dictionary, and `'Population'` of each of the cities. Then we plot the names as our `x_values` and the populations as our `y_values`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import plotly\n", + "\n", + "plotly.offline.init_notebook_mode(connected=True)\n", + "\n", + "x_values = [cities[0]['City'], cities[1]['City'], cities[2]['City']]\n", + "y_values = [cities[0]['Population'], cities[1]['Population'], cities[2]['Population']]\n", + "trace_first_three_pops = {'x': x_values, 'y': y_values, 'type': 'bar'}\n", + "plotly.offline.iplot([trace_first_three_pops])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Of course, as you may have spotted, there is a good amount of repetition in displaying this data. Just take a look at how we retrieved the data for our `x_values` and `y_values`. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "x_values = [cities[0]['City'], cities[1]['City'], cities[2]['City']]\n", + "y_values = [cities[0]['Population'], cities[1]['Population'], cities[2]['Population']]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "So in this lesson, we will use our `for` loop to display information about our travel locations with less repetition." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Working with the For Loop" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Our `cities` list contains information about the top 12 cities by population. For our upcoming iteration tasks, it will be useful to have a list of the numbers 0 through 11. Use what we know about `len` and `range`to generate a list of numbers 0 through 11. Assign this to a variable called `city_indices`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "city_indices = None\n", + "city_indices # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we want to create labels for each of the cities. We'll provide a list of the `city_names` for you. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "city_names = ['Buenos Aires',\n", + " 'Toronto',\n", + " 'Marakesh',\n", + " 'Albuquerque',\n", + " 'Los Cabos',\n", + " 'Greenville',\n", + " 'Archipelago Sea',\n", + " 'Pyeongchang',\n", + " 'Walla Walla Valley',\n", + " 'Salina Island',\n", + " 'Solta',\n", + " 'Iguazu Falls']" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Your task is to assign the variable `names_and_ranks` to a list, with each element equal to the city name and it's corresponding rank. For example, the first element would be, `\"1. Buenos Aires\"` and the second would be `\"2. Toronto\"`. Use a `for` loop and the lists `city_indices` and `city_names` to accomplish this. We'll need to perform some nifty string interpolation to format our strings properly. Check out [f-string interpolation](https://www.programiz.com/python-programming/string-interpolation#f) to see how we can pass values into a string. Remember that list indices start at zero, but we want our `names_and_ranks` list to start at one!" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "names_and_ranks = [] \n", + "# write a for loop that adds the properly formatted string to the names_and_ranks list" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "names_and_ranks[0] # '1. Buenos Aires'\n", + "names_and_ranks[1] # '2. Toronto'\n", + "names_and_ranks[-1] # '12. Iguazu Falls'" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Ok, now let's create a new variable called `city_populations`. Use a `for` loop to iterate through `cities` and have `city_populations` equal to each of the populations." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "city_populations = []" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "city_populations[0] # 2891\n", + "city_populations[1] # 2732\n", + "city_populations[-1] # 0" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Great! Now we can begin to plot this data. First, let's create a trace of our populations and set it to the variable `trace_populations`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "trace_populations = {'x': names_and_ranks, \n", + " 'y': city_populations, \n", + " 'text': names_and_ranks, \n", + " 'type': 'bar', \n", + " 'name': 'populations'}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import plotly\n", + "plotly.offline.init_notebook_mode(connected=True)\n", + "plotly.offline.iplot([trace_populations])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we want declare a variable called `city_areas` that points to a list of all of the areas of the cities. Let's use a `for` loop to iterate through our `cities` and have `city_areas` equal to each area of the city. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "city_areas = []" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "trace_areas = {'x': names_and_ranks, 'y': city_areas, 'text': names_and_ranks, 'type': 'bar', 'name': 'areas'}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import plotly\n", + "plotly.offline.init_notebook_mode(connected=True)\n", + "plotly.offline.iplot([trace_populations, trace_areas])" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Summary" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In this section we saw how we can use `for` loops to go through elements of a list and perform the same operation on each. By using `for` loops we were able to reduce the amount of code that we wrote and while also writing more expressive code." + ] + } + ], + "metadata": { + "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.9" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} From 0377fa25f2ae788eae2b1326f7dba1a6af403c7b Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:49:10 +0000 Subject: [PATCH 02/35] Automatically backed up by Learn --- index.ipynb | 893 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 890 insertions(+), 3 deletions(-) diff --git a/index.ipynb b/index.ipynb index 76371cc1950..5495eea80a6 100644 --- a/index.ipynb +++ b/index.ipynb @@ -38,7 +38,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -57,9 +57,896 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "linkText": "Export to plot.ly", + "plotlyServerURL": "https://plot.ly", + "showLink": false + }, + "data": [ + { + "type": "bar", + "x": [ + "Buenos Aires", + "Toronto", + "Marakesh" + ], + "y": [ + 2891, + 2732, + 929 + ] + } + ], + "layout": { + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + } + } + }, + "text/html": [ + "
\n", + " \n", + " \n", + "
\n", + " \n", + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "import plotly\n", "\n", From 33036e8198fb0925011809a6b3904e5552a3118b Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:49:30 +0000 Subject: [PATCH 03/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 5495eea80a6..68e63cdb939 100644 --- a/index.ipynb +++ b/index.ipynb @@ -967,7 +967,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ From bd9eca58dfbbd1355b85adae8283045b85f2a41c Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:50:00 +0000 Subject: [PATCH 04/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 68e63cdb939..5cb6ecb52af 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1002,7 +1002,7 @@ "metadata": {}, "outputs": [], "source": [ - "city_indices = None\n", + "city_indices = list(range(0, len(countries)))\n", "city_indices # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]" ] }, From 5f4935072758c7765700baa4c939c52a50aa89c2 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:50:10 +0000 Subject: [PATCH 05/35] Automatically backed up by Learn --- index.ipynb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/index.ipynb b/index.ipynb index 5cb6ecb52af..66b937c0a92 100644 --- a/index.ipynb +++ b/index.ipynb @@ -998,11 +998,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "city_indices = list(range(0, len(countries)))\n", + "city_indices = list(range(0, len(cities)))\n", "city_indices # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]" ] }, From 001f67b0438a9a7fa022ec2ad652ae1594ebb9af Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:50:20 +0000 Subject: [PATCH 06/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 66b937c0a92..405ddfcecf2 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1026,7 +1026,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ From ffe471c063bd370ce3fac70ecfc67ef1b65c05c5 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:50:40 +0000 Subject: [PATCH 07/35] Automatically backed up by Learn --- index.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/index.ipynb b/index.ipynb index 405ddfcecf2..2fa47c1d260 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1058,6 +1058,7 @@ "outputs": [], "source": [ "names_and_ranks = [] \n", + "\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From e7ca68b126c010f8e7dcc9030febaf2e18075f2e Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:50:50 +0000 Subject: [PATCH 08/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 2fa47c1d260..1bad20fc67a 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1058,7 +1058,7 @@ "outputs": [], "source": [ "names_and_ranks = [] \n", - "\n", + "for city\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From 3d30b7ca4cc14221aa9dd0dc30ed3fb5c21f6dff Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:51:00 +0000 Subject: [PATCH 09/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 1bad20fc67a..bea19f572a9 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1058,7 +1058,7 @@ "outputs": [], "source": [ "names_and_ranks = [] \n", - "for city\n", + "for city_index in city_indices\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From b854eacd446d90c7a1a5348988f830f7789c4cdb Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:51:10 +0000 Subject: [PATCH 10/35] Automatically backed up by Learn --- index.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index bea19f572a9..d3b94b28f74 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1058,7 +1058,8 @@ "outputs": [], "source": [ "names_and_ranks = [] \n", - "for city_index in city_indices\n", + "for city_index in city_indices:\n", + " nam\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From 8bfc55e16ee7a02abdb1e7cce829e23e82060001 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:51:21 +0000 Subject: [PATCH 11/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index d3b94b28f74..a70a178604e 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1059,7 +1059,7 @@ "source": [ "names_and_ranks = [] \n", "for city_index in city_indices:\n", - " nam\n", + " names_and_ranks.append()\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From 3c11a8d1bb7f7a2cadd4adaa4727eab29628daa6 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:51:30 +0000 Subject: [PATCH 12/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index a70a178604e..fd2b540e6fb 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1059,7 +1059,7 @@ "source": [ "names_and_ranks = [] \n", "for city_index in city_indices:\n", - " names_and_ranks.append()\n", + " names_and_ranks.append(cityind)\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From 34b3345ee160c2637eee513e75fa04fe93c47117 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:51:40 +0000 Subject: [PATCH 13/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index fd2b540e6fb..bbd7d0367fa 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1059,7 +1059,7 @@ "source": [ "names_and_ranks = [] \n", "for city_index in city_indices:\n", - " names_and_ranks.append(cityind)\n", + " names_and_ranks.append(city_index+1)\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From fd7fb38c4b2fcfd0be4e248b126b7923263817b1 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:51:50 +0000 Subject: [PATCH 14/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index bbd7d0367fa..a70a178604e 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1059,7 +1059,7 @@ "source": [ "names_and_ranks = [] \n", "for city_index in city_indices:\n", - " names_and_ranks.append(city_index+1)\n", + " names_and_ranks.append()\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From 0aaca07269e8b488b427e00b8888c52186bff567 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:52:00 +0000 Subject: [PATCH 15/35] Automatically backed up by Learn --- index.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/index.ipynb b/index.ipynb index a70a178604e..9de612d2443 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1059,6 +1059,7 @@ "source": [ "names_and_ranks = [] \n", "for city_index in city_indices:\n", + " rank = city_\n", " names_and_ranks.append()\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] From be52be7930452f0f19a2ad38158a240010920382 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:52:11 +0000 Subject: [PATCH 16/35] Automatically backed up by Learn --- index.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ipynb b/index.ipynb index 9de612d2443..4b776b7a30d 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1059,8 +1059,8 @@ "source": [ "names_and_ranks = [] \n", "for city_index in city_indices:\n", - " rank = city_\n", - " names_and_ranks.append()\n", + " rank = city_index + 1\n", + " names_and_ranks.append(rank)\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From 63326867906d0c814e75e9f8ef264ebd900b04e2 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:52:40 +0000 Subject: [PATCH 17/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 4b776b7a30d..370c08c6baf 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1060,7 +1060,7 @@ "names_and_ranks = [] \n", "for city_index in city_indices:\n", " rank = city_index + 1\n", - " names_and_ranks.append(rank)\n", + " names_and_ranks.append(f')\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From b4d22c79b0ceb18347adb215b12038662f165bdc Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:52:50 +0000 Subject: [PATCH 18/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 370c08c6baf..87e49e1f2cd 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1060,7 +1060,7 @@ "names_and_ranks = [] \n", "for city_index in city_indices:\n", " rank = city_index + 1\n", - " names_and_ranks.append(f')\n", + " names_and_ranks.append(f'{rank} ')\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From 7ac9175d705960c6e758856adffc258cb2255797 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:53:00 +0000 Subject: [PATCH 19/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 87e49e1f2cd..45548cdb260 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1060,7 +1060,7 @@ "names_and_ranks = [] \n", "for city_index in city_indices:\n", " rank = city_index + 1\n", - " names_and_ranks.append(f'{rank} ')\n", + " names_and_ranks.append(f'{rank}. ')\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From 52d29d0be5cd2f5369dde5d110fe704d14ef7763 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:53:10 +0000 Subject: [PATCH 20/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 45548cdb260..e5f10a355f7 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1060,7 +1060,7 @@ "names_and_ranks = [] \n", "for city_index in city_indices:\n", " rank = city_index + 1\n", - " names_and_ranks.append(f'{rank}. ')\n", + " names_and_ranks.append(f'{rank}. {city_names[city_index]}')\n", "# write a for loop that adds the properly formatted string to the names_and_ranks list" ] }, From b29cadb423b6844540b774c668f6cc4f52c6c1e2 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:53:30 +0000 Subject: [PATCH 21/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index e5f10a355f7..83d72e1e819 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1053,7 +1053,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ From cef73d2dde41bcae40c56f71f0200927bdc56d60 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:53:40 +0000 Subject: [PATCH 22/35] Automatically backed up by Learn --- index.ipynb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/index.ipynb b/index.ipynb index 83d72e1e819..606e64c652f 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1066,9 +1066,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "'12. Iguazu Falls'" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "names_and_ranks[0] # '1. Buenos Aires'\n", "names_and_ranks[1] # '2. Toronto'\n", From 4da40ec096c9d85819045fe08277b7892db16db0 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:53:50 +0000 Subject: [PATCH 23/35] Automatically backed up by Learn --- index.ipynb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/index.ipynb b/index.ipynb index 606e64c652f..59e4acc7ce5 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1053,15 +1053,24 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['1. Buenos Aires', '2. Toronto', '3. Marakesh', '4. Albuquerque', '5. Los Cabos', '6. Greenville', '7. Archipelago Sea', '8. Pyeongchang', '9. Walla Walla Valley', '10. Salina Island', '11. Solta', '12. Iguazu Falls']\n" + ] + } + ], "source": [ "names_and_ranks = [] \n", "for city_index in city_indices:\n", " rank = city_index + 1\n", " names_and_ranks.append(f'{rank}. {city_names[city_index]}')\n", - "# write a for loop that adds the properly formatted string to the names_and_ranks list" + "# write a for loop that adds the properly formatted string to the names_and_ranks list\n", + "print(names_and_ranks)" ] }, { From 4946f59d8e7403a08a0725279d21ed2d460a7e99 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:54:20 +0000 Subject: [PATCH 24/35] Automatically backed up by Learn --- index.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 59e4acc7ce5..7ba7e593aa8 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1108,7 +1108,8 @@ "metadata": {}, "outputs": [], "source": [ - "city_populations = []" + "city_populations = []\n", + "for " ] }, { From 72611c1b2f95883299420f0de00559298fc0d434 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:54:30 +0000 Subject: [PATCH 25/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 7ba7e593aa8..8ca118e26b0 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1109,7 +1109,7 @@ "outputs": [], "source": [ "city_populations = []\n", - "for " + "for city_index in city_indices" ] }, { From f6ca60c4fa3bcd7ca5024123e170b9935632c578 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:54:40 +0000 Subject: [PATCH 26/35] Automatically backed up by Learn --- index.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 8ca118e26b0..90c3c3de7e5 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1109,7 +1109,8 @@ "outputs": [], "source": [ "city_populations = []\n", - "for city_index in city_indices" + "for city_index in city_indices:\n", + " city_populations.append()" ] }, { From d464c49b09ef3e01c1508c63f04f71f7200e38a0 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:54:50 +0000 Subject: [PATCH 27/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 90c3c3de7e5..868bbfa14e3 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1110,7 +1110,7 @@ "source": [ "city_populations = []\n", "for city_index in city_indices:\n", - " city_populations.append()" + " city_populations.append(cities[])" ] }, { From ed0368f4e351a394415b145ede490cc2b9d02f43 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:55:00 +0000 Subject: [PATCH 28/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 868bbfa14e3..8917247e8e5 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1110,7 +1110,7 @@ "source": [ "city_populations = []\n", "for city_index in city_indices:\n", - " city_populations.append(cities[])" + " city_populations.append(cities[city_index]['Population'])" ] }, { From dc5e426b9c546f4bd49b5823b1d742aed678c1d8 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:55:10 +0000 Subject: [PATCH 29/35] Automatically backed up by Learn --- index.ipynb | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/index.ipynb b/index.ipynb index 8917247e8e5..f98fe07be4c 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1104,20 +1104,43 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[2891, 2732, 929, 559, 288, 93, 60, 44, 33, 3, 2, 0]" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "city_populations = []\n", "for city_index in city_indices:\n", - " city_populations.append(cities[city_index]['Population'])" + " city_populations.append(cities[city_index]['Population'])\n", + "city_populations" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "0" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "city_populations[0] # 2891\n", "city_populations[1] # 2732\n", From b4d6a64b205c6cfe805be321e70767b861432001 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:55:30 +0000 Subject: [PATCH 30/35] Automatically backed up by Learn --- index.ipynb | 926 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 923 insertions(+), 3 deletions(-) diff --git a/index.ipynb b/index.ipynb index f98fe07be4c..fbcc5502a1a 100644 --- a/index.ipynb +++ b/index.ipynb @@ -1156,7 +1156,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -1169,9 +1169,929 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "linkText": "Export to plot.ly", + "plotlyServerURL": "https://plot.ly", + "showLink": false + }, + "data": [ + { + "name": "populations", + "text": [ + "1. Buenos Aires", + "2. Toronto", + "3. Marakesh", + "4. Albuquerque", + "5. Los Cabos", + "6. Greenville", + "7. Archipelago Sea", + "8. Pyeongchang", + "9. Walla Walla Valley", + "10. Salina Island", + "11. Solta", + "12. Iguazu Falls" + ], + "type": "bar", + "x": [ + "1. Buenos Aires", + "2. Toronto", + "3. Marakesh", + "4. Albuquerque", + "5. Los Cabos", + "6. Greenville", + "7. Archipelago Sea", + "8. Pyeongchang", + "9. Walla Walla Valley", + "10. Salina Island", + "11. Solta", + "12. Iguazu Falls" + ], + "y": [ + 2891, + 2732, + 929, + 559, + 288, + 93, + 60, + 44, + 33, + 3, + 2, + 0 + ] + } + ], + "layout": { + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + } + } + }, + "text/html": [ + "
\n", + " \n", + " \n", + "
\n", + " \n", + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "import plotly\n", "plotly.offline.init_notebook_mode(connected=True)\n", From 3af9dac56465ce195af25a1dfe447a2e92342ec2 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:56:10 +0000 Subject: [PATCH 31/35] Automatically backed up by Learn --- index.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index fbcc5502a1a..dca4d5a89f1 100644 --- a/index.ipynb +++ b/index.ipynb @@ -2111,7 +2111,8 @@ "metadata": {}, "outputs": [], "source": [ - "city_areas = []" + "city_areas = []\n", + "for city_" ] }, { From 70b438b3322be77cc14c97c53bab317cdad4b92c Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:56:20 +0000 Subject: [PATCH 32/35] Automatically backed up by Learn --- index.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index dca4d5a89f1..7f1bc5a29fb 100644 --- a/index.ipynb +++ b/index.ipynb @@ -2112,7 +2112,8 @@ "outputs": [], "source": [ "city_areas = []\n", - "for city_" + "for city_index in city_indices:\n", + " city_areas." ] }, { From 3f11dcd9dd12bfc8ac955e994a5814849c945551 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:56:30 +0000 Subject: [PATCH 33/35] Automatically backed up by Learn --- index.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 7f1bc5a29fb..44958990898 100644 --- a/index.ipynb +++ b/index.ipynb @@ -2113,7 +2113,7 @@ "source": [ "city_areas = []\n", "for city_index in city_indices:\n", - " city_areas." + " city_areas.append(cities[city_index][''])" ] }, { From 1ed90f5d43aeb1566c52c5d46cde0fe8bfeb9149 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:58:00 +0000 Subject: [PATCH 34/35] Automatically backed up by Learn --- index.ipynb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ipynb b/index.ipynb index 44958990898..8623811817f 100644 --- a/index.ipynb +++ b/index.ipynb @@ -2113,7 +2113,8 @@ "source": [ "city_areas = []\n", "for city_index in city_indices:\n", - " city_areas.append(cities[city_index][''])" + " city_areas.append(cities[city_index]['Area'])\n", + "city_areas" ] }, { From 1720043865846274d7fa3b70b5098bc3a1f75737 Mon Sep 17 00:00:00 2001 From: Laurell McCaffrey Date: Sun, 2 Feb 2020 21:58:10 +0000 Subject: [PATCH 35/35] Automatically backed up by Learn --- index.ipynb | 987 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 982 insertions(+), 5 deletions(-) diff --git a/index.ipynb b/index.ipynb index 8623811817f..ad06e8f2ac9 100644 --- a/index.ipynb +++ b/index.ipynb @@ -2107,9 +2107,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[203, 630, 230, 491, 3751, 68, 2000, 1464, 35, 26, 59, 2396]" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "city_areas = []\n", "for city_index in city_indices:\n", @@ -2119,7 +2130,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -2128,9 +2139,975 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.plotly.v1+json": { + "config": { + "linkText": "Export to plot.ly", + "plotlyServerURL": "https://plot.ly", + "showLink": false + }, + "data": [ + { + "name": "populations", + "text": [ + "1. Buenos Aires", + "2. Toronto", + "3. Marakesh", + "4. Albuquerque", + "5. Los Cabos", + "6. Greenville", + "7. Archipelago Sea", + "8. Pyeongchang", + "9. Walla Walla Valley", + "10. Salina Island", + "11. Solta", + "12. Iguazu Falls" + ], + "type": "bar", + "x": [ + "1. Buenos Aires", + "2. Toronto", + "3. Marakesh", + "4. Albuquerque", + "5. Los Cabos", + "6. Greenville", + "7. Archipelago Sea", + "8. Pyeongchang", + "9. Walla Walla Valley", + "10. Salina Island", + "11. Solta", + "12. Iguazu Falls" + ], + "y": [ + 2891, + 2732, + 929, + 559, + 288, + 93, + 60, + 44, + 33, + 3, + 2, + 0 + ] + }, + { + "name": "areas", + "text": [ + "1. Buenos Aires", + "2. Toronto", + "3. Marakesh", + "4. Albuquerque", + "5. Los Cabos", + "6. Greenville", + "7. Archipelago Sea", + "8. Pyeongchang", + "9. Walla Walla Valley", + "10. Salina Island", + "11. Solta", + "12. Iguazu Falls" + ], + "type": "bar", + "x": [ + "1. Buenos Aires", + "2. Toronto", + "3. Marakesh", + "4. Albuquerque", + "5. Los Cabos", + "6. Greenville", + "7. Archipelago Sea", + "8. Pyeongchang", + "9. Walla Walla Valley", + "10. Salina Island", + "11. Solta", + "12. Iguazu Falls" + ], + "y": [ + 203, + 630, + 230, + 491, + 3751, + 68, + 2000, + 1464, + 35, + 26, + 59, + 2396 + ] + } + ], + "layout": { + "template": { + "data": { + "bar": [ + { + "error_x": { + "color": "#2a3f5f" + }, + "error_y": { + "color": "#2a3f5f" + }, + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + } + }, + "type": "bar" + } + ], + "barpolar": [ + { + "marker": { + "line": { + "color": "#E5ECF6", + "width": 0.5 + } + }, + "type": "barpolar" + } + ], + "carpet": [ + { + "aaxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "baxis": { + "endlinecolor": "#2a3f5f", + "gridcolor": "white", + "linecolor": "white", + "minorgridcolor": "white", + "startlinecolor": "#2a3f5f" + }, + "type": "carpet" + } + ], + "choropleth": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "choropleth" + } + ], + "contour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "contour" + } + ], + "contourcarpet": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "contourcarpet" + } + ], + "heatmap": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmap" + } + ], + "heatmapgl": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "heatmapgl" + } + ], + "histogram": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "histogram" + } + ], + "histogram2d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2d" + } + ], + "histogram2dcontour": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "histogram2dcontour" + } + ], + "mesh3d": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "type": "mesh3d" + } + ], + "parcoords": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "parcoords" + } + ], + "scatter": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter" + } + ], + "scatter3d": [ + { + "line": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatter3d" + } + ], + "scattercarpet": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattercarpet" + } + ], + "scattergeo": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergeo" + } + ], + "scattergl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattergl" + } + ], + "scattermapbox": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scattermapbox" + } + ], + "scatterpolar": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolar" + } + ], + "scatterpolargl": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterpolargl" + } + ], + "scatterternary": [ + { + "marker": { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + } + }, + "type": "scatterternary" + } + ], + "surface": [ + { + "colorbar": { + "outlinewidth": 0, + "ticks": "" + }, + "colorscale": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "type": "surface" + } + ], + "table": [ + { + "cells": { + "fill": { + "color": "#EBF0F8" + }, + "line": { + "color": "white" + } + }, + "header": { + "fill": { + "color": "#C8D4E3" + }, + "line": { + "color": "white" + } + }, + "type": "table" + } + ] + }, + "layout": { + "annotationdefaults": { + "arrowcolor": "#2a3f5f", + "arrowhead": 0, + "arrowwidth": 1 + }, + "colorscale": { + "diverging": [ + [ + 0, + "#8e0152" + ], + [ + 0.1, + "#c51b7d" + ], + [ + 0.2, + "#de77ae" + ], + [ + 0.3, + "#f1b6da" + ], + [ + 0.4, + "#fde0ef" + ], + [ + 0.5, + "#f7f7f7" + ], + [ + 0.6, + "#e6f5d0" + ], + [ + 0.7, + "#b8e186" + ], + [ + 0.8, + "#7fbc41" + ], + [ + 0.9, + "#4d9221" + ], + [ + 1, + "#276419" + ] + ], + "sequential": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ], + "sequentialminus": [ + [ + 0, + "#0d0887" + ], + [ + 0.1111111111111111, + "#46039f" + ], + [ + 0.2222222222222222, + "#7201a8" + ], + [ + 0.3333333333333333, + "#9c179e" + ], + [ + 0.4444444444444444, + "#bd3786" + ], + [ + 0.5555555555555556, + "#d8576b" + ], + [ + 0.6666666666666666, + "#ed7953" + ], + [ + 0.7777777777777778, + "#fb9f3a" + ], + [ + 0.8888888888888888, + "#fdca26" + ], + [ + 1, + "#f0f921" + ] + ] + }, + "colorway": [ + "#636efa", + "#EF553B", + "#00cc96", + "#ab63fa", + "#FFA15A", + "#19d3f3", + "#FF6692", + "#B6E880", + "#FF97FF", + "#FECB52" + ], + "font": { + "color": "#2a3f5f" + }, + "geo": { + "bgcolor": "white", + "lakecolor": "white", + "landcolor": "#E5ECF6", + "showlakes": true, + "showland": true, + "subunitcolor": "white" + }, + "hoverlabel": { + "align": "left" + }, + "hovermode": "closest", + "mapbox": { + "style": "light" + }, + "paper_bgcolor": "white", + "plot_bgcolor": "#E5ECF6", + "polar": { + "angularaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "radialaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "scene": { + "xaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "yaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + }, + "zaxis": { + "backgroundcolor": "#E5ECF6", + "gridcolor": "white", + "gridwidth": 2, + "linecolor": "white", + "showbackground": true, + "ticks": "", + "zerolinecolor": "white" + } + }, + "shapedefaults": { + "line": { + "color": "#2a3f5f" + } + }, + "ternary": { + "aaxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "baxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + }, + "bgcolor": "#E5ECF6", + "caxis": { + "gridcolor": "white", + "linecolor": "white", + "ticks": "" + } + }, + "title": { + "x": 0.05 + }, + "xaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "zerolinecolor": "white", + "zerolinewidth": 2 + }, + "yaxis": { + "automargin": true, + "gridcolor": "white", + "linecolor": "white", + "ticks": "", + "zerolinecolor": "white", + "zerolinewidth": 2 + } + } + } + } + }, + "text/html": [ + "
\n", + " \n", + " \n", + "
\n", + " \n", + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "import plotly\n", "plotly.offline.init_notebook_mode(connected=True)\n",