Skip to content
Skip to main content
  • The Open University
  • Accessibility hub
  • Guest user / Sign out
  • Study with The Open University
  • Accessibility hub
Close We have temporarily suspended the ability to edit OpenLearn profiles while we investigate an issue. We apologise for the inconvenience.
  • The Open University
  • Accessibility hub
  • Guest user / Sign out
  • Study with The Open University
  • Accessibility hub
Close We have temporarily suspended the ability to edit OpenLearn profiles while we investigate an issue. We apologise for the inconvenience.
header search
  • Home
  • Free courses
    • All our free courses
    • Badged courses
    • Why study a free course on OpenLearn?
    • Advantages of enrolling on a free course
    • Frequently asked questions
    • Study with The Open University
  • Subjects
  • Study skills
  • Work skills
  • Help
  • Accessibility hub
  • Sign in
Create account / Sign in
ahihi OpenLearn
  • The Open University
  • Accessibility hub
  • Guest user / Sign out
  • Study with The Open University
  • Accessibility hub
Close We have temporarily suspended the ability to edit OpenLearn profiles while we investigate an issue. We apologise for the inconvenience.
OpenLearn
  • Home
  • Free courses
    • All our free courses
    • Badged courses
    • Why study a free course on OpenLearn?
    • Advantages of enrolling on a free course
    • Frequently asked questions
    • Study with The Open University
  • Subjects
  • Study skills
  • Work skills
  • Help
  • Accessibility hub
  • Sign in
Menu
sticky search

My OpenLearn Profile

Personalise your OpenLearn profile, save your favourite content and get recognition for your learning

Create account / Sign in
  • Subjects
  • Digital & Computing
  • Free courses
  • Learn to code for data analysis
Free course

Learn to code for data analysis

Free statement of participation on completion
Learn to code for data analysis Copyright free Icon
Learn to code for data analysis
More about this course

Course description

Course content

Course reviews

Please note: Learners have reported issues with the software and quizzes within this course.

Software and data make the world go round. Learn programming, to analyse and visualise open data, with this free course, Learn to code for data analysis.

This course will teach you how to write your own computer programs, one line of code at a time. You'll learn how to access open data, clean and analyse it, and produce visualisations. You will also learn how to write up and share your analyses, privately or publicly.

You'll code in Python, a widely used programming language across all disciplines.

You will write up analyses and do coding exercises using the popular Jupyter Notebooks platform, which allows you to see immediately the result of running your code and helps you identify – and fix – any errors more easily.

You will also look at real data from the World Health Organisation, the World Bank and other organisations.

Transcript

Enrolling in the course will give you the opportunity to earn an Open University digital badge. Badges are not accredited by The Open University but they're a great way to demonstrate your interest in the subject and commitment to your career and to provide continuing professional development. 

Once you're signed in, you can manage your digital badges online from My OpenLearn. In addition, you can download and print your OpenLearn Statement of Participation – which also displays your Open University badge.

The Open University would appreciate a few minutes of your time to tell us about yourself and your expectations for the course before you begin, in our optional start-of-course survey . Once you complete the course we would also value your feedback and suggestions for future improvement, in our optional end-of-course survey . Participation will be completely confidential and we will not pass on your details to others.

This course is accredited by the CPD Standards Office . It can be used to provide evidence of continuing professional development and on successful completion of the course you will be awarded 24 CPD points. Evidence of your CPD achievement is provided on the free Statement of Participation awarded on completion.

Anyone wishing to provide evidence of their enrolment on this course is able to do so by sharing their Activity Record on their OpenLearn Profile, which is available before completion of the course and earning of the Statement of Participation.

Learn to code for data analysis

Earn this free Open University digital badge if you complete this course! The badge can be displayed, shared and downloaded as a marker of your achievement. The badge is awarded for completing the course and passing the quizzes.

Course learning outcomes

After studying this course, you should be able to:

  • understand basic programming and data analysis concepts
  • recognise open data sources as a public resource
  • use a programming environment to develop programs
  • write simple programs to analyse large bodies of data and produce useful results.
Enter course

First Published: 15/10/2018

Updated: 20/01/2020

  • Week1
  • Week2
  • Week3
  • Week4
  • Week5
  • Week6
  • Week7
  • Week8

You can start this course right now without signing-up. Click on any of the course content sections below to start at any point in this course.
If you want to be able to track your progress, earn a free Statement of Participation, and access all course quizzes and activities, sign-up.

