Egypt › Secondary › Secondary Two › Programming and AI › Chapter ٥: Data Collection and Cleaning

Lesson ٢: Data Cleaning and Transformation (Item ٥-٢)

Secondary TwoProgramming and AISecond Termالدرس ٢٣٠ دقيقة

فيديو الشرح

الفيديو قيد الإنتاج، وسيظهر هنا فور اعتماده.

ماذا ستتعلم؟

اختبر استعدادك أولًا

١. In the question "What is data cleaning?" the options are: ١) Finding errors, duplicates and missing values and handling them before analysis ٢) Deleting all data ٣) Coloring tables ٤) Taking screenshots. What is the number of the correct answer?
٢. In the question "How are missing values handled?" the options are: ١) Always ignoring them ٢) By deletion or by imputation with a suitable value like the mean or median ٣) Always replacing with zero unchecked ٤) They are never handled. What is the number of the correct answer?
٣. In the question "Why remove duplicate records?" the options are: ١) Only to save space ٢) To speed printing ٣) So that one event is not counted more than once and skews the statistics ٤) They cause no harm. What is the number of the correct answer?

الشرح خطوة بخطوة

Level ١: We explore together

Lesson topic: Data Cleaning and Transformation (Item ٥-٢). Raw data is rarely ready: it may contain errors, duplicates and missing values.

The story: Data cleaning means finding these problems and fixing them before analysis. Missing values are handled by deletion or by filling with a suitable value such as the mean. Duplicates are removed so that one record is not counted twice and distorts results. Transformation reshapes data: unifying formats and units, and grouping ranges into categories. Outliers are values far from the rest of the data; check whether each is an entry error or a real rare case.

أخطاء شائعة وتصحيحها

أمثلة محلولة متدرجة

Easy · مثال ١

Define data cleaning and name two problems it handles.

  1. نقرأ السؤال معًا بهدوء.
  2. Before analysis.
الإجابة: Fixing data defects before analysis; for example missing values and duplicate records
Easy · مثال ٢

A student record appears three times in a grades table; what is the effect and the fix?

  1. نقرأ السؤال معًا بهدوء.
  2. Double counting.
الإجابة: It unfairly raises that student weight in averages; keep one copy and delete the duplicates
Easy · مثال ٣

What is an outlier? Give an example.

  1. نقرأ السؤال معًا بهدوء.
  2. Far away.
الإجابة: A value far from the rest; like a student height of ٣٥٠ cm among heights near ١٦٠ cm
Medium · مثال ٤

A sales column has one empty cell; explain three handling options and when to choose each.

  1. نقرأ السؤال معًا بهدوء.
  2. Delete or impute.
الإجابة: Delete the record if gaps are rare; impute with the mean for regular data; use the median when outliers would distort the mean
Medium · مثال ٥

Why can automatically deleting every outlier be a wrong decision?

  1. نقرأ السؤال معًا بهدوء.
  2. Real meaning.
الإجابة: Some outliers are important real cases (a rare disease case, a very large purchase); deleting them hides a genuine phenomenon worth studying
Medium · مثال ٦

A date column mixes ١/٥/٢٠٢٦ and ٢٠٢٦-٠٥-٠١; what is the problem and the fix?

  1. نقرأ السؤال معًا بهدوء.
  2. Unify.
الإجابة: Mixed formats break sorting and comparison; convert every cell to one agreed format before any analysis
Medium · مثال ٧

Convert marks out of ١٠٠ into grade bands: excellent, good, pass.

  1. نقرأ السؤال معًا بهدوء.
  2. Clear boundaries.
الإجابة: For example: excellent ٨٥ and above, good ٦٥ to below ٨٥, pass ٥٠ to below ٦٥, documenting the chosen cutoffs
Advanced · مثال ٨

Survey data has ٥% values missing at random but ٣٠% missing on the income question; compare the danger of the two patterns.

  1. نقرأ السؤال معًا بهدوء.
  2. Random or systematic.
الإجابة: A little random missingness is safe to impute; concentrated income missingness is usually systematic (certain income groups refuse) and naive imputation hides real bias
Error analysis · مثال ٩

Fix the mistake: a student replaced every missing income value with zero.

  1. نقرأ السؤال معًا بهدوء.
  2. Meaning of zero.
الإجابة: Zero is a real value meaning no income, which is different from missing; proper handling is mean or median imputation, or justified deletion, not a false value

الخريطة الذهنية

Data Cleaning and Transformation (Item ٥-٢)Chapter ٥: Data Collection and Cleaning
▼
Finding errors, duplicates and missing values and handling them before analysisWhat is data cleaning?
By deletion or by imputation with a suitable value like the mean or medianHow are missing values handled?
So that one event is not counted more than once and skews the statisticsFrom the lesson questions
A value lying far from the pattern of the rest of the dataWhat is an outlier?

إنفوجرافيك: Lesson map: words of the day

Lesson map: words of the day
اضغط على أي صف لترى الفكرة.
The key ideas of the lesson in order
We review the questions after one day, then after three days

