Skip to content

Commit a22eea5

Browse files
committed
Changes to bonus exercise explaination
1 parent 59b1c30 commit a22eea5

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

30_introduction_data_exploration.ipynb

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,13 @@
13651365
"\n",
13661366
"Note: You will need to restart the kernel after applying changes to the packages.\n",
13671367
"\n",
1368-
"(If you are interested in a solution, we have a fixed version under `tutorial/my_bubbly.py`, feel free to check the differences.)"
1368+
"<details>\n",
1369+
"<summary><b>Hint</b> (click to reveal)</summary>\n",
1370+
"\n",
1371+
"The changes are all in the `make_grid` / `make_grid_with_categories` functions around lines 272, 282, 313, and 328.\n",
1372+
"The broken code uses a pandas method that was removed in newer versions.\n",
1373+
"\n",
1374+
"</details>"
13691375
]
13701376
},
13711377
{
@@ -1387,6 +1393,23 @@
13871393
" x_logscale=True, scale_bubble=3, height=650)\n",
13881394
"iplot(figure, config={'scrollZoom': True})\n"
13891395
]
1396+
},
1397+
{
1398+
"cell_type": "markdown",
1399+
"metadata": {},
1400+
"source": [
1401+
"If you are interested in a solution, we have a fixed version under `tutorial/my_bubbly.py`. You can compare the two files with Python's `difflib` module:\n",
1402+
"\n",
1403+
"```python\n",
1404+
"import difflib\n",
1405+
"with open('data/data_exploration/bubbly.py') as f:\n",
1406+
" original = f.readlines()\n",
1407+
"with open('tutorial/my_bubbly.py') as f:\n",
1408+
" fixed = f.readlines()\n",
1409+
"diff = difflib.unified_diff(original, fixed, fromfile='bubbly.py', tofile='my_bubbly.py')\n",
1410+
"print(''.join(diff))\n",
1411+
"```"
1412+
]
13901413
}
13911414
],
13921415
"metadata": {

0 commit comments

Comments
 (0)