See me in action on my video explaining what I did, here:
Showing posts with label MOOCs. Show all posts
Showing posts with label MOOCs. Show all posts
Saturday, May 07, 2016
Video Presentation of my Python Project
I had to present my Python project to the other students in the MOOC, and I did this using a very nifty software called Screencast-o-matic which lets you film yourself using the webcam and also records your screen and mouse action at the same time. For free, too, in the basic version which was perfect for what I had to do.
See me in action on my video explaining what I did, here:
See me in action on my video explaining what I did, here:
Thursday, May 05, 2016
My Python Capstone Project
I've done it! I've made it all the way through the Python for Everybody MOOC by the University of Michigan with the très sympa Dr Chuck (Dr Charles Severance) at the helm who took us through the highways and byways of Python and supported us with substantially complicated scaffolding. Much needed, in my case.
The last module in the 5-part course was the Capstone where we had the opportunity to do an optional project. Always game to get the most out of things, I decided to take the bull by the horns and sign up.
For the project, we had to find a data set, 'scrape' it to find some specific information, put that into a database, and finally, visualise the results. There are data sets about many different fascinating subjects such as:
and so on. For my project however, I chose the Transport for London data set available in their Application Programming Interface (API). It provides access to real time data on the most highly requested information across all modes of transport. It also provides data on accidents across London. I wanted to find out about bicycle accidents (just because), and discover where most accidents happen. I thought it would probably be the City of London which is densely populated during the day and has high cycling activity (couriers etc.).
The first thing I had to do, I discovered, was apply for an API key giving me permission to scrape the data. Then I had to write the code, which I based on code we had seen during the course (click on the images to see them bigger and better).
This code creates the database, connects to the TfL API, asks for the year to download and inserts the longitude, latitude, severity and victim (cycle, car, motorcycle, etc.) into the database for that year. Then it saves the data and closes the connection.
It took me a few days because I wasn't sure about exactly what I needed to do - did I need to create a dictionary, or two, or none...? That's half the problem actually, for me - identifying the structure of the code you need to write for the job you want to do.
My code is really simple too. It just asks for one year, not multiple years. It assumes there are no errors in the year entered (e.g. 2016 which is not available yet). I could make it more robust, but to start with, I just wanted to make it work!
This is what the data looks like in the API:
This is what it looks like 'pretty printed':
You can see more clearly the information I wanted to download in the 'pretty printed' format.
This is what the database my code created looks like, it has 23116 rows of data:
I was astounded the first time the code worked and saw the database loaded with data. Someone I spoke to recently called the feeling a 'nerdy moment'. Never thought I'd ever have one of those, I must say!
Having got the data, I then had to write some code to select the cyclist accident set, choosing 'severe' accidents rather than fatal ones (too sad), iterating through the data, and writing the longitude and latitude locations only to a javascript file.
I was thankful to have some scaffolding to help me write that too!
Once I had the geolocation data, I then had to visualise it. I had already used some visualisation code earlier in the MOOC, so just had adapt it to visualise my data. It actually took me three days because I ran into a problem and had no idea what to do. The code was written in html, which I know nothing about. I hunted around for a solution on the internet, including that fabulous resource Stackoverflow, but couldn't find an answer.
I was stumped. Then I moaned to my DB about my problem, and he said that I should check the latitude and longitude coordinates because they might not be in the right format. And he was right! They were back-to-front in my code! Once I'd fixed that, up popped the little red labels as they should (with another nerdy moment).
These maps show the severe accidents for 2008. There were 429, and you can see from the second map that the highest concentration was indeed the City of London.
Job done!
It's been a really satisfying few months, going from being a complete Python beginner/never having touched coding before, ever, and having been crap at maths, to producing an amazing, functioning final result that I had to understand to make work (more-or-less, let's just ignore the html...). Dr Chuck was an entertaining teacher who could engage with us across a screen (no mean feat), and who even set up live 'office hours' during the Capstone so we could interact with him directly. He was aided and abetted by a team of kindly mentors who were available to help us out and give advice in the forums.
I am very happy with the results, and aim to go on and tackle C# next!
The last module in the 5-part course was the Capstone where we had the opportunity to do an optional project. Always game to get the most out of things, I decided to take the bull by the horns and sign up.
For the project, we had to find a data set, 'scrape' it to find some specific information, put that into a database, and finally, visualise the results. There are data sets about many different fascinating subjects such as:
- the last words of inmates in Texas before execution since 1984
- the "Million Base" of 2.2 million chess matches
- a Twitter data set
- World Health Organisation data set
- Family food data set
- Million Song data set
and so on. For my project however, I chose the Transport for London data set available in their Application Programming Interface (API). It provides access to real time data on the most highly requested information across all modes of transport. It also provides data on accidents across London. I wanted to find out about bicycle accidents (just because), and discover where most accidents happen. I thought it would probably be the City of London which is densely populated during the day and has high cycling activity (couriers etc.).
The first thing I had to do, I discovered, was apply for an API key giving me permission to scrape the data. Then I had to write the code, which I based on code we had seen during the course (click on the images to see them bigger and better).
This code creates the database, connects to the TfL API, asks for the year to download and inserts the longitude, latitude, severity and victim (cycle, car, motorcycle, etc.) into the database for that year. Then it saves the data and closes the connection.
It took me a few days because I wasn't sure about exactly what I needed to do - did I need to create a dictionary, or two, or none...? That's half the problem actually, for me - identifying the structure of the code you need to write for the job you want to do.
My code is really simple too. It just asks for one year, not multiple years. It assumes there are no errors in the year entered (e.g. 2016 which is not available yet). I could make it more robust, but to start with, I just wanted to make it work!
This is what the data looks like in the API:
| TfL API raw data |
This is what it looks like 'pretty printed':
| TfL API data in readable format |
This is what the database my code created looks like, it has 23116 rows of data:
| Database |
Having got the data, I then had to write some code to select the cyclist accident set, choosing 'severe' accidents rather than fatal ones (too sad), iterating through the data, and writing the longitude and latitude locations only to a javascript file.
| Code to select geolocation data |
| The geolocations of severe cycle accidents in London |
Once I had the geolocation data, I then had to visualise it. I had already used some visualisation code earlier in the MOOC, so just had adapt it to visualise my data. It actually took me three days because I ran into a problem and had no idea what to do. The code was written in html, which I know nothing about. I hunted around for a solution on the internet, including that fabulous resource Stackoverflow, but couldn't find an answer.
I was stumped. Then I moaned to my DB about my problem, and he said that I should check the latitude and longitude coordinates because they might not be in the right format. And he was right! They were back-to-front in my code! Once I'd fixed that, up popped the little red labels as they should (with another nerdy moment).
![]() |
| Great London severe accident sites |
![]() |
| Central London severe accident sites |
It's been a really satisfying few months, going from being a complete Python beginner/never having touched coding before, ever, and having been crap at maths, to producing an amazing, functioning final result that I had to understand to make work (more-or-less, let's just ignore the html...). Dr Chuck was an entertaining teacher who could engage with us across a screen (no mean feat), and who even set up live 'office hours' during the Capstone so we could interact with him directly. He was aided and abetted by a team of kindly mentors who were available to help us out and give advice in the forums.
I am very happy with the results, and aim to go on and tackle C# next!
Sunday, October 25, 2015
Useful learning with Hubspot
A few years ago (two decades to be exact - how time flies), I did a Masters in European Business Administration. The course comprised various subjects one of which was marketing. I remember I did my project and dissertation on setting up a UK food business in France. I was a tad early - there was academic interest but little hope of business success. Indeed, I"ve never bought Brit foods in a dedicated store because the prices have always been on the wrong side of my price/acceptability curve, even with high nostalgia peaks.
When I had finished my degree, I realised that it was totally inappropriate for small town Montpellier because it was aimed at large companies - the sort you find in London, Paris, Lyon... Oops. I got a job in admin instead, in a rush so I could repay the loan I'd taken out to pay for my "career-boosting" degree. Then I got pregnant and gave up the idea of a career in favour of keeping my job.
So I never got to use anything I had learned which is totally typical for me as I have never used my first degree either. I have a lot of talent in not terribly useful skills, like picking education I never get to use.
Still, it's all good intellectual effort, and I'm sure my life is the richer for it...
However, I don't believe in giving up on education, and with the arrival of MOOCs (massive open online courses), there's a world of learning out there for the taking, and mostly for free. Maybe I could even dig up a talent for useful learning, that I could put to some use!
With that in mind, I recently signed up for Hubspot's Inbound Marketing certification. Here's the blurb:
The course is made up of twelve classes that cover all aspects of Inbound through videos where it's all clearly explained, and you can download both the videos and transcripts in order to revise for the test. In order to get certified, you have to pass the test. Sixty questions to be finished in 75 minutes that you can take a maximum of three times before being locked out for one month.
I'm proud to say I got it in one and am thus Inbound Certified, and here's my badge.
When I had finished my degree, I realised that it was totally inappropriate for small town Montpellier because it was aimed at large companies - the sort you find in London, Paris, Lyon... Oops. I got a job in admin instead, in a rush so I could repay the loan I'd taken out to pay for my "career-boosting" degree. Then I got pregnant and gave up the idea of a career in favour of keeping my job.
So I never got to use anything I had learned which is totally typical for me as I have never used my first degree either. I have a lot of talent in not terribly useful skills, like picking education I never get to use.
Still, it's all good intellectual effort, and I'm sure my life is the richer for it...
However, I don't believe in giving up on education, and with the arrival of MOOCs (massive open online courses), there's a world of learning out there for the taking, and mostly for free. Maybe I could even dig up a talent for useful learning, that I could put to some use!
With that in mind, I recently signed up for Hubspot's Inbound Marketing certification. Here's the blurb:
The Inbound Course & Certification is a free marketing training course that covers the fundamentals of the Inbound Marketing Methodology. Learn how SEO, Landing Pages, Blogging, Conversion, Lead Nurturing, and Email marketing come together to form a modern inbound marketing strategy.I thought it was excellent because it is customer-centric marketing rather than the marketer-centric. So it frowns upon invasive practices such as pop-ups, unwanted emails, in-your-face spam and so on - things I personally hate. Instead you have to attract people who have a problem they want answers to, help them to find a solution, convert them into customers, close the sale, and finally delight them with the way you do business afterwards.
The course is made up of twelve classes that cover all aspects of Inbound through videos where it's all clearly explained, and you can download both the videos and transcripts in order to revise for the test. In order to get certified, you have to pass the test. Sixty questions to be finished in 75 minutes that you can take a maximum of three times before being locked out for one month.
I'm proud to say I got it in one and am thus Inbound Certified, and here's my badge.
Subscribe to:
Posts (Atom)