تدريبات متنوعة مع الإجابات والتفسير

اكتب الإجابة أو اختر ثم اضغط. بعد كل سؤال يظهر الحل مع التفسير.

A) I choose the answer

١. The answer "Taking screenshots" to the question "What is data cleaning?" is correct.
٢. From the lesson explanation: How are missing values handled?
٣. The answer "١٥٠ is an outlier, likely an entry error; correct it to ١٥ or remove it after checking" to the question "A table lists two students aged ١٥ and ١٥٠; what do you conclude and do?" is correct.
٤. The answer "Writing them in English only" to the question "What is unifying units?" is correct.
٥. The answer "Delete the whole table" to the question "A table lists two students aged ١٥ and ١٥٠; what do you conclude and do?" is correct.
٦. The answer "Only to save space" to the question "Why remove duplicate records?" is correct.
٧. The answer "Always keep without checking" to the question "How should we treat an outlier?" is correct.
٨. The answer "Multiplying by ten" to the question "What is unifying units?" is correct.

B) I practice and answer

١. Which question has the answer "١٥٠ is an outlier, likely an entry error; correct it to ١٥ or remove it after checking"?
٢. From the lesson explanation: Outliers are values far from the rest of the data; check whether each is an entry error or a real rare case.
٣. The answer "Analysis matters more" to the question "Why clean before analysis rather than after?" is correct.
٤. The answer "The mean" to the question "What is an outlier?" is correct.
٥. The answer "Always delete instantly" to the question "How should we treat an outlier?" is correct.
٦. The answer "Investigate its cause: fix entry errors, keep and study genuine rare cases" to the question "How should we treat an outlier?" is correct.
٧. The answer "Deleting the dates" to the question "Give an example of unifying formats during transformation." is correct.
٨. The answer "Cleaning after is forbidden" to the question "Why clean before analysis rather than after?" is correct.

C) I review and play

١. From the lesson explanation: What is unifying units?
٢. The answer "To speed printing" to the question "Why remove duplicate records?" is correct.
٣. The answer "Coloring tables" to the question "What is data cleaning?" is correct.
٤. The answer "Finding errors, duplicates and missing values and handling them before analysis" to the question "What is data cleaning?" is correct.
٥. From the lesson explanation: Missing values are handled by deletion or by filling with a suitable value such as the mean.
٦. The answer "Double it" to the question "How should we treat an outlier?" is correct.
٧. The answer "Deleting all data" to the question "What is data cleaning?" is correct.
٨. The answer "Because analysis on corrupted data gives corrupted results whatever the tools" to the question "Why clean before analysis rather than after?" is correct.

ملخص صوتي وقارئ الدرس

قارئ تجريبي يعمل بصوت جهازك (مجاني). ليس تسجيلًا احترافيًا، وجودة الصوت العربي تختلف من جهاز لآخر. التسجيل الصوتي الاحترافي لم يُنتج بعد.

Lesson topic: Data Cleaning and Transformation (Item ٥-٢). Raw data is rarely ready: it may contain errors, duplicates and missing values.

We review the key points of the lesson: What is data cleaning? -> Finding errors, duplicates and missing values and handling them before analysis; How are missing values handled? -> By deletion or by imputation with a suitable value like the mean or median.

We apply what we learned by answering these questions: What is data cleaning? -> Finding errors, duplicates and missing values and handling them before analysis; How are missing values handled? -> By deletion or by imputation with a suitable value like the mean or median; Why remove duplicate records? -> So that one event is not counted more than once and skews the statistics.

مسار المراجعة للامتحان

  1. Day one (١٠ minutes): We read levels ١ to ٣ together, then solve exercises (A).
  2. Day two (١٠ minutes): We play the level ٤ games and solve exercises (B).
  3. Day three (١٠ minutes): Exercises (C), then the Level One test.
  4. Before the school exam: We repeat the Level Three test and look at the common mistakes.

اختبارات بثلاثة مستويات

Level One Test: The Basics

٨ أسئلة. اجب ثم اضغط «أنهِ الاختبار» لترى درجتك.

١. The answer "Always replacing with zero unchecked" to the question "How are missing values handled?" is correct.
٢. From the lesson explanation: Give an example of unifying formats during transformation.
٣. Which question has the answer "Finding errors, duplicates and missing values and handling them before analysis"?
٤. The answer "Expressing all measurements in one unit, such as centimeters only instead of mixing cm and m" to the question "What is unifying units?" is correct.
٥. Which question has the answer "By deletion or by imputation with a suitable value like the mean or median"?
٦. The answer "Turning them into random text" to the question "What does converting continuous data into categories mean?" is correct.
٧. The answer "Hiding them" to the question "Give an example of unifying formats during transformation." is correct.
٨. The answer "So that one event is not counted more than once and skews the statistics" to the question "Why remove duplicate records?" is correct.

المصادر والحقوق

رمز QR هذه الصفحة. يفتح درس «Lesson ٢: Data Cleaning and Transformation (Item ٥-٢)» نفسه.