Understanding Data
Overview
This chapter explains what data is, why it matters for decisions, and how it is collected, stored and processed into information. It separates structured data (rows and columns) from unstructured data (text, images, audio, video) and introduces simple statistical measures, mean, median, mode, range and standard deviation, that summarise a column of numbers.
Not part of the CBSE 2025-26 Class XI IP syllabus, so no board marks are attached to this chapter. Teach it briefly as a bridge: structured data, data processing and summary measures (mean, median, mode, range, standard deviation) are used directly in the Class XII Pandas and data visualisation units and in the Class XII project.
Learning outcomes
- Students will be able to define data and explain how processing turns data into information.
- Students will be able to give examples of data being used for decisions in everyday life.
- Students will be able to classify data as structured or unstructured and explain metadata with examples.
- Students will be able to describe data collection, data storage and the input-process-output cycle.
- Students will be able to calculate mean, median and mode of a data set and choose a suitable measure.
- Students will be able to calculate range and standard deviation and interpret what they say about spread.
- Students will be able to write short Python programs that compute these measures from a list.
Lesson plan
Start with a question: How does IRCTC decide the Tatkal fare? Collect student answers on the board and draw the chain raw data -> processing -> information -> decision. Students list five kinds of data their own phone generates in a day.
Show a fee receipt and a WhatsApp chat screenshot side by side. Students sort ten items written on chits into two columns on the board (structured / unstructured). Then open the Properties of a photo in the lab and note its metadata (size, type, date taken, resolution).
Take the example of the school canteen. Students draw the input-process-output diagram for a canteen billing system in their notebooks and name the storage device used at each stage.
Use the class's own heights (in cm) collected anonymously. Compute mean, median and mode on the board, then add one made-up very large value to show how the mean moves and the median does not. In the lab, students write the mean/median/mode program from the notes.
Compare two bowlers with the same average but different consistency. Work out a standard deviation table on the board with five values. In the lab run the statistics and Pandas versions and point out that Class XII will use mean(), median(), mode() and std() on whole columns.
Notes
What is data?
Data is a collection of raw facts, figures, characters, symbols, images or sounds that describe something. On its own, data does not tell us much. When we organise and process it, we get information, and information helps us take decisions.
Examples of data we meet daily:
- Name, class, roll number and date of birth of a student
- Transactions at a bank, a petrol pump or an online shop
- Photos, videos, voice notes and documents
- Posts and comments on social media
- Readings from sensors (temperature, speed, heart rate)
- Satellite images used for weather forecasting
The word data is the plural of datum, but in everyday use we say "data is" as well as "data are".
| Raw data | Processing | Information | Decision |
|---|---|---|---|
| Daily sales slips of a stationery shop | Total sales per item for the month | Geometry boxes sell most in April | Order more geometry boxes before April |
| Rainfall readings of 30 years | Average rainfall per month | Monsoon arrives in Kerala around 1 June | Farmers plan sowing dates |
Ask students for the difference between data and information. A one-line board answer: data is raw input; information is processed, meaningful output.
Why data is important
People and organisations use data to take better decisions:
- Banks update the account balance after every ATM withdrawal and use past data to approve loans.
- Weather offices (IMD) study satellite data to warn about cyclones and heavy rain.
- Railways and airlines use dynamic pricing: fares rise when demand for a date is high and seats are few.
- Search engines analyse millions of web pages to return the best results.
- Businesses study sales and customer feedback to improve products.
- Governments use census data to plan schools, hospitals and roads.
Computers make this possible because they can store huge amounts of data and process it quickly and accurately.
Link to students' lives: a cricket team's analyst studies a bowler's past data before deciding the field placement.
Types of data: structured and unstructured
Based on format, data is of two broad kinds.
Structured data is organised in a fixed format, usually a table of rows and columns. Each column is an attribute (also called field or variable) and each row is one record (observation). Examples: a marks register, a fee receipt table, a railway reservation chart, a shop's stock list.
Unstructured data has no fixed row-column format. Examples: newspaper pages, emails, chat messages, photos, audio and video files, web pages, social media posts.
Structured data is easy to sort, search and calculate on with spreadsheets, databases and Pandas. Unstructured data needs special techniques to analyse.
| Activity | Attributes (columns) we would record |
|---|---|
| Issuing a library book | AccessionNo, Title, AdmNo, IssueDate, ReturnDate |
| Buying a train ticket | PNR, TrainNo, From, To, JourneyDate, Class, Fare |
| Paying school fees | AdmNo, Name, Class, Month, Amount, PaymentDate |
A CSV file or an Excel sheet with column headings is structured data. This is exactly the kind of data Class XII students load into a Pandas DataFrame.
Metadata: data about data
Metadata is data that describes other data. It is often used to describe and organise unstructured data.
- For an email: sender, recipient, subject, date and time, attachments.
- For a photo: file type (JPEG/PNG), size in KB or MB, resolution, date taken, camera model, location.
- For a song file: title, singer, album, duration.
Metadata lets us search and sort unstructured data, for example finding all photos taken in Shimla in May.
Lab activity: right-click any image, open Properties (or Get Info) and list its metadata.
Data collection and data storage
Data collection means gathering data from suitable sources before processing it. A grocery shop may be in one of three situations:
- Sales are written in a register by hand. The data must first be typed into a digital form such as a spreadsheet.
- Sales are already in a digital file, for example a CSV file exported by the billing machine.
- Nothing is recorded yet. A program (for example in Python) can be written to record sales into a CSV file or a database such as MySQL.
Data storage means saving data on a storage device so that it can be used again later. Common devices: hard disk drive (HDD), solid state drive (SSD), pen drive, memory card, CD/DVD, magnetic tape, and cloud storage. Data is stored as files, but managing many related files is hard; the next chapter shows how a Database Management System (DBMS) solves this.
Data processing
Data processing is the set of steps that converts raw data into useful information. It follows the input -> process -> output cycle:
- Input: collect, prepare and enter the data
- Process: store, retrieve, classify, calculate, update
- Output: results and reports, as tables, charts or text
Online bill payment, booking a train ticket and filling an exam form are examples of automated data processing.
| Task | Input | Processing | Output |
|---|---|---|---|
| Board exam online registration | Name, photo, signature, subjects, fee payment details | Check eligibility and fee status, allot roll number and centre | Admit card |
| Cash withdrawal at an ATM | Card, PIN, amount | Verify PIN, check balance, deduct amount | Cash and a printed slip |
| Booking a train ticket | Stations, date, class, passengers, payment | Check seat availability, allot berth or waiting number, generate PNR | E-ticket with PNR and berth |
Measures of central tendency: mean
A measure of central tendency is a single value that represents the centre of a data set. The three common measures are mean, median and mode.
The mean (average) is the sum of all values divided by the number of values:
mean = (x1 + x2 + ... + xn) / n
Example: a batsman scored 45, 12, 78, 45, 0, 102, 33, 45 and 60 runs in 9 innings. Total = 420, so mean = 420 / 9 = 46.67 runs.
runs = [45, 12, 78, 45, 0, 102, 33, 45, 60] # runs in 9 innings
total = sum(runs)
n = len(runs)
mean = total / n
print("Total runs:", total)
print("Innings :", n)
print("Mean runs :", round(mean, 2))Total runs: 420 Innings : 9 Mean runs : 46.67
Mean can be found only for numeric data.
Median and mode
The median is the middle value after sorting the data in ascending or descending order.
- If the number of values n is odd, the median is the value at position (n + 1) / 2.
- If n is even, the median is the average of the two middle values.
The mode is the value that occurs most often. A data set can have one mode, more than one mode, or no mode (when every value occurs once). Unlike mean and median, mode can also be found for non-numeric data such as house names or favourite sports.
For the batsman's runs: sorted list is 0, 12, 33, 45, 45, 45, 60, 78, 102. The 5th value, 45, is the median. 45 appears three times, so the mode is also 45.
runs = [45, 12, 78, 45, 0, 102, 33, 45, 60]
s = sorted(runs)
n = len(s)
print("Sorted:", s)
if n % 2 == 1:
median = s[n // 2]
else:
median = (s[n // 2 - 1] + s[n // 2]) / 2
print("Median:", median)
heights = [150, 162, 158, 171, 149, 166] # even count
h = sorted(heights)
print("Sorted heights:", h)
print("Median height :", (h[2] + h[3]) / 2)Sorted: [0, 12, 33, 45, 45, 45, 60, 78, 102] Median: 45 Sorted heights: [149, 150, 158, 162, 166, 171] Median height : 160.0
Students often forget to sort before picking the middle value. Insist on writing the sorted list first.
Mode in Python
To find the mode we count how often each value occurs (its frequency) and pick the value(s) with the highest count. A dictionary is a natural way to store the frequency table.
runs = [45, 12, 78, 45, 0, 102, 33, 45, 60]
freq = {}
for r in runs:
freq[r] = freq.get(r, 0) + 1
print("Frequency table:", freq)
highest = max(freq.values())
modes = [k for k in freq if freq[k] == highest]
print("Mode:", modes, "occurs", highest, "times")
houses = ["Tagore", "Raman", "Tagore", "Ashoka", "Raman", "Tagore"]
print("Most common house:", max(houses, key=houses.count))Frequency table: {45: 3, 12: 1, 78: 1, 0: 1, 102: 1, 33: 1, 60: 1}
Mode: [45] occurs 3 times
Most common house: TagoreOutliers: when the mean misleads
An outlier is a value that is unusually large or small compared with the rest of the data. Outliers pull the mean towards themselves but hardly affect the median.
Example: monthly pocket money of six friends is Rs 500, 600, 550, 650, 600 and 5000. The mean (Rs 1316.67) does not describe a typical friend; the median (Rs 600) does. When data has outliers, the median is usually the better measure, or the outlier is checked and removed before taking the mean.
pocket = [500, 600, 550, 650, 600, 5000] # one friend gets Rs 5000
mean = sum(pocket) / len(pocket)
s = sorted(pocket)
median = (s[2] + s[3]) / 2
print("Mean :", round(mean, 2))
print("Median:", median)
without = [500, 600, 550, 650, 600]
print("Mean without outlier:", sum(without) / len(without))Mean : 1316.67 Median: 600.0 Mean without outlier: 580.0
Board-style one-liner: mean is sensitive to outliers; median is not.
Measures of variability: range
Two data sets can have the same mean but be spread very differently. Measures of variability (also called measures of dispersion) tell us how spread out the values are. The two covered here are range and standard deviation.
Range = maximum value − minimum value. It is quick to calculate but depends only on the two extreme values, so a single outlier changes it a lot. Range applies to numeric data only.
temp_delhi = [41, 43, 44, 42, 45, 46, 44] # max temperature in a week (deg C)
temp_shimla = [18, 25, 21, 30, 16, 27, 20]
print("Delhi range :", max(temp_delhi) - min(temp_delhi))
print("Shimla range:", max(temp_shimla) - min(temp_shimla))Delhi range : 5 Shimla range: 14
Standard deviation
Standard deviation (σ, sigma) measures how far, on average, the values lie from the mean. Unlike range, it uses every value.
Steps:
- Find the mean.
- Subtract the mean from each value (deviation).
- Square each deviation.
- Find the average of the squared deviations (this is the variance).
- Take the positive square root. This is the standard deviation.
σ = √( Σ(x − mean)² / n )
Worked example: marks (out of 20) of five students are 6, 8, 10, 12, 14. Mean = 50 / 5 = 10. Sum of squared deviations = 40. Variance = 40 / 5 = 8. σ = √8 = 2.83.
A small standard deviation means values are close to the mean (consistent). A large one means values are widely spread.
| x (marks) | x − mean | (x − mean)² |
|---|---|---|
| 6 | -4 | 16 |
| 8 | -2 | 4 |
| 10 | 0 | 0 |
| 12 | 2 | 4 |
| 14 | 4 | 16 |
| Total = 50 | 40 |
marks = [6, 8, 10, 12, 14] # marks out of 20
n = len(marks)
mean = sum(marks) / n
sq = [(x - mean) ** 2 for x in marks]
print("Mean:", mean)
print("Squared deviations:", sq)
var = sum(sq) / n
sd = var ** 0.5
print("Variance:", var)
print("Standard deviation:", round(sd, 2))Mean: 10.0 Squared deviations: [16.0, 4.0, 0.0, 4.0, 16.0] Variance: 8.0 Standard deviation: 2.83
Python's statistics module (Enrichment)
Python's built-in statistics module has ready-made functions. Note the two standard deviations: pstdev() divides by n (the formula used in this chapter), while stdev() divides by n − 1 (used when the data is a sample).
import statistics as st
runs = [45, 12, 78, 45, 0, 102, 33, 45, 60]
print("mean :", round(st.mean(runs), 2))
print("median :", st.median(runs))
print("mode :", st.mode(runs))
print("range :", max(runs) - min(runs))
print("pstdev :", round(st.pstdev(runs), 2)) # divides by n (as in this chapter)
print("stdev :", round(st.stdev(runs), 2)) # divides by n-1 (sample)mean : 46.67 median : 45 mode : 45 range : 102 pstdev : 29.43 stdev : 31.22
Bridge to Class XII: the same measures in Pandas (Enrichment)
In Class XII, data is held in a Pandas Series or DataFrame, and each of these measures is a single method call on a whole column. std(ddof=0) gives the chapter's formula; plain std() divides by n − 1. mode() returns all modes, which is why it is converted to a list here.
import pandas as pd
marks = pd.Series([67, 82, 91, 45, 82, 74, 58, 82, 99, 60])
print("Mean :", marks.mean())
print("Median :", marks.median())
print("Mode :", marks.mode().tolist())
print("Range :", marks.max() - marks.min())
print("Std :", round(marks.std(ddof=0), 2))Mean : 74.0 Median : 78.0 Mode : [82] Range : 54 Std : 15.65
Mentioning this link early helps students see why the statistics in this chapter matter for the Class XII project.
Key terms
- Data
- Raw facts, figures, symbols, images or sounds that describe something.
- Information
- Data that has been processed so that it is meaningful and useful.
- Structured data
- Data organised in a fixed format of rows (records) and columns (attributes).
- Unstructured data
- Data with no fixed row-column format, such as text, images, audio and video.
- Attribute
- A column in structured data; one characteristic recorded for every record.
- Metadata
- Data about data, for example the size, type and date of a photo.
- Data processing
- Converting raw data into information through input, processing and output.
- Mean
- Sum of all values divided by the number of values; the average.
- Median
- The middle value of the data after sorting.
- Mode
- The value that occurs most often in the data.
- Outlier
- A value that is unusually large or small compared with the rest.
- Range
- Maximum value minus minimum value.
- Standard deviation
- Square root of the average squared distance of values from the mean.
- Variance
- Average of the squared deviations from the mean; the square of standard deviation.
MCQs
Tap an option to check it, or use Show answers above to reveal them all.
-
Which of these is an example of unstructured data?
Answer(c) A voice note on WhatsApp
A voice note has no row-column format. The other three are tables.
-
Processed and meaningful data is called:
Answer(a) Information
Processing converts raw data into information.
-
The size, resolution and date-taken of a photo are examples of:
Answer(d) Metadata
Metadata is data that describes other data.
-
The mean of 4, 8, 6, 10 and 12 is:
Answer(b) 8
(4 + 8 + 6 + 10 + 12) / 5 = 40 / 5 = 8.
-
The median of 15, 3, 9, 21, 6, 12 is:
Answer(c) 10.5
Sorted: 3, 6, 9, 12, 15, 21. Even count, so median = (9 + 12) / 2 = 10.5.
-
Which measure can be found for non-numeric data such as favourite sport?
Answer(d) Mode
Mode only needs counting how often each value occurs.
-
Which measure is most affected by an outlier?
Answer(a) Mean
The mean adds every value, so one extreme value pulls it strongly.
-
The range of 22, 35, 18, 40, 27 is:
Answer(b) 22
40 − 18 = 22.
-
A small standard deviation tells us that the values are:
Answer(c) Close to the mean
Standard deviation measures spread around the mean; small means tightly grouped.
-
The data set 7, 3, 9, 3, 7, 5 has:
Answer(b) Two modes, 3 and 7
Both 3 and 7 occur twice, more than any other value.
-
In the input-process-output cycle, generating an admit card is part of:
Answer(c) Output
The admit card is the result produced after processing the form data.
-
If the variance of a data set is 25, its standard deviation is:
Answer(a) 5
Standard deviation is the positive square root of variance: √25 = 5.
Assertion–Reason
Assertion (A): The median is often a better measure of centre than the mean for data on family incomes in a town.
Reason (R): The median is not much affected by a few extremely large values.
Answer(A)
Incomes usually contain a few very large values (outliers). The median resists them, which is exactly why it is preferred.
Assertion (A): Mode can be calculated for the list of house names of students in a class.
Reason (R): Mode is the value with the highest frequency, and frequency can be counted for any kind of value.
Answer(A)
Both are true and R explains why mode works for non-numeric data.
Assertion (A): Range uses every value in the data set.
Reason (R): Range is the difference between the maximum and minimum values.
Answer(D)
Range uses only the two extreme values, so A is false. R is the correct definition.
Assertion (A): An email is an example of unstructured data.
Reason (R): Unstructured data cannot be stored on a computer.
Answer(C)
An email has no fixed row-column format, so A is true. Unstructured data is stored on computers all the time, so R is false.
Short answer
- 2 marks
Differentiate between data and information with one example.
AnswerData is raw, unprocessed facts, for example the marks of each student in a class. Information is processed, meaningful data, for example "the class average in IP is 62 and 5 students scored above 90". Information is obtained by processing data.
- 2 marks
What is structured data? Give two examples.
AnswerStructured data is organised in a fixed format of rows and columns, where each column is an attribute and each row is a record. Examples: a class marks register in a spreadsheet; a shop's stock list with ItemCode, ItemName, Price and Quantity.
- 2 marks
What is metadata? Give the metadata of an email.
AnswerMetadata is data about data; it describes other data. The metadata of an email includes the sender, recipients, subject, date and time sent, and names and sizes of attachments.
- 2 marks
Find the mean and median of 12, 7, 19, 7, 15.
AnswerMean = (12 + 7 + 19 + 7 + 15) / 5 = 60 / 5 = 12.
Sorted: 7, 7, 12, 15, 19. Odd count, so median = 3rd value = 12.
- 2 marks
What is an outlier? How does it affect the mean?
AnswerAn outlier is a value that is unusually large or small compared with the rest of the data. Because the mean adds up every value, an outlier pulls the mean towards itself, so the mean no longer represents a typical value.
- 2 marks
Find the mode and range of 5, 9, 2, 9, 4, 9, 2.
Answer9 occurs three times, more than any other value, so mode = 9.
Range = maximum − minimum = 9 − 2 = 7.
- 2 marks
Why is standard deviation considered a better measure of spread than range?
AnswerRange uses only the maximum and minimum values, so one extreme value can change it a lot and it ignores how the other values are spread. Standard deviation uses every value's distance from the mean, so it gives a fuller picture of spread.
- 2 marks
Write the steps of the input-process-output cycle for booking a movie ticket online.
Answer- Input: movie, show time, number of seats, seat choice, payment details.
- Process: check seat availability, block the seats, verify payment, update the seat map.
- Output: e-ticket with booking ID and seat numbers, sent by SMS/email.
Long answer
- 3 marks
The heights (in cm) of 8 students are 152, 160, 148, 165, 160, 155, 170, 160. Find the mean, median, mode and range.
AnswerSum = 152 + 160 + 148 + 165 + 160 + 155 + 170 + 160 = 1270. Mean = 1270 / 8 = 158.75 cm.
Sorted: 148, 152, 155, 160, 160, 160, 165, 170. Even count, so median = (4th + 5th) / 2 = (160 + 160) / 2 = 160 cm.
160 occurs three times, so mode = 160 cm.
Range = 170 − 148 = 22 cm.
- 3 marks
Calculate the standard deviation of 2, 4, 4, 4, 5, 5, 7, 9. Show each step.
Answer- Mean = (2 + 4 + 4 + 4 + 5 + 5 + 7 + 9) / 8 = 40 / 8 = 5.
- Deviations from mean: −3, −1, −1, −1, 0, 0, 2, 4.
- Squared deviations: 9, 1, 1, 1, 0, 0, 4, 16. Sum = 32.
- Variance = 32 / 8 = 4.
- Standard deviation = √4 = 2.
- 5 marks
Explain with examples any four areas where data helps in decision making.
Answer- Banking: account data is updated after each ATM withdrawal; past repayment data is used to approve or reject a loan.
- Weather forecasting: the IMD analyses satellite and sensor data to issue cyclone and heavy-rain warnings so that people can be moved to safety.
- Railways and airlines: booking data drives dynamic pricing; fares rise as seats fill up on popular dates.
- Retail: a supermarket studies which items are bought together and places them near each other to increase sales.
- Government planning: census data on population and literacy helps decide where to open new schools and hospitals.
(Any four, with a clear example each.)
- 5 marks
Two batsmen scored the following runs in five matches. A: 40, 42, 38, 41, 39. B: 5, 90, 10, 80, 15. (a) Find the mean for both. (b) Find the range for both. (c) Which batsman is more consistent? Justify using spread.
Answer(a) Mean of A = 200 / 5 = 40. Mean of B = 200 / 5 = 40. Both have the same mean.
(b) Range of A = 42 − 38 = 4. Range of B = 90 − 5 = 85.
(c) Batsman A is more consistent. Both average 40 runs, but A's scores lie very close to 40 (small range, and so a small standard deviation) while B's scores swing between very low and very high. Same mean does not mean same behaviour; the measure of spread shows the difference.
Case-based
Ms Kavya, the class teacher of XI-B, keeps the following data:
- A spreadsheet with columns AdmNo, Name, IP_Marks, Attendance%
- Photos from the class trip to Jaipur
- Voice notes from parents on the class group
The IP marks (out of 70) of ten students are: 58, 62, 45, 70, 62, 39, 66, 62, 51, 65.
- 1 mark
Which of Ms Kavya's data is structured and which is unstructured?
AnswerThe spreadsheet is structured (rows and columns). The trip photos and the voice notes are unstructured.
- 1 mark
Give any two items of metadata that could help her organise the trip photos.
AnswerAny two of: date and time taken, location, file size, file type (JPEG/PNG), resolution.
- 2 marks
Find the mean and the mode of the IP marks.
AnswerSum = 580, so mean = 580 / 10 = 58. 62 occurs three times, so mode = 62.
- 2 marks
Find the median of the IP marks. If one student's 39 is corrected to 3 (a data-entry check), which of mean or median will change? Explain.
AnswerSorted: 39, 45, 51, 58, 62, 62, 62, 65, 66, 70. Median = (62 + 62) / 2 = 62.
If 39 becomes 3, the mean changes (the total drops by 36, so mean becomes 54.4). The median stays 62, because the middle two values are unchanged. This shows that the median is not sensitive to extreme values.
Practicals
1Summary statistics of class marks
Store the IP marks of ten students in a list. Without using any module, write a Python program to find and print the mean, median, mode (all modes if more than one), range and standard deviation (divide by n).
# Summary of Class XI-A IP marks (out of 70)
marks = [56, 61, 48, 70, 61, 39, 65, 61, 52, 58]
n = len(marks)
mean = sum(marks) / n
s = sorted(marks)
if n % 2 == 1:
median = s[n // 2]
else:
median = (s[n // 2 - 1] + s[n // 2]) / 2
freq = {}
for m in marks:
freq[m] = freq.get(m, 0) + 1
top = max(freq.values())
mode = [k for k in freq if freq[k] == top]
rng = max(marks) - min(marks)
sd = (sum((x - mean) ** 2 for x in marks) / n) ** 0.5
print("Number of students:", n)
print("Mean :", mean)
print("Median :", median)
print("Mode :", mode)
print("Range :", rng)
print("Std. dev :", round(sd, 2))Number of students: 10 Mean : 57.1 Median : 59.5 Mode : [61] Range : 31 Std. dev : 8.44
Viva questions (4)
- Why do we sort before finding the median? Because the median is defined as the middle value of ordered data.
- Why is the mode printed as a list? Because a data set can have more than one mode.
- What does a standard deviation of 8.44 tell you? Marks lie, on average, about 8.4 marks away from the mean of 57.1.
- Which Python data type did you use for the frequency table? A dictionary, with the mark as key and its count as value.
2Who is the more consistent bowler?
Two bowlers gave the following runs in their last six overs. Bowler A: 6, 7, 6, 8, 7, 8. Bowler B: 2, 14, 1, 12, 3, 10. Write functions mean() and sd() and print the mean, range and standard deviation for both. State which bowler is more consistent.
# Compare two bowlers: runs given in their last 6 overs
bowler_a = [6, 7, 6, 8, 7, 8]
bowler_b = [2, 14, 1, 12, 3, 10]
def mean(d):
return sum(d) / len(d)
def sd(d):
m = mean(d)
return (sum((x - m) ** 2 for x in d) / len(d)) ** 0.5
for name, data in [("Bowler A", bowler_a), ("Bowler B", bowler_b)]:
print(name, "mean =", round(mean(data), 2),
"range =", max(data) - min(data),
"sd =", round(sd(data), 2))Bowler A mean = 7.0 range = 2 sd = 0.82 Bowler B mean = 7.0 range = 13 sd = 5.16
Viva questions (3)
- Both bowlers have the same mean. Does that mean they bowl equally well? No; Bowler A is far more consistent because his standard deviation is much smaller.
- Why is range not enough here? Range uses only two values; standard deviation uses all six overs.
- What would the standard deviation be if every over cost exactly 7 runs? Zero, because there is no spread.
3Classroom activity: structured or unstructured?
Students list six kinds of data generated in their school and classify each one as structured or unstructured. As a lab extension, store the list in a dictionary (item -> type) and print the two groups with their counts.
# Classify each item as structured or unstructured data
items = {
"Fee receipt table (AdmNo, Name, Month, Amount)": "structured",
"Voice note sent on a class group": "unstructured",
"Railway reservation chart": "structured",
"Photo of the school annual day": "unstructured",
"Attendance register in a spreadsheet": "structured",
"Principal's speech video": "unstructured",
}
s = [k for k, v in items.items() if v == "structured"]
u = [k for k, v in items.items() if v == "unstructured"]
print("Structured :", len(s))
for k in s:
print(" -", k)
print("Unstructured:", len(u))
for k in u:
print(" -", k)Structured : 3 - Fee receipt table (AdmNo, Name, Month, Amount) - Railway reservation chart - Attendance register in a spreadsheet Unstructured: 3 - Voice note sent on a class group - Photo of the school annual day - Principal's speech video
Viva questions (3)
- Is a photo stored on a computer structured data? No; it is digital but not in rows and columns.
- Name one item of metadata for a video file. Duration (also size, format or resolution).
- Why is structured data easier to analyse? Each column has one kind of value, so it can be sorted, filtered and summarised directly.
Common mistakes
Finding the median without sorting the data first. Correction: always write the sorted list, then pick the middle value (or average the two middle values when n is even).
Saying a data set always has exactly one mode. Correction: it may have no mode (all values occur once) or more than one mode.
Using the mean to describe data with an outlier, such as one very large salary. Correction: use the median, or check and remove the outlier first.
Forgetting to take the square root, and reporting the variance as the standard deviation. Correction: σ = √variance.
Calling a photo or email "structured" because it is stored on a computer. Correction: structured means organised in rows and columns, not merely digital.
Mixing up data and information. Correction: data is raw input; information is the processed, meaningful result.