Skip to content

Completed 01 #175

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
146 changes: 121 additions & 25 deletions 01_Getting_&_Knowing_Your_Data/Chipotle/Exercise_with_Solutions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"url = 'https://raw.githubusercontent.com/justmarkham/DAT8/master/data/chipotle.tsv'\n",
" \n",
"\n",
"chipo = pd.read_csv(url, sep = '\\t')"
]
},
Expand All @@ -77,6 +77,19 @@
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
Expand Down Expand Up @@ -253,13 +266,15 @@
"<class 'pandas.core.frame.DataFrame'>\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"
]
}
],
Expand Down Expand Up @@ -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')"
]
},
Expand Down Expand Up @@ -376,33 +391,60 @@
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>order_id</th>\n",
" <th>quantity</th>\n",
" <th>choice_description</th>\n",
" <th>item_price</th>\n",
" </tr>\n",
" <tr>\n",
" <th>item_name</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Chicken Bowl</th>\n",
" <td>713926</td>\n",
" <td>761</td>\n",
" <td>[Tomatillo-Red Chili Salsa (Hot), [Black Beans...</td>\n",
" <td>$16.98 $10.98 $11.25 $8.75 $8.49 $11.25 $8.75 ...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" order_id quantity\n",
"item_name \n",
"Chicken Bowl 713926 761"
" order_id quantity \\\n",
"item_name \n",
"Chicken Bowl 713926 761 \n",
"\n",
" choice_description \\\n",
"item_name \n",
"Chicken Bowl [Tomatillo-Red Chili Salsa (Hot), [Black Beans... \n",
"\n",
" item_price \n",
"item_name \n",
"Chicken Bowl $16.98 $10.98 $11.25 $8.75 $8.49 $11.25 $8.75 ... "
]
},
"execution_count": 9,
Expand Down Expand Up @@ -435,33 +477,60 @@
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>order_id</th>\n",
" <th>quantity</th>\n",
" <th>choice_description</th>\n",
" <th>item_price</th>\n",
" </tr>\n",
" <tr>\n",
" <th>item_name</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Chicken Bowl</th>\n",
" <td>713926</td>\n",
" <td>761</td>\n",
" <td>[Tomatillo-Red Chili Salsa (Hot), [Black Beans...</td>\n",
" <td>$16.98 $10.98 $11.25 $8.75 $8.49 $11.25 $8.75 ...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" order_id quantity\n",
"item_name \n",
"Chicken Bowl 713926 761"
" order_id quantity \\\n",
"item_name \n",
"Chicken Bowl 713926 761 \n",
"\n",
" choice_description \\\n",
"item_name \n",
"Chicken Bowl [Tomatillo-Red Chili Salsa (Hot), [Black Beans... \n",
"\n",
" item_price \n",
"item_name \n",
"Chicken Bowl $16.98 $10.98 $11.25 $8.75 $8.49 $11.25 $8.75 ... "
]
},
"execution_count": 10,
Expand Down Expand Up @@ -494,33 +563,60 @@
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>order_id</th>\n",
" <th>quantity</th>\n",
" <th>item_name</th>\n",
" <th>item_price</th>\n",
" </tr>\n",
" <tr>\n",
" <th>choice_description</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>[Diet Coke]</th>\n",
" <td>123455</td>\n",
" <td>159</td>\n",
" <td>Canned SodaCanned SodaCanned Soda6 Pack Soft D...</td>\n",
" <td>$2.18 $1.09 $1.09 $6.49 $2.18 $1.25 $1.09 $6.4...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" order_id quantity\n",
"choice_description \n",
"[Diet Coke] 123455 159"
" order_id quantity \\\n",
"choice_description \n",
"[Diet Coke] 123455 159 \n",
"\n",
" item_name \\\n",
"choice_description \n",
"[Diet Coke] Canned SodaCanned SodaCanned Soda6 Pack Soft D... \n",
"\n",
" item_price \n",
"choice_description \n",
"[Diet Coke] $2.18 $1.09 $1.09 $6.49 $2.18 $1.25 $1.09 $6.4... "
]
},
"execution_count": 11,
Expand Down Expand Up @@ -552,7 +648,7 @@
{
"data": {
"text/plain": [
"4972"
"np.int64(4972)"
]
},
"execution_count": 12,
Expand Down Expand Up @@ -797,21 +893,21 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python [default]",
"display_name": "Python 3",
"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.9.6"
}
},
"nbformat": 4,
Expand Down
Loading