Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Introduction to Data Analytics  ›  Lesson

Observations and Variables

Key Concepts of Data 12 minIn a tidy dataset each row is one observation, each column is one variable, and each cell holds one value.

Observations and Variables

Nisha's till exports a sheet, her manager keeps another by hand, and they never quite agree. Half the trouble is layout: one sheet puts each month in its own column, the other puts two customers in one cell. Before you can analyse any table, you need a shared picture of what a table should look like.

The rule

Row = one thing observed. Column = one property. Cell = one value.

  • An observation (also called a record, case or row) is one thing you measured: one order, one customer, one day.
  • A variable (a field, feature or column) is one property measured for every observation: the date, the quantity, the amount.
  • A value is what one variable holds for one observation: order 1002 has a qty of 3.

A table laid out this way is called tidy. Here is the orders sheet, which already is:

order_id order_date customer item_code qty amount
1001 2025-06-02 Asha Rao C01 2 240
1002 2025-06-02 Vikram Shah C02 3 120
1003 2025-06-03 Meera Iyer B01 1 90
1004 2025-06-03 Asha Rao B02 2 220
1005 2025-06-04 Dev Menon C01 1 120

It has 5 observations and 6 variables. The unit of observation is one order. Asha appears twice because she placed two orders. That is not a mistake: each row is a different order.

A few more words you will meet constantly:

  • Dataset: the whole collection of observations and variables.
  • Metadata: data about the data, such as "amount is in rupees, including tax".
  • Key: a variable that identifies each observation uniquely, like order_id.

The shortcut

To judge any sheet, finish the sentence "Each row is one ___." If you cannot fill the blank with a single noun, the sheet is not tidy.

Tidying a monthly sheetStep 1 of 4
  1. Read the layout

    Columns: customer, June, July, August, each holding that month's order count.

The trap to watch for is one cell holding two values, such as "Asha Rao, Dev Menon". You can no longer count, filter or look up either person.

Drills

Answer fast — trust the rule.

quick drill

In the orders table above, what is one observation?

quick drill

How many variables does the orders table have?

quick drill

Which layout is tidy for daily cold-coffee sales?

quick drill

Which column is the best key for the orders table?

quick drill

A note says "amount is in rupees and includes 5% GST". What is this note?

Remember

  • Row = one thing observed; column = one property; cell = one value.
  • Shortcut: finish "Each row is one ___" with a single noun.
  • Traps: values hiding in column headers, and two values crammed into one cell.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainIs this sheet tidy?

A sheet has one row per customer and columns called 'June orders', 'July orders' and 'August orders'. Explain what the observation and the variables are, why this layout makes monthly analysis awkward, and how you would reshape it.