Skip to content

Commit 4f62074

Browse files
committed
Rework section 3 images to avoid raw.github usage
1 parent 68e0be0 commit 4f62074

File tree

13 files changed

+31
-31
lines changed

13 files changed

+31
-31
lines changed

media/qr-code.png

-74.8 KB
Binary file not shown.

notebooks/3-interactivity.ipynb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@
12401240
"<p>The interactivity works best in a notebook environment &ndash; here's an example of the slider, tooltips, and zoom/pan functionality in action:</p>\n",
12411241
"\n",
12421242
"<div style=\"text-align: center;\">\n",
1243-
" <img width=\"50%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/interactive_map.gif\" style=\"border: 5px solid #555; min-width: 600px;\">\n",
1243+
" <img width=\"50%\" src=\"../slides/media/interactive_map.gif\" style=\"border: 5px solid #555; min-width: 600px;\">\n",
12441244
"</div>"
12451245
]
12461246
},
@@ -2227,7 +2227,7 @@
22272227
"<p>The result can be interacted with after displaying it, but this kind of interactivity only works in the notebook. Here's an example:</p>\n",
22282228
"\n",
22292229
"<div style=\"text-align: center;\">\n",
2230-
" <img width=\"60%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/linked_plots.gif\" style=\"border: 5px solid #555; min-width: 800px; margin: 0px auto;\">\n",
2230+
" <img width=\"60%\" src=\"../slides/media/linked_plots.gif\" style=\"border: 5px solid #555; min-width: 800px; margin: 0px auto;\">\n",
22312231
" <br/>\n",
22322232
" <small><em>This example uses tabs to display the layout rather than side by side like we did. Tabs are a little buggy in this version, so we didn't use them.</em></small>\n",
22332233
"</div>"
@@ -2412,7 +2412,7 @@
24122412
},
24132413
"source": [
24142414
"<div style=\"text-align: center;\">\n",
2415-
" <img width=\"75%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/sankey_and_chord.png\" style=\"min-width: 750px\">\n",
2415+
" <img width=\"75%\" src=\"../slides/media/sankey_and_chord.png\" style=\"min-width: 750px\">\n",
24162416
"</div>"
24172417
]
24182418
},
@@ -2443,12 +2443,12 @@
24432443
"flight_stats = pd.read_csv(\n",
24442444
" '../data/T100_MARKET_ALL_CARRIER.zip',\n",
24452445
" usecols=[\n",
2446-
" 'CLASS', 'REGION', 'UNIQUE_CARRIER_NAME', 'ORIGIN_CITY_NAME', 'ORIGIN', \n",
2446+
" 'CLASS', 'REGION', 'UNIQUE_CARRIER_NAME', 'ORIGIN_CITY_NAME', 'ORIGIN',\n",
24472447
" 'DEST_CITY_NAME', 'DEST', 'PASSENGERS', 'FREIGHT', 'MAIL'\n",
24482448
" ]\n",
24492449
").rename(lambda x: x.lower(), axis=1).assign(\n",
24502450
" region=lambda x: x.region.replace({\n",
2451-
" 'D': 'Domestic', 'I': 'International', 'A': 'Atlantic', \n",
2451+
" 'D': 'Domestic', 'I': 'International', 'A': 'Atlantic',\n",
24522452
" 'L': 'Latin America', 'P': 'Pacific', 'S': 'System'\n",
24532453
" }),\n",
24542454
" route=lambda x: np.where(\n",
@@ -2653,7 +2653,7 @@
26532653
"source": [
26542654
"cities = [\n",
26552655
" 'Atlanta, GA', 'Chicago, IL', 'New York, NY', 'Los Angeles, CA',\n",
2656-
" 'Dallas/Fort Worth, TX', 'Denver, CO', 'Houston, TX', \n",
2656+
" 'Dallas/Fort Worth, TX', 'Denver, CO', 'Houston, TX',\n",
26572657
" 'San Francisco, CA', 'Seattle, WA', 'Orlando, FL'\n",
26582658
"]\n",
26592659
"\n",
@@ -2678,7 +2678,7 @@
26782678
"A **chord diagram** is a way of showing many-to-many relationships between a set of entities called **nodes**: the nodes are arranged in a circle, and chords (which can be thought of as **edges**) are drawn between those that are connected, with the width of the chord encoding the strength of the connection. In this section, we will be making a chord diagram for total passenger service travel between the top 10 cities in 2019:\n",
26792679
"\n",
26802680
"<div style=\"text-align: center;\">\n",
2681-
" <img width=\"35%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/chord.png\" style=\"border: 5px solid #555; min-width: 350px\">\n",
2681+
" <img width=\"35%\" src=\"../slides/media/chord.png\" style=\"border: 5px solid #555; min-width: 350px\">\n",
26822682
"</div>"
26832683
]
26842684
},
@@ -2948,7 +2948,7 @@
29482948
"source": [
29492949
"chord = hv.Chord(\n",
29502950
" total_flight_stats,\n",
2951-
" kdims=['origin', 'dest'], \n",
2951+
" kdims=['origin', 'dest'],\n",
29522952
" vdims=['passengers', 'origin_city_name', 'dest_city_name', 'mail', 'freight']\n",
29532953
")"
29542954
]
@@ -3162,7 +3162,7 @@
31623162
"<p>The result can be interacted with after displaying it, but it works best in the notebook &ndash; the GIF below shows some example interactions. Note that for this visualization the interactivity is what makes it useful:</p>\n",
31633163
"\n",
31643164
"<div style=\"text-align: center;\">\n",
3165-
" <img width=\"50%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/chord.gif\" style=\"border: 5px solid #555; min-width: 500px;\">\n",
3165+
" <img width=\"50%\" src=\"../slides/media/chord.gif\" style=\"border: 5px solid #555; min-width: 500px;\">\n",
31663166
"</div>"
31673167
]
31683168
},
@@ -3181,7 +3181,7 @@
31813181
"For our final visualization, we will create a **Sankey plot**, which is a way to visualize flow as edges between nodes. Here, we will use it to analyze airline market share for passenger service flights between the top 5 US cities:\n",
31823182
"\n",
31833183
"<div style=\"text-align: center;\">\n",
3184-
" <img width=\"50%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/sankey.png\" style=\"border: 5px solid #555; min-width: 600px;\">\n",
3184+
" <img width=\"50%\" src=\"../slides/media/sankey.png\" style=\"border: 5px solid #555; min-width: 600px;\">\n",
31853185
"</div>"
31863186
]
31873187
},
@@ -3605,7 +3605,7 @@
36053605
],
36063606
"source": [
36073607
"carrier_edges = get_edges(\n",
3608-
" domestic_passenger_travel, \n",
3608+
" domestic_passenger_travel,\n",
36093609
" source_col='region',\n",
36103610
" target_col='unique_carrier_name'\n",
36113611
").replace('^Domestic$', 'Top Routes', regex=True)\n",
@@ -3806,11 +3806,11 @@
38063806
"outputs": [],
38073807
"source": [
38083808
"sankey = hv.Sankey(\n",
3809-
" all_edges, \n",
3809+
" all_edges,\n",
38103810
" kdims=['source', 'target'],\n",
38113811
" vdims=hv.Dimension('passengers', unit='M')\n",
38123812
").opts(\n",
3813-
" labels='index', label_position='right', cmap='Set1', # node config \n",
3813+
" labels='index', label_position='right', cmap='Set1', # node config\n",
38143814
" edge_color='lightgray', # edge config\n",
38153815
" width=750, height=600, # plot size config\n",
38163816
" title='Travel Between the Top 5 Cities in 2019'\n",
@@ -3951,7 +3951,7 @@
39513951
"<p>The resulting visualization can be interacted with after displaying it, but it works best in the notebook. Here's an example:</p>\n",
39523952
"\n",
39533953
"<div style=\"text-align: center;\">\n",
3954-
" <img width=\"50%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/sankey.gif\" style=\"border: 5px solid #555; min-width: 700px;\">\n",
3954+
" <img width=\"50%\" src=\"../slides/media/sankey.gif\" style=\"border: 5px solid #555; min-width: 700px;\">\n",
39553955
"</div>"
39563956
]
39573957
},

