Skip to content

Commit

Permalink
Enabled file downloading to run lab in Google colab
Browse files Browse the repository at this point in the history
  • Loading branch information
sdrangan committed Sep 15, 2020
1 parent 25a3879 commit 3816beb
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions unit03_mult_lin_reg/lab_robot_calib_partial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,42 @@
"* [exp1.csv](./exp1.csv) for training\n",
"* [exp2.csv](./exp2.csv) for test\n",
"\n",
"Below, I have supplied the column headers in the `names` array. Use the `pd.read_csv` command to load the data. Use the `index_col` option to specify that column 0 (the one with time) is the *index* column. You can review [simple linear regression demo](..\\simp_lin_reg\\auto_mpg.ipynb) for examples of using the `pd.read_csv` command."
"If you are running this notebook on Google colab, you will need to run the following commands to load the files onto your local machine. Otherwise, if you have clone the repository, the files should be in the directory as the notebook and you can skip this step."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"File exp1.csv is already downloaded\n",
"File exp2.csv is already downloaded\n"
]
}
],
"source": [
"import os\n",
"from six.moves import urllib\n",
"\n",
"for fn_dst in ['exp1.csv', 'exp2.csv']:\n",
" fn_src = 'https://raw.githubusercontent.com/sdrangan/introml/master/unit03_mult_lin_reg/%s' % fn_dst\n",
"\n",
" if os.path.isfile(fn_dst):\n",
" print('File %s is already downloaded' % fn_dst)\n",
" else:\n",
" print('Downloaded %s' % fn_dst)\n",
" urllib.request.urlretrieve(fn_src, fn_dst)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Below, I have supplied the column headers in the `names` array. Use the `pd.read_csv` command to load the training data in `exp1.csv`. Use the `index_col` option to specify that column 0 (the one with time) is the *index* column. You can review [simple linear regression demo](..\\simp_lin_reg\\auto_mpg.ipynb) for examples of using the `pd.read_csv` command."
]
},
{
Expand Down Expand Up @@ -253,7 +288,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.7.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 3816beb

Please sign in to comment.