Skip to content

Commit

Permalink
submitting final revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-stach committed Oct 14, 2024
1 parent 12b69a4 commit 512d66c
Showing 1 changed file with 126 additions and 26 deletions.
152 changes: 126 additions & 26 deletions 02_activities/assignments/assignment_2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 7,
"id": "4a3485d6-ba58-4660-a983-5680821c5719",
"metadata": {},
"outputs": [],
Expand All @@ -50,7 +50,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"id": "a431d282-f9ca-4d5d-8912-71ffc9d8ea19",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -167,7 +167,7 @@
"4 70 usa ford torino "
]
},
"execution_count": 2,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -200,7 +200,7 @@
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 8,
"id": "5d79f1cf",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -257,7 +257,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 9,
"id": "ac306190",
"metadata": {},
"outputs": [
Expand All @@ -276,7 +276,7 @@
"dtype: object"
]
},
"execution_count": 22,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -305,34 +305,134 @@
},
{
"cell_type": "code",
"execution_count": 27,
"execution_count": 10,
"id": "9f034a5d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" mpg cylinders displacement horsepower weight acceleration \\\n",
"19 26.0 4 97.0 46.0 1835 20.5 \n",
"102 26.0 4 97.0 46.0 1950 21.0 \n",
"326 43.4 4 90.0 48.0 2335 23.7 \n",
"325 44.3 4 90.0 48.0 2085 21.7 \n",
"244 43.1 4 90.0 48.0 1985 21.5 \n",
"\n",
" model_year origin name \n",
"19 70 europe volkswagen 1131 deluxe sedan \n",
"102 73 europe volkswagen super beetle \n",
"326 80 europe vw dasher (diesel) \n",
"325 80 europe vw rabbit c (diesel) \n",
"244 78 europe volkswagen rabbit custom diesel \n"
]
"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>mpg</th>\n",
" <th>cylinders</th>\n",
" <th>displacement</th>\n",
" <th>horsepower</th>\n",
" <th>weight</th>\n",
" <th>acceleration</th>\n",
" <th>model_year</th>\n",
" <th>origin</th>\n",
" <th>name</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>116</th>\n",
" <td>16.0</td>\n",
" <td>8</td>\n",
" <td>400.0</td>\n",
" <td>230.0</td>\n",
" <td>4278</td>\n",
" <td>9.5</td>\n",
" <td>73</td>\n",
" <td>usa</td>\n",
" <td>pontiac grand prix</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
" <td>14.0</td>\n",
" <td>8</td>\n",
" <td>455.0</td>\n",
" <td>225.0</td>\n",
" <td>4425</td>\n",
" <td>10.0</td>\n",
" <td>70</td>\n",
" <td>usa</td>\n",
" <td>pontiac catalina</td>\n",
" </tr>\n",
" <tr>\n",
" <th>13</th>\n",
" <td>14.0</td>\n",
" <td>8</td>\n",
" <td>455.0</td>\n",
" <td>225.0</td>\n",
" <td>3086</td>\n",
" <td>10.0</td>\n",
" <td>70</td>\n",
" <td>usa</td>\n",
" <td>buick estate wagon (sw)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>95</th>\n",
" <td>12.0</td>\n",
" <td>8</td>\n",
" <td>455.0</td>\n",
" <td>225.0</td>\n",
" <td>4951</td>\n",
" <td>11.0</td>\n",
" <td>73</td>\n",
" <td>usa</td>\n",
" <td>buick electra 225 custom</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
" <td>14.0</td>\n",
" <td>8</td>\n",
" <td>454.0</td>\n",
" <td>220.0</td>\n",
" <td>4354</td>\n",
" <td>9.0</td>\n",
" <td>70</td>\n",
" <td>usa</td>\n",
" <td>chevrolet impala</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" mpg cylinders displacement horsepower weight acceleration \\\n",
"116 16.0 8 400.0 230.0 4278 9.5 \n",
"8 14.0 8 455.0 225.0 4425 10.0 \n",
"13 14.0 8 455.0 225.0 3086 10.0 \n",
"95 12.0 8 455.0 225.0 4951 11.0 \n",
"6 14.0 8 454.0 220.0 4354 9.0 \n",
"\n",
" model_year origin name \n",
"116 73 usa pontiac grand prix \n",
"8 70 usa pontiac catalina \n",
"13 70 usa buick estate wagon (sw) \n",
"95 73 usa buick electra 225 custom \n",
"6 70 usa chevrolet impala "
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Your answer here... \n",
"\n",
"print(df.sort_values(by='horsepower').head(5))"
"##print(df.sort_values(by='horsepower').head(5))\n",
"\n",
"df.nlargest(5, 'horsepower')\n"
]
},
{
Expand Down Expand Up @@ -541,7 +641,7 @@
"id": "843f9eef",
"metadata": {},
"source": [
"> Your answer here... the slope"
"> Your answer here... the slope and the intercept."
]
},
{
Expand Down

0 comments on commit 512d66c

Please sign in to comment.