Skip to content

Lesson 2 ยท Getting Started

What Is Data? Observations and Variables

Understand what data is: observations, variables, values, datasets and metadata, how data becomes information, and why every dataset reflects human choices.

Data is a set of recorded observations: facts, measurements, labels or descriptions that someone or something wrote down. A thermometer reading, a name on a sign-up sheet, a photo, a click on a website and a doctor's note can all be data. Data is not the same as the world. It is a record of a few chosen parts of the world, and knowing that is the start of reading it well.

Observations, variables and values

Most beginner datasets are tables. Imagine a small library that records loans.

loan_id member book days_kept returned_late
1 M-04 River Maps 12 no
2 M-11 Soil and Seeds 23 yes
3 M-04 Night Skies 7 no
  • Each row is an observation (also called a record or case). Here it is one loan.
  • Each column is a variable (also called a field or attribute): something that can differ between observations.
  • Each cell holds a value.
  • The whole collection is a dataset.

The most important question about any table is: what does one row represent? This is the grain of the data. In this table, one row is one loan, not one member. Member M-04 appears twice. If you count rows and call the result "members", you get 3 when the truth is 2.

Python Rows are loans, not members

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Try adding a fourth loan for a new member and run it again.

From data to decisions

People often describe a chain from raw records to action.

From records to action

Data 23, 12, 7
Information Days each book was kept
Insight Some loans exceed 14 days
Decision Send a reminder on day 12

Each step adds context and judgment.

1 / 2

The number 23 alone means nothing. It could be days, degrees or dollars. Context turns it into information. Comparing it with a rule (loans are due after 14 days) gives an insight. Deciding what to do is a human step that also depends on costs, values and goals, which the data does not contain.

Metadata: data about data

Metadata describes a dataset. Without it, you have to guess. Useful metadata answers:

  • What does each column mean, and in what unit?
  • What does one row represent?
  • When and where was the data collected, and by whom?
  • How are missing values written?
  • When was it last updated?

A short data dictionary is the simplest form. Here is one for the library table.

Column Meaning Unit or allowed values
loan_id Unique number for the loan whole number
member Anonymous member code text like M-04
book Title borrowed text
days_kept Days from borrowing to return days, 0 or more
returned_late Kept longer than the loan period yes, no

Imagine a column called time with values such as 3.5. Is it hours, minutes or days? Teams lose real hours on questions that one line of metadata would answer.

Data is made by people

Data can look neutral, but someone chose:

  • what to record (late returns are tracked, but not whether the member enjoyed the book);
  • how to define it (is a return on the due date late?);
  • how to measure it (calendar days or opening days?);
  • who is included (are staff loans in the table?).

Different choices produce different numbers from the same events. This does not make data useless. It means you should read the definitions before you read the results.

Before you analyze any dataset, write one sentence: "Each row is one ___, collected from ___ between ___ and ___." If you cannot fill the blanks, find out before going further.

Not all data is a table

Text messages, photos, audio, video and sensor streams are data too. To analyze them, people usually extract variables: the date of a message, its length, a topic label. Each extraction is another choice that can introduce errors. If a computer program or an AI system adds the labels, check a sample of them yourself. You can learn how such systems work in the generative AI tutorial.

Questions data can and cannot answer

A dataset can only answer questions about what it records. The library table can answer "How long was each book kept?" and "How many loans were late?" It cannot answer "Why were they late?" or "Which books did people want but could not find?" When a question matters and the data is silent, say so, then decide whether to collect new information.

A good data question is specific: it names the thing measured, the group and the time period. "Is the library popular?" is vague. "How many different members borrowed at least one book in March?" can be answered.

A worked data dictionary

Practice on a new case. A food bank keeps one sheet with the columns visit_date, household_code, adults, children and bags. Before anyone totals it, a volunteer writes down the following facts.

  • Grain: one row per household visit.
  • visit_date: the day of collection, written as year, month, day.
  • household_code: a code that stays the same across visits, so repeat visits can be counted.
  • adults and children: people in the household as reported on that visit.
  • bags: number of food bags given out.

Now several questions have clear answers. The number of rows is the number of visits. The number of different codes is the number of households. But adding up children over all rows does not give the number of children served, because a family that visits three times is counted three times. To count children once, you need to take one row per household and decide which visit to use, for example the latest.

This is the typical work of data literacy: most of the care goes into knowing what a row means before any arithmetic starts. If you can explain the grain and each column to a colleague in two minutes, you are ready to calculate.

Common mistakes: counting rows when you mean unique people or items; assuming a unit; treating an empty cell as zero; and forgetting that "not recorded" is different from "did not happen".

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A table has one row for every order a shop received. What is the grain?

    The grain is what one row represents. A customer who ordered twice appears in two rows.
  2. 2. Which is an example of metadata?

    Metadata describes the data, such as meanings, units, dates and collection method.
  3. 3. Which question is the most answerable?

    It names a measurable thing, a group and a time period.
  4. 4. A cell for a temperature reading is empty. What does it most safely mean?

    Missing is not the same as zero. Find out why it is missing.

Summary

  • Data is a record of chosen observations, not the world itself.
  • Rows are observations, columns are variables and cells hold values.
  • Always find the grain: what one row represents.
  • Metadata and a data dictionary give numbers their meaning.
  • Definitions are human choices, so read them first.

Next: Types of Data

Your progress is saved in this browser. No account needed.