|
1365 | 1365 | "\n", |
1366 | 1366 | "Note: You will need to restart the kernel after applying changes to the packages.\n", |
1367 | 1367 | "\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>" |
1369 | 1375 | ] |
1370 | 1376 | }, |
1371 | 1377 | { |
|
1387 | 1393 | " x_logscale=True, scale_bubble=3, height=650)\n", |
1388 | 1394 | "iplot(figure, config={'scrollZoom': True})\n" |
1389 | 1395 | ] |
| 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 | + ] |
1390 | 1413 | } |
1391 | 1414 | ], |
1392 | 1415 | "metadata": { |
|
0 commit comments