Skip to content

Study Hub

Study Guides

This pupil-friendly study guide includes a unit summary, clear notes, common mistakes, and quick questions with answers.

Year 11 - Computing

Reading CSV files

Programming: dictionaries and data files

Unit Summary

This unit introduces pupils to the new data structures of records and dictionaries. They will develop a Caesar cipher encryption program using a dictionary as a cipher wheel. Pupils will explore how data can be read from and written to files and how this data can be used within a program.

Lesson Summary

You will learn to read and structure data in a CSV file.

Key Notes

  • CSV text files group data together on individual lines and separates values in these groups by commas.
  • CSV files can be read by a range of different spreadsheet software packages as well as Python files.
  • Each item is seperated by a comma, each record is seperated over a new row in the file.
  • A CSV file is the same as any other text file where each row is stored as string.

Vocabulary To Learn

  • CSV: comma-separated values are a plaintext data file where each value is separated by a single comma
  • tabular: displaying data in a grid of rows and columns
  • strip(): a Python method which removes any leading, and trailing whitespaces or characters that you specify
  • split(): a Python method which is used to break a string into a list based on a specified delimiter

Common Mistakes To Avoid

  • It is not possible to interrogate a CSV file in Python without importing a specialised library.

3 Quick Questions (With Answers)

1. Describe the system or process from this lesson in clear steps.

CSV text files group data together on individual lines and separates values in these groups by commas. CSV files can be read by a range of different spreadsheet software packages as well as Python files.

2. Define this computing term and give one practical example. 'CSV'

comma-separated values are a plaintext data file where each value is separated by a single comma. Add one real device or system example to prove understanding.

3. Correct this common computing misconception.

Mistake: It is not possible to interrogate a CSV file in Python without importing a specialised library. Correction: A CSV file behaves in the same way as a txt file in Python. Data is read from the file as strings and methods can be used to remove extra characters like commas, spliting the values either side in to separate items.

More Lessons In This Unit

Browse all guides in the Year 11 Computing guide library.