COM6018 Data Science with Python

Week 2: Reading and Writing Data Files

Varvara Papazoglou

Copyright © 2023–2026 Varvara Papazoglou & Jon Barker, University of Sheffield. All rights reserved.
COM6018 Data Science with Python

In this lab

  • Reading datasets from CSV files
  • Prepare data for analysis
  • Combining data from different dataset
  • We will use pure Python (i.e., no 3rd party packages)...
    • This will help us understand the benefits of the Pandas package!
Copyright © 2023–2026 Varvara Papazoglou & Jon Barker, University of Sheffield. All rights reserved.
COM6018 Data Science with Python

Today's Lab

If you have cloned the module's GitHub repository, then you should see:

materials/labs/
├── 000_Introduction.md
├── 010_python_intro.ipynb
├── 020_reading_data.ipynb
├── data
│   ├── Mine_Dataset.xls
│   ├── ch4.csv
│   └─– co2.csv

The lab is 020_reading_data.ipynb and it will need the files data/ch4.csv and data/co2.csv.

Alternatively, you can download the notebook and data via links on Blackboard. (Click on 'Learning Materials' then 'Week 2').

Copyright © 2023–2026 Varvara Papazoglou & Jon Barker, University of Sheffield. All rights reserved.