Free tutorials & notes in Hindi & English · Clean code examples 🧰 Free PDF & Image Tools →
🧱 Unit 1 – Data Structures & Algorithms  ·  Lesson 14

Understanding Data & Statistics

What is data?

Data is a collection of raw facts – numbers, text, images, sounds – recorded about something. When data is organised and processed so that it becomes meaningful, it is called information. Schools, banks, hospitals and apps all take decisions based on data.

Raw dataProcessingInformationDecision
From data to decision

Structured vs unstructured

Structured data

  • Organised in rows and columns
  • Fixed format (tables, spreadsheets, databases)
  • Easy to search and analyse
  • Example: marks sheet, railway reservation

Unstructured data

  • No fixed format
  • Text, images, audio, video, posts
  • Needs special tools to analyse
  • Example: emails, photos, YouTube videos

Data life cycle

  1. 1Collection – gather data from forms, sensors, surveys, websites
  2. 2Storage – save it in files, databases or the cloud
  3. 3Processing – clean, sort, calculate, summarise
  4. 4Analysis & presentation – tables, charts, reports
  5. 5Decision – use the information
Data life cycle

Collection & storage

Data can be collected manually (registers, survey forms) or automatically (barcode scanners, sensors, online forms). It is stored in files (text, CSV), spreadsheets, databases (MySQL) or cloud storage. Storage devices include HDD, SSD and pen drives.

Processing data

Raw data often has blanks, spelling errors or invalid entries. Cleaning removes or fixes them before calculation.

Python
# Processing raw data: clean, then summarise
raw = ['45', ' 67', 'abs', '89 ', '', '72']
clean = []
for v in raw:
    v = v.strip()
    if v.isdigit():
        clean.append(int(v))
print('Valid:', clean, '| ignored:', len(raw) - len(clean))
print('Average:', round(sum(clean) / len(clean), 2))
Valid: [45, 67, 89, 72] | ignored: 2 Average: 68.25

Statistical techniques

➗
MeanSum of values ÷ count. The usual “average”.
🎯
MedianMiddle value after sorting.
🔁
ModeThe value that occurs most often.
↔️
RangeMaximum − minimum.
📐
Standard deviationHow far values spread from the mean.
Measures used to summarise data
Frequency of marks0123marksstudents4856606472859091
Mode = 72 (tallest bar)

Statistics in Python

Python
marks = [56, 72, 91, 72, 64, 85, 72, 48, 90, 60]
n = len(marks)
mean = sum(marks) / n
s = sorted(marks)
if n % 2 == 0:
    median = (s[n // 2 - 1] + s[n // 2]) / 2
else:
    median = s[n // 2]
mode = max(set(marks), key=marks.count)
print('Sorted:', s)
print('Mean  :', mean)
print('Median:', median)
print('Mode  :', mode)
print('Range :', max(marks) - min(marks))
Sorted: [48, 56, 60, 64, 72, 72, 72, 85, 90, 91] Mean : 71.0 Median: 72.0 Mode : 72 Range : 43
Python
import statistics as st
marks = [56, 72, 91, 72, 64, 85, 72, 48, 90, 60]
print('mean   :', st.mean(marks))
print('median :', st.median(marks))
print('mode   :', st.mode(marks))
print('pstdev :', round(st.pstdev(marks), 2))   # population SD
print('pvar   :', round(st.pvariance(marks), 2))
mean : 71 median : 72.0 mode : 72 pstdev : 13.73 pvar : 188.4

Standard deviation

SD = √( Σ(x − mean)² ÷ n ). Steps: find the mean, subtract it from each value, square, average the squares (variance), take the square root.

Python
# Standard deviation by formula, step by step
data = [4, 8, 6, 2]
m = sum(data) / len(data)
sq = [(x - m) ** 2 for x in data]
var = sum(sq) / len(data)
print('mean =', m)
print('squared deviations =', sq)
print('variance =', var, '| SD =', round(var ** 0.5, 3))
mean = 5.0 squared deviations = [1.0, 9.0, 1.0, 9.0] variance = 5.0 | SD = 2.236

Summary

  • Data → processing → information.
  • Structured data fits tables; unstructured data does not.
  • Mean, median, mode, range and SD summarise a data set; Python's statistics module computes them.

Frequently Asked Questions

What is the difference between data and information?
Data is raw facts (marks of 40 students). Information is processed data that has meaning (class average is 71).
Which measure is not affected by extreme values?
The median, because it depends only on the middle position, not on the size of the largest or smallest values.
What does standard deviation tell us?
How spread out the values are around the mean. A small SD means values are close to the mean.
← Class 12 Computer Science
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

Next topicNetworks: Evolution & Types Your progress: 14 / 26 (54%) · Lesson 15 / 26 Continue →

How was this lesson?

Your feedback helps us make the content better.

Write a review or suggestion (optional)

After approval, your name and city may appear publicly with your review. Please do not write your email or phone number.

▶ CodingEasily on YouTube

Learn with video lessons in easy Hindi

Featured video: RDBMS Part 3 – Class XI Commerce IT

▶ Subscribe – it’s free