|
@@ -11,7 +11,6 @@
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"execution_count": 1,
|
|
"metadata": {
|
|
"metadata": {
|
|
- "collapsed": false,
|
|
|
|
"jupyter": {
|
|
"jupyter": {
|
|
"outputs_hidden": false
|
|
"outputs_hidden": false
|
|
}
|
|
}
|
|
@@ -45,14 +44,13 @@
|
|
"cell_type": "markdown",
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"source": [
|
|
"source": [
|
|
- "We'll begin by getting a sense of what the data looks like."
|
|
|
|
|
|
+ "We'll begin by exploring the data."
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"execution_count": 2,
|
|
"metadata": {
|
|
"metadata": {
|
|
- "collapsed": false,
|
|
|
|
"jupyter": {
|
|
"jupyter": {
|
|
"outputs_hidden": false
|
|
"outputs_hidden": false
|
|
}
|
|
}
|
|
@@ -175,15 +173,15 @@
|
|
"source": [
|
|
"source": [
|
|
"Here are the descriptions for some of the columns:\n",
|
|
"Here are the descriptions for some of the columns:\n",
|
|
"\n",
|
|
"\n",
|
|
- "* `name` - The name of the country.\n",
|
|
|
|
- "* `area` - The total land and sea area of the country.\n",
|
|
|
|
- "* `population` - The country's population.\n",
|
|
|
|
- "* `population_growth`- The country's population growth as a percentage.\n",
|
|
|
|
- "* `birth_rate` - The country's birth rate, or the number of births a year per 1,000 people.\n",
|
|
|
|
- "* `death_rate` - The country's death rate, or the number of death a year per 1,000 people.\n",
|
|
|
|
- "* `area`- The country's total area (both land and water).\n",
|
|
|
|
- "* `area_land` - The country's land area in [square kilometers](https://www.cia.gov/library/publications/the-world-factbook/rankorder/2147rank.html).\n",
|
|
|
|
- "* `area_water` - The country's waterarea in square kilometers.\n",
|
|
|
|
|
|
+ "* `name` — the name of the country.\n",
|
|
|
|
+ "* `area` — the total land and sea area of the country.\n",
|
|
|
|
+ "* `population` — the country's population.\n",
|
|
|
|
+ "* `population_growth`— the country's population growth as a percentage.\n",
|
|
|
|
+ "* `birth_rate` — the country's birth rate, or the number of births a year per 1,000 people.\n",
|
|
|
|
+ "* `death_rate` — the country's death rate, or the number of death a year per 1,000 people.\n",
|
|
|
|
+ "* `area`— the country's total area (both land and water).\n",
|
|
|
|
+ "* `area_land` — the country's land area in [square kilometers](https://www.cia.gov/library/publications/the-world-factbook/rankorder/2147rank.html).\n",
|
|
|
|
+ "* `area_water` — the country's water area in square kilometers.\n",
|
|
"\n",
|
|
"\n",
|
|
"Let's start by calculating some summary statistics and see what they tell us."
|
|
"Let's start by calculating some summary statistics and see what they tell us."
|
|
]
|
|
]
|
|
@@ -199,7 +197,6 @@
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"execution_count": 3,
|
|
"metadata": {
|
|
"metadata": {
|
|
- "collapsed": false,
|
|
|
|
"jupyter": {
|
|
"jupyter": {
|
|
"outputs_hidden": false
|
|
"outputs_hidden": false
|
|
}
|
|
}
|
|
@@ -252,12 +249,12 @@
|
|
"cell_type": "markdown",
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"source": [
|
|
"source": [
|
|
- "A few things stick out from the summary statistics in the last screen:\n",
|
|
|
|
|
|
+ "A few things are interesting in the summary statistics on the previous screen:\n",
|
|
"\n",
|
|
"\n",
|
|
- "- There's a country with a population of `0`\n",
|
|
|
|
- "- There's a country with a population of `7256490011` (or more than 7.2 billion people) \n",
|
|
|
|
|
|
+ "- There's a country with a population of `0`.\n",
|
|
|
|
+ "- There's a country with a population of `7256490011` (or more than 7.2 billion people).\n",
|
|
"\n",
|
|
"\n",
|
|
- "Let's use subqueries to zoom in on just these countries _without_ using the specific values."
|
|
|
|
|
|
+ "Let's use subqueries to concentrate on these countries _without_ using the specific values."
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -271,7 +268,6 @@
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"execution_count": 4,
|
|
"metadata": {
|
|
"metadata": {
|
|
- "collapsed": false,
|
|
|
|
"jupyter": {
|
|
"jupyter": {
|
|
"outputs_hidden": false
|
|
"outputs_hidden": false
|
|
}
|
|
}
|
|
@@ -347,7 +343,6 @@
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"execution_count": 5,
|
|
"metadata": {
|
|
"metadata": {
|
|
- "collapsed": false,
|
|
|
|
"jupyter": {
|
|
"jupyter": {
|
|
"outputs_hidden": false
|
|
"outputs_hidden": false
|
|
}
|
|
}
|
|
@@ -429,9 +424,7 @@
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"execution_count": 6,
|
|
- "metadata": {
|
|
|
|
- "collapsed": false
|
|
|
|
- },
|
|
|
|
|
|
+ "metadata": {},
|
|
"outputs": [
|
|
"outputs": [
|
|
{
|
|
{
|
|
"name": "stdout",
|
|
"name": "stdout",
|
|
@@ -497,14 +490,13 @@
|
|
"source": [
|
|
"source": [
|
|
"Let's explore density. Density depends on the population and the country's area. Let's look at the average values for these two columns.\n",
|
|
"Let's explore density. Density depends on the population and the country's area. Let's look at the average values for these two columns.\n",
|
|
"\n",
|
|
"\n",
|
|
- "We should take care of discarding the row for the whole planet."
|
|
|
|
|
|
+ "We should discard the row for the whole planet."
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 7,
|
|
"execution_count": 7,
|
|
"metadata": {
|
|
"metadata": {
|
|
- "collapsed": false,
|
|
|
|
"jupyter": {
|
|
"jupyter": {
|
|
"outputs_hidden": false
|
|
"outputs_hidden": false
|
|
}
|
|
}
|
|
@@ -565,17 +557,16 @@
|
|
"cell_type": "markdown",
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"metadata": {},
|
|
"source": [
|
|
"source": [
|
|
- "To finish, we'll build on the query above to find countries that are densely populated. We'll identify countries that have:\n",
|
|
|
|
|
|
+ "To finish, we'll build on the query above to find countries that are densely populated. We'll identify countries that have the following:\n",
|
|
"\n",
|
|
"\n",
|
|
- "- Above average values for population.\n",
|
|
|
|
- "- Below average values for area."
|
|
|
|
|
|
+ "- Above-average values for population.\n",
|
|
|
|
+ "- Below-average values for area."
|
|
]
|
|
]
|
|
},
|
|
},
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 8,
|
|
"execution_count": 8,
|
|
"metadata": {
|
|
"metadata": {
|
|
- "collapsed": false,
|
|
|
|
"jupyter": {
|
|
"jupyter": {
|
|
"outputs_hidden": false
|
|
"outputs_hidden": false
|
|
}
|
|
}
|
|
@@ -849,7 +840,7 @@
|
|
"name": "python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"pygments_lexer": "ipython3",
|
|
- "version": "3.4.3"
|
|
|
|
|
|
+ "version": "3.8.5"
|
|
}
|
|
}
|
|
},
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat": 4,
|