Course content

  • Introduction and guidance
    • Current section:
      Introduction and guidance

      Welcome to this badged open course, Learn to code for data analysis.The free course lasts eight weeks, with approximately three hours of study each week. You can work through the course at your own pace, so if you have more time one week there is no problem with pushing on to complete another week’s study.This course will teach you how to write your own computer programs, one line of code at a time. You'll learn how to access open data, clean and analyse it, and produce visualisations. You ...

    • What is a badged course?
    • How to get a badge
    • Acknowledgements
  • Week1Week 1: Having a go at it Part 1
    • Current section:
      Introduction

      Please note: A number of learners have reported issues with the software and quizzes within this course. We will be carrying out a review and updating the material where necessary. Additionally, a link to a supplementary FAQs page will be added here soon.Welcome to Learn to code for data analysis! This course has been written to show how a little bit of code can go a long way in making sense of the increasingly vast amounts of open data available online.If you’re used to the manual approach ...

    • 1 Install the software
      • 1.1 Start with a question
      • 1.2 Variables and assignments
      • 1.3 The art of naming
      • 1.4 Downloading the notebook and trying the first exercise
      • 1.5 Expressions
      • 1.6 Functions
      • 1.7 Comments
      • 1.8 Values have units
    • 2 This week’s quiz
    • 3 Summary
    • Acknowledgements
    • Week 1 practice quiz
  • Week2Week 2: Having a go at it Part 2
    • Current section:
      1 Enter the pandas

      As you probably realised, this way of coding is not practical for large scale data analysis.Three lines of code were required for each country, to store the number of deaths, store the population, and calculate the death rate. With roughly 200 countries in the world, my trivial analysis would require 400 variables and typing almost 600 lines of code! Life’s too short to be spent that way.Instead of using a separate variable for each datum, it is better to organise data as a table of rows and...

      • 1.1 This week’s data
      • 1.2 Loading the data
      • 1.3 Selecting a column
      • 1.4 Calculations on a column
      • 1.5 Sorting on a column
      • 1.6 Calculations over columns
    • 2 Writing up the analysis
      • 2.1 Practice project
      • 2.2 Sharing your project notebook
    • 3 This week’s quiz
    • 4 Summary
      • 4.1 Week 1 and 2 glossary
    • Acknowledgements
    • Week 2 practice quiz
  • Week3Week 3: Cleaning up our act Part 1
    • Current section:
      Introduction

      Welcome to Week 3.Please note: in the following video, where reference is made to a study ‘week’, this corresponds to Weeks 3 and 4 of this course.In Week 1 and 2 you worked on a dataset that combined two different World Health Organization datasets: population and the number of deaths due to tuberculosis.They could be combined because they share a common attribute: the countries. This week you will learn the techniques behind the creation of such a combined dataset.

    • 1 Weather data
      • 1.1 What is a CSV file?
      • 1.2 Dataframes and the ‘dot’ notation
      • 1.3 Getting and displaying dataframe rows
      • 1.4 Getting and displaying dataframe columns
      • 1.5 Comparison operators
      • 1.6 Bitwise operators
    • 2 This week’s quiz
    • 3 Summary
    • Acknowledgements
    • Week 3 practice quiz
  • Week4Week 4: Cleaning up our act Part 2
    • Current section:
      1 Loading the weather data

      You have learned some more about Python and the pandas module and tried it out on a fairly small dataset. You are now ready to explore a dataset from the Weather Underground.Open the file London_2014.csv and save it in the disk folder or CoCalc project you created in Week 1.Do not be tempted to open this file with Excel as this application will attempt to localise the data in the file, i.e. use your country’s local data formats, which will make much of what follows rather incomprehensible! ...

      • 1.1 Removing rogue spaces
      • 1.2 Removing extra characters
      • 1.3 Missing values
      • 1.4 Changing the value types of columns
    • 2 Every picture tells a story
      • 2.1 Changing a dataframe’s index
      • 2.2 The project
    • 3 This week’s quiz
    • 4 Summary
    • 4.1 Week 4 glossary
    • Acknowledgements
    • Week 4 compulsory badge quiz
  • Week5Week 5: Combine and transform data Part 1
    • Current section:
      Introduction

      Welcome to Week 5. Please note: in the following video, where reference is made to a study ‘week’, this corresponds to Weeks 5 and 6 of this course.In Week 1 you worked on a dataset that combined two different World Health Organization datasets: population and the number of deaths due to tuberculosis.They could be combined because they share a common attribute: the countries. This week you will learn the techniques behind the creation of such a combined dataset.

    • 1 Life expectancy project
      • 1.1 Creating the data
      • 1.2 Defining functions
      • 1.3 What if...?
      • 1.4 Applying functions
    • 2 This week’s quiz
    • 3 Summary
    • Acknowledgements
    • Week 5 practice quiz
  • Week6Week 6: Combine and transform data Part 2
    • Current section:
      1 Joining left, right and centre

      Let’s take stock for a moment. There’s the original, unchanged table (with full country names) about the life expectancy: In []: life Out[]: Country nameLife expectancy (years)0China751Russia712United States793India664United Kingdom81… and a table with the GDP in millions of pounds and also full country names. In []: gdp Out[]: Country nameGDP (£m)0United Kingdom17117271United States107160292China59052023Brazil14351484South Africa233937Both tables have a common column with a common name ...

      • 1.1 Constant variables
      • 1.2 Getting real
      • 1.3 Cleaning up
      • 1.4 Joining and transforming
    • 2 Correlation
      • 2.1 Scatterplots
      • 2.2 My project
    • 3 This week’s quiz
    • 4 Summary
      • 4.1 Weeks 5 and 6 glossary
    • Acknowledgements
    • Week 6 practice quiz
  • Week7Week 7: Further techniques Part 1
    • Current section:
      Introduction

      Welcome to Week 7 Please note: in the following video, where reference is made to a study ‘week’, this corresponds to Weeks 7 and 8 of this course.In Week 6 you saw how to merge two datasets containing a common column to create a single, combined dataset. Combining datasets allows us to make comparisons across datasets, as you discovered when looking for correlations between GDP and life expectancy.This week, you’ll learn how to go the other way, separating out distinct ‘subsets’ or groups ...

    • 1 I spy with my little eye
      • 1.1 Ways of grouping data
      • 1.2 Data that describes the world of trade
      • 1.3 Exploring the world of export data
      • 1.4 Getting data from the Comtrade API
      • 1.5 Practice getting data
    • 2 This week’s quiz
    • 3 Summary
    • Acknowledgements
    • Week 7 practice quiz
  • Week8Week 8: Further techniques Part 2
    • Current section:
      1 The split-apply-combine pattern

      In the exercise in Week 7, you downloaded data from Comtrade that could be described as ‘heterogenous’ or mixed in some way. For example, the same dataset contained information relating to both imports and exports.To find the partner countries with the largest trade value in terms of exports means filtering the dataset to obtain just the rows containing export data and then ranking those. Finding the largest import partner requires a sort on just the import data.But what if you wanted to ...

      • 1.1 Splitting a dataset by grouping
      • 1.2 Looking at apply and combine operations
      • 1.3 Summary operations
      • 1.4 Filtering groups
    • 2 Pivot tables
      • 2.1 Pivot tables in pandas
      • 2.2 Looking at the milk and cream trade
      • 2.3 Your project
    • 3 This week’s quiz
    • 4 Summary
      • 4.1 Week 7 and 8 glossary
      • 4.2 What next?
    • Tell us what you think
    • Acknowledgements
    • Week 8 compulsory badge quiz
