|
@@ -1,5 +1,12 @@
|
|
{
|
|
{
|
|
"cells": [
|
|
"cells": [
|
|
|
|
+ {
|
|
|
|
+ "cell_type": "markdown",
|
|
|
|
+ "metadata": {},
|
|
|
|
+ "source": [
|
|
|
|
+ "# Introducing Thanksgiving Dinner Data"
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 39,
|
|
"execution_count": 39,
|
|
@@ -383,6 +390,13 @@
|
|
"data.columns"
|
|
"data.columns"
|
|
]
|
|
]
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ "cell_type": "markdown",
|
|
|
|
+ "metadata": {},
|
|
|
|
+ "source": [
|
|
|
|
+ "# Filtering Out Rows From A DataFrame"
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 41,
|
|
"execution_count": 41,
|
|
@@ -418,6 +432,13 @@
|
|
"data = data[data[\"Do you celebrate Thanksgiving?\"] == \"Yes\"]"
|
|
"data = data[data[\"Do you celebrate Thanksgiving?\"] == \"Yes\"]"
|
|
]
|
|
]
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ "cell_type": "markdown",
|
|
|
|
+ "metadata": {},
|
|
|
|
+ "source": [
|
|
|
|
+ "# Using value_counts To Explore Main Dishes"
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 43,
|
|
"execution_count": 43,
|
|
@@ -490,6 +511,13 @@
|
|
"data[data[\"What is typically the main dish at your Thanksgiving dinner?\"] == \"Tofurkey\"][\"Do you typically have gravy?\"]"
|
|
"data[data[\"What is typically the main dish at your Thanksgiving dinner?\"] == \"Tofurkey\"][\"Do you typically have gravy?\"]"
|
|
]
|
|
]
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ "cell_type": "markdown",
|
|
|
|
+ "metadata": {},
|
|
|
|
+ "source": [
|
|
|
|
+ "# Figuring Out What Pies People Eat"
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 51,
|
|
"execution_count": 51,
|
|
@@ -544,6 +572,13 @@
|
|
"ate_pies.value_counts()"
|
|
"ate_pies.value_counts()"
|
|
]
|
|
]
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ "cell_type": "markdown",
|
|
|
|
+ "metadata": {},
|
|
|
|
+ "source": [
|
|
|
|
+ "# Converting Age To Numeric"
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 45,
|
|
"execution_count": 45,
|
|
@@ -625,6 +660,13 @@
|
|
"Although we only have a rough approximation of age, and it skews downward because we took the first value in each string (the lower bound), we can see that that age groups of respondents are fairly evenly distributed."
|
|
"Although we only have a rough approximation of age, and it skews downward because we took the first value in each string (the lower bound), we can see that that age groups of respondents are fairly evenly distributed."
|
|
]
|
|
]
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ "cell_type": "markdown",
|
|
|
|
+ "metadata": {},
|
|
|
|
+ "source": [
|
|
|
|
+ "# Converting Income To Numeric"
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 47,
|
|
"execution_count": 47,
|
|
@@ -716,6 +758,13 @@
|
|
"Although we only have a rough approximation of income, and it skews downward because we took the first value in each string (the lower bound), the average income seems to be fairly high, although there is also a large standard deviation."
|
|
"Although we only have a rough approximation of income, and it skews downward because we took the first value in each string (the lower bound), the average income seems to be fairly high, although there is also a large standard deviation."
|
|
]
|
|
]
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ "cell_type": "markdown",
|
|
|
|
+ "metadata": {},
|
|
|
|
+ "source": [
|
|
|
|
+ "# Correlating Travel Distance And Income"
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 49,
|
|
"execution_count": 49,
|
|
@@ -777,6 +826,13 @@
|
|
"It appears that more people with high income have Thanksgiving at home than people with low income. This may be because younger students, who don't have a high income, tend to go home, whereas parents, who have higher incomes, don't."
|
|
"It appears that more people with high income have Thanksgiving at home than people with low income. This may be because younger students, who don't have a high income, tend to go home, whereas parents, who have higher incomes, don't."
|
|
]
|
|
]
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ "cell_type": "markdown",
|
|
|
|
+ "metadata": {},
|
|
|
|
+ "source": [
|
|
|
|
+ "# Linking Friendship And Age"
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
{
|
|
{
|
|
"cell_type": "code",
|
|
"cell_type": "code",
|
|
"execution_count": 53,
|
|
"execution_count": 53,
|
|
@@ -907,21 +963,25 @@
|
|
],
|
|
],
|
|
"metadata": {
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"kernelspec": {
|
|
- "display_name": "Python 3",
|
|
|
|
|
|
+ "display_name": "Python 2",
|
|
"language": "python",
|
|
"language": "python",
|
|
- "name": "python3"
|
|
|
|
|
|
+ "name": "python2"
|
|
},
|
|
},
|
|
"language_info": {
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"name": "ipython",
|
|
- "version": 3
|
|
|
|
|
|
+ "version": 2
|
|
},
|
|
},
|
|
"file_extension": ".py",
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"nbconvert_exporter": "python",
|
|
- "pygments_lexer": "ipython3",
|
|
|
|
- "version": "3.4.2"
|
|
|
|
|
|
+ "pygments_lexer": "ipython2",
|
|
|
|
+ "version": "2.7.9"
|
|
|
|
+ },
|
|
|
|
+ "widgets": {
|
|
|
|
+ "state": {},
|
|
|
|
+ "version": "1.1.1"
|
|
}
|
|
}
|
|
},
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat": 4,
|