Skip to content

Clarify ambiguity in 02/Chipotle steps 4 and 5 #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -667,12 +667,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Revenue was: $39237.02\n"
"Revenue was: $34500.16\n"
]
}
],
"source": [
"revenue = (chipo['quantity']* chipo['item_price']).sum()\n",
"revenue = chipo['item_price'].sum()\n",
"\n",
"print('Revenue was: $' + str(np.round(revenue,2)))"
]
Expand Down Expand Up @@ -724,7 +724,7 @@
{
"data": {
"text/plain": [
"21.394231188658654"
"18.81142857142869"
]
},
"execution_count": 31,
Expand All @@ -735,7 +735,7 @@
"source": [
"# Solution 1\n",
"\n",
"chipo['revenue'] = chipo['quantity'] * chipo['item_price']\n",
"chipo['revenue'] = chipo['item_price']\n",
"order_grouped = chipo.groupby(by=['order_id']).sum()\n",
"order_grouped.mean()['revenue']"
]
Expand All @@ -750,7 +750,7 @@
{
"data": {
"text/plain": [
"21.394231188658654"
"18.81142857142869"
]
},
"execution_count": 32,
Expand All @@ -761,7 +761,7 @@
"source": [
"# Solution 2\n",
"\n",
"chipo.groupby(by=['order_id']).sum().mean()['revenue']"
"chipo.groupby(by=['order_id']).sum().mean()['item_price']"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions 01_Getting_&_Knowing_Your_Data/Chipotle/Solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Revenue was: $39237.02\n"
"Revenue was: $34500.16\n"
]
}
],
Expand Down Expand Up @@ -675,7 +675,7 @@
{
"data": {
"text/plain": [
"21.394231188658654"
"18.81142857142869"
]
},
"execution_count": 31,
Expand All @@ -698,7 +698,7 @@
{
"data": {
"text/plain": [
"21.394231188658654"
"18.81142857142869"
]
},
"execution_count": 32,
Expand Down
9 changes: 6 additions & 3 deletions 02_Filtering_&_Sorting/Chipotle/Exercises.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Step 4. How many products cost more than $10.00?"
"### Step 4. How many items are able to cost more than \\\\$10.00 per item?\n",
"\n",
"For example, a Chicken Burrito usually costs less than \\\\$10.00 per item, but with certain toppings it can cost more than $10.00"
]
},
{
Expand All @@ -69,8 +71,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Step 5. What is the price of each item? \n",
"###### print a data frame with only two columns item_name and item_price"
"### Step 5. What is the price of each combination of item and choice description? \n",
"\n",
"Print a data frame with only three columns: item_name, choice_description, and price per item"
]
},
{
Expand Down
Loading