Expand all course content
Skip Rate and Review

Rate and Review

Rate this course

1 2 3 4 5
Average rating 3.5 out of 5, based on 77 ratings.

Review this course

Log into OpenLearn to leave reviews and join in the conversation.

Course reviews

  • Alfha Hikmah
    Alfha Hikmah 8 May 2025 6:18PM
    1 2 3 4 5
    Rating entered.
    This is a great course as I gain more knowledge from it
    Flag As Offensive
  • Joseph Francis
    Joseph Francis 27 April 2025 6:14PM
    1 2 3 4 5
    Rating entered.
    first quiz's are totally off and the descriptions are totally bonkers to follow. its like reading riddles
    Flag As Offensive
More reviews Total 50 reviews

Your course resources

As you work through this course you will need various resources to help you complete some of the activities.

  • Beijing_PEK_2014.csv File
    Download Resource
  • Brasilia_BSB_2014.csv File
    Download Resource
  • CapeTown_CPT_2014.csv File
    Download Resource
  • Delhi_DEL_2014.csv File
    Download Resource
  • Moscow_SVO_2014.csv File
    Download Resource
  • Week 1 exercise notebook File
    Download Resource
  • Week 1 project notebook File
    Download Resource
  • WHO POP TB all.xls File
    Download Resource
  • WHO POP TB some.xls File
    Download Resource
  • WHO POP TB all.csv File
    Download Resource
  • Week 2 exercise notebook File
    Download Resource
  • Week 2 project notebook File
    Download Resource
  • Week 3 exercise notebook File
    Download Resource
  • Week 3 project notebook File
    Download Resource
  • Week 4 exercise notebook File
    Download Resource
  • Week 4 project notebook File
    Download Resource
  • WB GDP 2013.csv File
    Download Resource
  • WB LE 2013.csv File
    Download Resource
  • WB POP 2013.csv File
    Download Resource
  • test_installation.ipynb File
    Download Resource
  • Introduction and guidance SC Web Editor
  • thumbnail image File