slides/3-interactivity.ipynb

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@
12641264
"<p>The interactivity works best in a notebook environment &ndash; here's an example of the slider, tooltips, and zoom/pan functionality in action:</p>\n",
12651265
"\n",
12661266
"<div style=\"text-align: center;\">\n",
1267-
" <img width=\"50%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/interactive_map.gif\" style=\"border: 5px solid #555; min-width: 600px;\">\n",
1267+
" <img width=\"50%\" src=\"media/interactive_map.gif\" style=\"border: 5px solid #555; min-width: 600px;\">\n",
12681268
"</div>"
12691269
]
12701270
},
@@ -2268,7 +2268,7 @@
22682268
"<p>The result can be interacted with after displaying it, but this kind of interactivity only works in the notebook. Here's an example:</p>\n",
22692269
"\n",
22702270
"<div style=\"text-align: center;\">\n",
2271-
" <img alt=\"Linked plots example\" width=\"60%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/linked_plots.gif\" style=\"border: 5px solid #555; min-width: 800px; margin: 0px auto;\">\n",
2271+
" <img alt=\"Linked plots example\" width=\"60%\" src=\"media/linked_plots.gif\" style=\"border: 5px solid #555; min-width: 800px; margin: 0px auto;\">\n",
22722272
" <br/>\n",
22732273
" <small><em>This example uses tabs to display the layout rather than side by side like we did. Tabs are a little buggy in this version, so we didn't use them.</em></small>\n",
22742274
"</div>"
@@ -3309,7 +3309,7 @@
33093309
"metadata": {},
33103310
"source": [
33113311
"<div style=\"text-align: center;\">\n",
3312-
" <img width=\"50%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/solution-3-1.gif\" style=\"border: 5px solid #555; min-width: 700px;\">\n",
3312+
" <img width=\"50%\" src=\"media/solution-3-1.gif\" style=\"border: 5px solid #555; min-width: 700px;\">\n",
33133313
"</div>"
33143314
]
33153315
},
@@ -3353,7 +3353,7 @@
33533353
},
33543354
"source": [
33553355
"<div style=\"text-align: center;\">\n",
3356-
" <img width=\"75%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/sankey_and_chord.png\" style=\"min-width: 750px\">\n",
3356+
" <img width=\"75%\" src=\"media/sankey_and_chord.png\" style=\"min-width: 750px\">\n",
33573357
"</div>"
33583358
]
33593359
},
@@ -3384,12 +3384,12 @@
33843384
"flight_stats = pd.read_csv(\n",
33853385
" '../data/T100_MARKET_ALL_CARRIER.zip',\n",
33863386
" usecols=[\n",
3387-
" 'CLASS', 'REGION', 'UNIQUE_CARRIER_NAME', 'ORIGIN_CITY_NAME', 'ORIGIN', \n",
3387+
" 'CLASS', 'REGION', 'UNIQUE_CARRIER_NAME', 'ORIGIN_CITY_NAME', 'ORIGIN',\n",
33883388
" 'DEST_CITY_NAME', 'DEST', 'PASSENGERS', 'FREIGHT', 'MAIL'\n",
33893389
" ]\n",
33903390
").rename(lambda x: x.lower(), axis=1).assign(\n",
33913391
" region=lambda x: x.region.replace({\n",
3392-
" 'D': 'Domestic', 'I': 'International', 'A': 'Atlantic', \n",
3392+
" 'D': 'Domestic', 'I': 'International', 'A': 'Atlantic',\n",
33933393
" 'L': 'Latin America', 'P': 'Pacific', 'S': 'System'\n",
33943394
" }),\n",
33953395
" route=lambda x: np.where(\n",
@@ -3594,7 +3594,7 @@
35943594
"source": [
35953595
"cities = [\n",
35963596
" 'Atlanta, GA', 'Chicago, IL', 'New York, NY', 'Los Angeles, CA',\n",
3597-
" 'Dallas/Fort Worth, TX', 'Denver, CO', 'Houston, TX', \n",
3597+
" 'Dallas/Fort Worth, TX', 'Denver, CO', 'Houston, TX',\n",
35983598
" 'San Francisco, CA', 'Seattle, WA', 'Orlando, FL'\n",
35993599
"]\n",
36003600
"\n",
@@ -3621,7 +3621,7 @@
36213621
"A **chord diagram** is a way of showing many-to-many relationships between a set of entities called **nodes**: the nodes are arranged in a circle, and chords (which can be thought of as **edges**) are drawn between those that are connected, with the width of the chord encoding the strength of the connection. In this section, we will be making a chord diagram for total passenger service travel between the top 10 cities in 2019:\n",
36223622
"\n",
36233623
"<div style=\"text-align: center;\">\n",
3624-
" <img width=\"35%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/chord.png\" style=\"border: 5px solid #555; min-width: 350px\">\n",
3624+
" <img width=\"35%\" src=\"media/chord.png\" style=\"border: 5px solid #555; min-width: 350px\">\n",
36253625
"</div>"
36263626
]
36273627
},
@@ -3891,7 +3891,7 @@
38913891
"source": [
38923892
"chord = hv.Chord(\n",
38933893
" total_flight_stats,\n",
3894-
" kdims=['origin', 'dest'], \n",
3894+
" kdims=['origin', 'dest'],\n",
38953895
" vdims=['passengers', 'origin_city_name', 'dest_city_name', 'mail', 'freight']\n",
38963896
")"
38973897
]
@@ -4105,7 +4105,7 @@
41054105
"<p>The result can be interacted with after displaying it, but it works best in the notebook &ndash; the GIF below shows some example interactions. Note that for this visualization the interactivity is what makes it useful:</p>\n",
41064106
"\n",
41074107
"<div style=\"text-align: center;\">\n",
4108-
" <img width=\"50%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/chord.gif\" style=\"border: 5px solid #555; min-width: 500px;\">\n",
4108+
" <img width=\"50%\" src=\"media/chord.gif\" style=\"border: 5px solid #555; min-width: 500px;\">\n",
41094109
"</div>"
41104110
]
41114111
},
@@ -4126,7 +4126,7 @@
41264126
"For our final visualization, we will create a **Sankey plot**, which is a way to visualize flow as edges between nodes. Here, we will use it to analyze airline market share for passenger service flights between the top 5 US cities:\n",
41274127
"\n",
41284128
"<div style=\"text-align: center;\">\n",
4129-
" <img width=\"50%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/sankey.png\" style=\"border: 5px solid #555; min-width: 600px;\">\n",
4129+
" <img width=\"50%\" src=\"media/sankey.png\" style=\"border: 5px solid #555; min-width: 600px;\">\n",
41304130
"</div>"
41314131
]
41324132
},
@@ -4550,7 +4550,7 @@
45504550
],
45514551
"source": [
45524552
"carrier_edges = get_edges(\n",
4553-
" domestic_passenger_travel, \n",
4553+
" domestic_passenger_travel,\n",
45544554
" source_col='region',\n",
45554555
" target_col='unique_carrier_name'\n",
45564556
").replace('^Domestic$', 'Top Routes', regex=True)\n",
@@ -4751,11 +4751,11 @@
47514751
"outputs": [],
47524752
"source": [
47534753
"sankey = hv.Sankey(\n",
4754-
" all_edges, \n",
4754+
" all_edges,\n",
47554755
" kdims=['source', 'target'],\n",
47564756
" vdims=hv.Dimension('passengers', unit='M')\n",
47574757
").opts(\n",
4758-
" labels='index', label_position='right', cmap='Set1', # node config \n",
4758+
" labels='index', label_position='right', cmap='Set1', # node config\n",
47594759
" edge_color='lightgray', # edge config\n",
47604760
" width=750, height=600, # plot size config\n",
47614761
" title='Travel Between the Top 5 Cities in 2019'\n",
@@ -4896,7 +4896,7 @@
48964896
"<p>The resulting visualization can be interacted with after displaying it, but it works best in the notebook. Here's an example:</p>\n",
48974897
"\n",
48984898
"<div style=\"text-align: center;\">\n",
4899-
" <img width=\"50%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/sankey.gif\" style=\"border: 5px solid #555; min-width: 700px;\">\n",
4899+
" <img width=\"50%\" src=\"media/sankey.gif\" style=\"border: 5px solid #555; min-width: 700px;\">\n",
49004900
"</div>"
49014901
]
49024902
},
@@ -5861,7 +5861,7 @@
58615861
"metadata": {},
58625862
"source": [
58635863
"<div style=\"text-align: center;\">\n",
5864-
" <img width=\"50%\" src=\"https://raw.githubusercontent.com/stefmolin/python-data-viz-workshop/main/media/solution-3-2.gif\" style=\"border: 5px solid #555; min-width: 700px;\">\n",
5864+
" <img width=\"50%\" src=\"media/solution-3-2.gif\" style=\"border: 5px solid #555; min-width: 700px;\">\n",
58655865
"</div>"
58665866
]
58675867
},
@@ -5941,7 +5941,7 @@
59415941
"*All examples herein were developed exclusively for this workshop &ndash; be sure to check out my book, [Hands-On Data Analysis with Pandas](https://www.amazon.com/Hands-Data-Analysis-Pandas-visualization-dp-1800563450/dp/1800563450/), and my [pandas workshop](https://stefaniemolin.com/workshops/pandas-workshop/) for more Python data science content.*\n",
59425942
"\n",
59435943
"<div style=\"text-align: center;\">\n",
5944-
" <img width=\"20%\" src=\"https://raw.githubusercontent.com/stefmolin/Hands-On-Data-Analysis-with-Pandas-2nd-edition/master/_img/pandas_drawing.PNG\" style=\"min-width: 200px\">\n",
5944+
" <img width=\"20%\" src=\"media/pandas_drawing.png\" style=\"min-width: 200px\">\n",
59455945
" <div><small>\n",
59465946
" <a href=\"https://stefaniemolin.com\">stefaniemolin.com</a>\n",
59475947
" </small></div>\n",
File renamed without changes.
File renamed without changes.

slides/media/pandas_drawing.png

176 KB
Loading

0 commit comments

Comments
 (0)