diff --git a/01_Getting_&_Knowing_Your_Data/Chipotle/Exercise_with_Solutions.ipynb b/01_Getting_&_Knowing_Your_Data/Chipotle/Exercise_with_Solutions.ipynb
index 162700786..43085d95a 100644
--- a/01_Getting_&_Knowing_Your_Data/Chipotle/Exercise_with_Solutions.ipynb
+++ b/01_Getting_&_Knowing_Your_Data/Chipotle/Exercise_with_Solutions.ipynb
@@ -77,6 +77,19 @@
"data": {
"text/html": [
"
\n",
+ "\n",
"
\n",
" \n",
" \n",
@@ -253,13 +266,15 @@
"\n",
"RangeIndex: 4622 entries, 0 to 4621\n",
"Data columns (total 5 columns):\n",
- "order_id 4622 non-null int64\n",
- "quantity 4622 non-null int64\n",
- "item_name 4622 non-null object\n",
- "choice_description 3376 non-null object\n",
- "item_price 4622 non-null object\n",
+ " # Column Non-Null Count Dtype \n",
+ "--- ------ -------------- ----- \n",
+ " 0 order_id 4622 non-null int64 \n",
+ " 1 quantity 4622 non-null int64 \n",
+ " 2 item_name 4622 non-null object\n",
+ " 3 choice_description 3376 non-null object\n",
+ " 4 item_price 4622 non-null object\n",
"dtypes: int64(2), object(3)\n",
- "memory usage: 180.6+ KB\n"
+ "memory usage: 180.7+ KB\n"
]
}
],
@@ -315,8 +330,8 @@
{
"data": {
"text/plain": [
- "Index([u'order_id', u'quantity', u'item_name', u'choice_description',\n",
- " u'item_price'],\n",
+ "Index(['order_id', 'quantity', 'item_name', 'choice_description',\n",
+ " 'item_price'],\n",
" dtype='object')"
]
},
@@ -376,23 +391,33 @@
"data": {
"text/html": [
"\n",
+ "\n",
"
\n",
" \n",
" \n",
" | \n",
- " order_id | \n",
" quantity | \n",
"
\n",
" \n",
" | item_name | \n",
" | \n",
- " | \n",
"
\n",
" \n",
" \n",
" \n",
" | Chicken Bowl | \n",
- " 713926 | \n",
" 761 | \n",
"
\n",
" \n",
@@ -400,9 +425,9 @@
""
],
"text/plain": [
- " order_id quantity\n",
- "item_name \n",
- "Chicken Bowl 713926 761"
+ " quantity\n",
+ "item_name \n",
+ "Chicken Bowl 761"
]
},
"execution_count": 9,
@@ -411,7 +436,7 @@
}
],
"source": [
- "c = chipo.groupby('item_name')\n",
+ "c = chipo[['item_name','quantity']].groupby('item_name')\n",
"c = c.sum()\n",
"c = c.sort_values(['quantity'], ascending=False)\n",
"c.head(1)"
@@ -435,23 +460,33 @@
"data": {
"text/html": [
"\n",
+ "\n",
"
\n",
" \n",
" \n",
" | \n",
- " order_id | \n",
" quantity | \n",
"
\n",
" \n",
" | item_name | \n",
" | \n",
- " | \n",
"
\n",
" \n",
" \n",
" \n",
" | Chicken Bowl | \n",
- " 713926 | \n",
" 761 | \n",
"
\n",
" \n",
@@ -459,9 +494,9 @@
""
],
"text/plain": [
- " order_id quantity\n",
- "item_name \n",
- "Chicken Bowl 713926 761"
+ " quantity\n",
+ "item_name \n",
+ "Chicken Bowl 761"
]
},
"execution_count": 10,
@@ -470,7 +505,7 @@
}
],
"source": [
- "c = chipo.groupby('item_name')\n",
+ "c = chipo[['item_name','quantity']].groupby('item_name')\n",
"c = c.sum()\n",
"c = c.sort_values(['quantity'], ascending=False)\n",
"c.head(1)"
@@ -797,21 +832,21 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
- "display_name": "Python [default]",
+ "display_name": "mo_aval",
"language": "python",
- "name": "python2"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.12"
+ "pygments_lexer": "ipython3",
+ "version": "3.12.4"
}
},
"nbformat": 4,