Create an account to get more

  • Track your progress

    Review and track your learning through your OpenLearn Profile.

  • Statement of Participation

    On completion of a course you will earn a Statement of Participation.

  • Access all course activities

    Take course quizzes and access all learning.

  • Review the course

    When you have finished a course leave a review and tell others what you think.

Create account / Sign in

Copyright information

creative commons licence type by-nc Creative commons: The Open University is proud to release this free course under a Creative Commons licence.

However, any third-party materials featured within it are used with permission and are not ours to give away. These materials are not subject to the Creative Commons licence. See terms and conditions377  and our FAQs378.

Full copyright details can be found in the Acknowledgements section of each week.

Additional course description image copyright

  • Image No description available - CPD Standards Office (CPD provider: 21590)

For further information, take a look at our frequently asked questions which may give you the support you need.

Have a question?
LCDAB_1
Take your learning further

Ready to take the next step in your learning journey?
With over 50 years of experience in distance learning, The Open University brings flexible, trusted education to you, wherever you are. If you’re new to university-level study, read our guide on Where to take your learning next.

Join over 2 million students who’ve reached their goals with us.

Browse all Open University courses and start your journey today.

About this free course

About this free course

24 hours study

Level 1: Introductory

Skip Ratings

Ratings

Ratings

1 2 3 4 5
3.5 out of 5 stars

Create an account to
get more

Create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

Create account / Sign in

Become an OU student

Become an OU student

  • BSc (Honours) Computing and IT
    BSc (Honours) Computing and IT
  • BA/BSc (Honours) Open degree
    BA/BSc (Honours) Open degree
  • BSc (Honours) Data Science
    BSc (Honours) Data Science

Download this course

Download this course

Download this course for use offline or for other devices

  • WordWord
  • MobiKindle
  • PrintablePDF
  • EpubEpub 2
  • Epub3Epub 3
  • RssRSS
  • HtmlHTML
  • OuxmlOUXML File
  • ImsccIMS CC
  • OuxmlpackageOUXML Pckg
See more formatsShow fewer formats

Share this free course

Share this free course

Share on Facebook Share on Twitter Share on LinkedIn Share via Email

Course rewards

Free statement of participation on completion of these courses.

Badge icon

Earn a free Open University digital badge if you complete this course, to display and share your achievement.

Newsletter

Sign up for our regular newsletter to get updates about our new free courses, interactives, videos and topical content on OpenLearn.

Newsletter sign-up

Back to top

footer Menu

  • About OpenLearn

    • About us
    • Frequently asked questions
    • Study with The Open University
    • Subscribe to our newsletter
    • Contact OpenLearn
    • OpenLearn Create
    • OpenLearn Cymru
  • Explore subjects

    • Money & Business
    • Education & Development
    • Health, Sports & Psychology
    • History & The Arts
    • Languages
    • Nature & Environment
    • Science, Maths & Technology
    • Society, Politics & Law
    • Digital & Computing
  • Explore resources

    • Get started
    • Latest from OpenLearn
    • Try something popular
    • Free courses
    • Study skills
    • Work skills
    • My OpenLearn Profile
    • Resources for schools

Our partners

OpenLearn works with other organisations by providing free courses and resources that support our mission of opening up educational opportunities to more people in more places.

Find out more

Support us

Policy

  • Twitter
  • Facebook
  • YouTube

©1999-2025. All rights reserved. The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority in relation to its secondary activity of credit broking.

  • Accessibility statement
  • Conditions of use
  • Privacy and cookies
  • Modern Slavery Act
  • Copyright
  • Manage cookie preferences
invalidsesskey
Your session has most likely timed out. Please check if you are logged in or go back to the previous screen and reload the page.
    Share on Facebook Share on Twitter Share on LinkedIn Share via Email