Skip to content

Commit 583d0c5

Browse files
Proof reading: python for data analysis plotly
1 parent 055eb03 commit 583d0c5

File tree

2 files changed

+75
-27
lines changed

2 files changed

+75
-27
lines changed

individual_modules/python_for_data_analysis/data-analysis-plotly.ipynb

Lines changed: 73 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
"- Learn how to import and use Plotly and Plotly Express\n",
1616
"- Understand the differences between Plotly and other visualisation libraries like Matplotlib and Seaborn\n",
1717
"- Create bar plots, scatter plots, and box plot using Plotly\n",
18-
"- Customize plots with tiles, axis labels, and colors\n",
18+
"- Customize plots with titles, axis labels, and colours\n",
1919
"- Visualize geospatial data on scatter plots and choropleth maps\n",
20-
"- Use pandas data frames to feed data into Plotly visualization \n",
20+
"- Use Pandas data frames to feed data into Plotly visualization \n",
2121
"\n",
2222
"## Overview\n",
23-
"There are many different plotting libraries for Python, including matplotlib, Plotly, Bokeh, Seaborn, and many more. Matplotlib is worth learning, as it is commonly used in academic settings for creating report-ready plots. However, some of the other plotting libraries, such as Plotly and Seaborn, provide a convenient way of creating interactive and visually plots.\n",
23+
"There are many different plotting libraries for Python, including Matplotlib, Plotly, Bokeh, Seaborn, and many more. Matplotlib is worth learning, as it is commonly used in academic settings for creating report-ready plots. However, some of the other plotting libraries, such as Plotly and Seaborn, provide a convenient way of creating interactive and visual plots.\n",
2424
"In this example, we will load the hills data set as before. This is the `The Database of British and Irish Hills v18` and is freely available under a Creative Commons Attribution 4 License, at `https://www.hills-database.co.uk/downloads.html`. This data set contains grid reference information for peaks, hills, and cols in Britain. "
2525
]
2626
},
@@ -62,8 +62,8 @@
6262
},
6363
"source": [
6464
"* We can use Plotly Express, which is just Plotly with reasonable default values, to get started very quickly.\n",
65-
"* First lets reproduce the matplotlib bar plot example we saw previously.\n",
66-
"* We will need to install Plotly in our virtual environment"
65+
"* First, let's reproduce the Matplotlib bar plot example we saw previously.\n",
66+
"* We will need to install Plotly in our virtual environment."
6767
]
6868
},
6969
{
@@ -131,7 +131,7 @@
131131
"tags": []
132132
},
133133
"source": [
134-
"* Lets recreate the scatter plot of the (lat, lon) data in Plotly."
134+
"* Let's recreate the scatter plot of the (lat, lon) data in Plotly."
135135
]
136136
},
137137
{
@@ -168,7 +168,7 @@
168168
"tags": []
169169
},
170170
"source": [
171-
"* Lets make the marker size smaller"
171+
"* Let's make the marker size smaller."
172172
]
173173
},
174174
{
@@ -199,9 +199,15 @@
199199
},
200200
{
201201
"cell_type": "markdown",
202-
"metadata": {},
202+
"metadata": {
203+
"editable": true,
204+
"slideshow": {
205+
"slide_type": ""
206+
},
207+
"tags": []
208+
},
203209
"source": [
204-
"* And change the opacity"
210+
"* And change the opacity."
205211
]
206212
},
207213
{
@@ -227,9 +233,15 @@
227233
},
228234
{
229235
"cell_type": "markdown",
230-
"metadata": {},
236+
"metadata": {
237+
"editable": true,
238+
"slideshow": {
239+
"slide_type": ""
240+
},
241+
"tags": []
242+
},
231243
"source": [
232-
"* Lets colour the points not by country, but by their height. This is a continuous variable, so a continuous colour scale should work well."
244+
"* Let's colour the points not by country, but by their height. This is a continuous variable, so a continuous colour scale should work well."
233245
]
234246
},
235247
{
@@ -282,9 +294,15 @@
282294
},
283295
{
284296
"cell_type": "markdown",
285-
"metadata": {},
297+
"metadata": {
298+
"editable": true,
299+
"slideshow": {
300+
"slide_type": ""
301+
},
302+
"tags": []
303+
},
286304
"source": [
287-
"* Lets filter our data to include only hills above 950 metres before plotting."
305+
"* Let's filter our data to include only hills above 950 metres before plotting."
288306
]
289307
},
290308
{
@@ -312,9 +330,15 @@
312330
},
313331
{
314332
"cell_type": "markdown",
315-
"metadata": {},
333+
"metadata": {
334+
"editable": true,
335+
"slideshow": {
336+
"slide_type": ""
337+
},
338+
"tags": []
339+
},
316340
"source": [
317-
"* This isnt ideal, however. We have plotted (lat, lon) coordinates without considering the map projection. We can do a bit than than."
341+
"* This isn't ideal, however. We have plotted (lat, lon) coordinates without considering the map projection."
318342
]
319343
},
320344
{
@@ -361,9 +385,15 @@
361385
},
362386
{
363387
"cell_type": "markdown",
364-
"metadata": {},
388+
"metadata": {
389+
"editable": true,
390+
"slideshow": {
391+
"slide_type": ""
392+
},
393+
"tags": []
394+
},
365395
"source": [
366-
"* Lets add some boundary information."
396+
"* Let's add some boundary information."
367397
]
368398
},
369399
{
@@ -399,10 +429,16 @@
399429
},
400430
{
401431
"cell_type": "markdown",
402-
"metadata": {},
432+
"metadata": {
433+
"editable": true,
434+
"slideshow": {
435+
"slide_type": ""
436+
},
437+
"tags": []
438+
},
403439
"source": [
404-
"* There are a few more counties in the geojson file than the hill count database. This could be due to name mis-matches/incorrect labelling, or because hills are not present in certain county regions. \n",
405-
"* For now, lets just count the number of hills that are labelled correctly in the database. We will then colour based on the count of the hills in the region."
440+
"* There are a few more counties in the GeoJSON file than the hill count database. This could be due to name mis-matches/incorrect labelling, or because hills are not present in certain county regions. \n",
441+
"* For now, let's just count the number of hills that are labelled correctly in the database. We will then colour based on the count of the hills in the region."
406442
]
407443
},
408444
{
@@ -449,11 +485,17 @@
449485
},
450486
{
451487
"cell_type": "markdown",
452-
"metadata": {},
488+
"metadata": {
489+
"editable": true,
490+
"slideshow": {
491+
"slide_type": ""
492+
},
493+
"tags": []
494+
},
453495
"source": [
454-
"* This is fine, but we can do better. Lets find the average hill height for the regions.\n",
496+
"* This is fine, but we can do better. Let's find the average hill height for the regions.\n",
455497
"* We can get the average height from the main database.\n",
456-
"* We dont need to loop through the geojson any more, as we have the keys in the new `hill_count_df`."
498+
"* We don't need to loop through the GeoJSON any more, as we have the keys in the new `hill_count_df`."
457499
]
458500
},
459501
{
@@ -491,9 +533,15 @@
491533
},
492534
{
493535
"cell_type": "markdown",
494-
"metadata": {},
536+
"metadata": {
537+
"editable": true,
538+
"slideshow": {
539+
"slide_type": ""
540+
},
541+
"tags": []
542+
},
495543
"source": [
496-
"* Lets add a Country field to the `hill_count_df` we just made, in case we want to plot just the hills in a particular country."
544+
"* Let's add a Country field to the `hill_count_df` we just made, in case we want to plot just the hills in a particular country."
497545
]
498546
},
499547
{

individual_modules/python_for_data_analysis/questions/summary_plotly.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
]
2727
},
2828
{
29-
"question": "When using Plotly to create a bar plot, which aprameter defines the orientation of the bars?",
29+
"question": "When using Plotly to create a bar plot, which parameter defines the orientation of the bars?",
3030
"type": "many_choice",
3131
"answers": [
3232
{
@@ -52,7 +52,7 @@
5252
]
5353
},
5454
{
55-
"question": "What is the primary purpose of using Plotly express?",
55+
"question": "What is the primary purpose of using Plotly Express?",
5656
"type": "many_choice",
5757
"answers": [
5858
{

0 commit comments

Comments
 (0)