How to Master Data Cleaning for High School Data Science Projects

A student planning a school science project downloads a reading-club spreadsheet and immediately creates a chart. One session appears twice, some club labels differ in capitalization, a time field is blank, and another row contains a negative count of pages read. The graph looks convincing, but the calculation cannot yet be trusted. How can the student repair the dataset without inventing evidence or hiding genuine uncertainty?

Data cleaning for high school students is the careful investigation of incomplete, duplicated, inconsistent or suspicious observations. Computers can identify problems, but they cannot know whether every unusual measurement is wrong. A convenient replacement may be as misleading as leaving the original error in place.

This practical guide teaches a repeatable cleaning workflow using ten fictional reading-club rows, a separate nine-record analytical copy, a decision log, no-code spreadsheets and an optional Pandas extension. Students will verify the calculations themselves and explain why some values remain unresolved. No real school or personal records are needed.

What Is Data Cleaning?

Data cleaning means identifying, investigating, correcting or appropriately handling errors, missing values, unintended duplicate records and inconsistent definitions. It does not mean turning every blank into a number or deleting every value that looks unusual. The purpose is to prepare information suitable for a defined research question while documenting limits to what can be concluded. For general data science foundations, see Introduction to Data Science.

Raw data is information as recorded before project-specific changes. Data preparation is the broader work of making data suitable for analysis, while data wrangling can include combining or restructuring tables. Data preprocessing often also includes scaling or encoding for statistics or machine learning. These terms overlap and definitions may vary across professional settings.

TermMeaning
Raw dataUnchanged recorded values
CleaningReview and handle gaps, invalid values, duplicates and labels
PreparationBroader process of making data suitable for analysis
WranglingOrganize, reshape, combine and clean
PreprocessingPrepare model features including optional scaling and encoding

Why Data Cleaning Matters

Accurate calculations require consistent units, valid counts and a reliable observation unit. A session accidentally counted twice makes participation look larger. An invalid negative page count can distort a mean. Separate labels for Science and science can create misleading group totals, even when they represent the same category. For questioning unreliable evidence, see Critical Thinking in Data Science.

Cleaning improves reproducibility because another student can inspect rules and repeat the work. It cannot fix every sampling bias or guarantee an accurate scientific conclusion. Two sessions with the same club name may represent legitimate different events; deleting one would remove evidence. Compare identifiers, dates and other fields before determining whether records duplicate the same event.

Twelve Common Types of Dirty Data

Typical problems include absent measurements, unwanted duplicate rows, inconsistent category labels, leading spaces, numeric values stored as text, impossible ranges, suspicious outliers, mixed units, ambiguous dates, improperly structured columns, reused IDs and incomplete source descriptions. These issues differ in how they should be handled.

A written data dictionary identifies column meanings, units, permitted labels and expected formats. It provides a standard for checking whether a value is invalid or merely unusual. Never assume that a large number is false simply because it would change a graph; check the original source or transparently mark the value for review.

ProblemExampleAction
MissingR03 minutes blankKeep missing; seek source
DuplicateR05 twiceVerify full rows
Category inconsistencyScience and scienceUse approved mapping
Whitespace“ science ”Trim
Wrong typetwenty pagesKeep raw text and flag
Invalid count-5 pagesExclude from valid summary
Outlier600 minutesReview original
Mixed unitsHours versus minutesConfirm units
Dates03/04/2026Resolve ambiguity
Column structureTwo values in a cellRestructure with care
Identifier issueRepeated codeCheck observation unit
Missing metadataNo source noteReport uncertainty
Six common kinds of messy classroom data

Seven Dimensions of Data Quality

Accuracy considers whether a measurement describes the actual event. Completeness asks whether required information is available. Consistency concerns agreement across sources and labels; validity concerns specified formats and ranges. Uniqueness checks unwanted repeats, timeliness considers whether data are sufficiently current, and integrity protects identifiers and relationships. For quality issues in larger datasets, see What Is Big Data?.

A dataset can satisfy one dimension while failing another. Our nine session records may be unique after duplicate review but still lack validated page counts in two rows. It is more responsible to report that limitation than invent replacement values to make the spreadsheet appear complete.

DimensionMeaning
AccuracyMatches the actual event
CompletenessNeeded values present
ConsistencyDefinitions agree
ValidityFollows permitted rules
UniquenessNo unwanted duplicate
TimelinessSufficiently current
IntegrityRelationships preserved
Data quality accuracy completeness consistency validity uniqueness timeliness integrity

Follow a Ten-Step Cleaning Workflow

Begin with a research question, preserve the original source, inspect rows and column types, build a data dictionary and list data-quality issues. Next choose defensible correction rules, apply them to a separate working copy, validate the output, compare before and after, and record every important decision.

Cleaning is iterative. New evidence might justify correcting a previously unresolved value, but the old entry and revision history should still be retrievable. The University of Illinois Research Data Service recommends retaining an unchanged original because any edit involves risk. If two students follow the same documented process, they should obtain the same summaries.

Ten steps for reproducible data cleaning

Missing Values Are Different from Zero

A missing entry can mean no measurement, a skipped response, technical failure, unknown information, not-applicable status or data not yet collected. These are not necessarily equivalent. R03 has no recorded reading minutes; changing its blank value to zero would falsely imply that the session was measured to last no time.

Possible actions include recovering reliable source evidence, leaving the value missing, omitting it only from an appropriate calculation, or using a justified imputation method in more advanced analysis. Automatically replacing every missing value with the mean or zero can change statistical results and introduce bias. Always state how many observations actually support a reported mean.

Missing readings are not measured zeros

Investigate Duplicates Before Removal

An exact duplicate matches across the relevant fields. A repeated identifier may instead indicate a correction, a legitimate repeated transaction or a faulty ID. Students must decide what one row represents. In this fictional project, each Record ID identifies one reading session, and both R05 rows match in every column.

Excel and Google Sheets provide commands for duplicate review and removal, but these commands cannot establish research meaning. Copy the original, compare all fields, remove only the confirmed redundant R05 row from the working file and document that exactly one record was discarded. Repeated names or categories alone are insufficient reasons for deletion.

Standardize Labels, Dates and Units

The labels Science, science, SCIENCE and “ science ” can all represent the same club only after checking the project rules. ARTS maps to Arts; Sport maps to Sports because the fictional dictionary explicitly defines that equivalence. Blindly merging similar words is dangerous when their meanings might differ.

TRIM removes normal leading, trailing and repeated spaces, but Excel documentation notes that some nonbreaking Unicode spaces are not removed by TRIM alone. Date values and mixed units also require careful handling. A date such as 03/04/2026 can be ambiguous; a reading duration expressed in hours cannot be added to a minutes column without conversion and documented source units.

Classroom Project: Inspect Ten Raw Reading-Club Records

The research question is: what page counts and reading times can we responsibly summarize from fictional club sessions? Ten rows were entered, including a repeated R05 session, inconsistent club names, missing minutes, an invalid negative page count, a suspicious 600-minute duration and one page count written as the word twenty.

The quoted spaces around “ science ” are part of the original category value. All dates use year-month-day format. Treat this raw table as an unaltered record of what was supplied, not as a list of measurements whose correctness has already been verified.

Record IDDateClubPages ReadReading Minutes
R012026-10-01Science2030
R022026-10-02“ science ”2540
R032026-10-03Arts15blank
R042026-10-04ARTS1835
R052026-10-05Sports2245
R052026-10-05Sports2245
R062026-10-06Science-525
R072026-10-07Sport30600
R082026-10-08Sciencetwenty32
R092026-10-09Arts2438

Decide and Document the Cleaning Policy

Keep Raw_Data unchanged. Remove only the second, fully identical R05 row. Map club labels with the approved dictionary. Leave R03 reading minutes missing because no reliable measurement exists. The original -5 pages for R06 contradict the project’s nonnegative page-count rule, so its numerical analytical value becomes missing until a source correction is available.

Do not automatically change R08’s word twenty into a verified 20 pages; retain the text for investigation. R07’s 600 minutes exceeds the illustrative review threshold of 240 minutes for one session, but this threshold is not a universal limit. Preserve 600 in the source and flag it; exclude it only from the trusted-minute mean pending source verification.

A documented policy prevents students from making different decisions according to whether the resulting mean looks favorable. Keeping unresolved observations is not failure: it communicates which conclusions the available information can and cannot support.

The Cleaned Dataset: Nine Unique Sessions

After removing the unwanted duplicate, the working table contains nine records. Approved category mappings give Science four sessions, Arts three and Sports two. Missing analytical values are shown as dashes for readability, not imputed measurements.

Notice that R07 remains as a valid session even though its time is flagged. Similarly, R06 and R08 are not removed because their page counts need investigation. The original text and numeric entries remain in the raw archive and are described in the quality-note column of the cleaned table.

Record IDDateClubValid PagesTrusted MinutesReview note
R01Oct 1Science2030Valid
R02Oct 2Science2540Category standardized
R03Oct 3Arts15—Minutes missing
R04Oct 4Arts1835Category standardized
R05Oct 5Sports2245Duplicate copy removed
R06Oct 6Science—25Pages -5 invalid
R07Oct 7Sports30—600 minutes flagged
R08Oct 8Science—32Text twenty unresolved
R09Oct 9Arts2438Valid
Reading club ten raw rows compared with nine cleaned rows

Calculate the Verified Statistics

The validated Pages Read observations are 20, 25, 15, 18, 22, 30 and 24. Their sum is 154, and 154 divided by seven produces a mean of 22 pages. Sorting gives 15, 18, 20, 22, 24, 25, 30, so the median is 22 and the range is 30 minus 15, or 15 pages.

Trusted Reading Minutes are 30, 40, 35, 45, 25, 32 and 38. Their total is 245 and their mean is 245 divided by seven, or 35 minutes. The blank R03 and suspicious R07 values do not contribute to this trusted mean. These summaries each describe seven validated observations, not all nine sessions.

SummaryResultScope
Raw / unique rows10 / 9One confirmed duplicate removed
Science / Arts / Sports4 / 3 / 2Unique session counts
Valid Pages Read7 observations-5 and text twenty unresolved
Pages sum / mean154 / 22Seven validated values
Pages median / range22 / 15Sorted seven values
Trusted minutes7 observationsBlank and 600 excluded
Minutes sum / mean245 / 35Seven trusted values

Excel and Google Sheets: No-Code Data Cleaning

Import the fictional CSV into a sheet called Raw_Data, then copy the records into Cleaned_Data. Compare IDs and all fields before removing the confirmed duplicate. Use columns A Record ID, B Date, C Club, D Validated Pages, E Trusted Minutes and F Quality Note in the cleaned sheet. For more beginner-friendly tools, see Data Science Tools and Techniques.

Use TRIM to inspect extra spaces; create an approved category mapping instead of guessing labels. Use ISNUMBER to check actual numeric fields and COUNTBLANK to count empty observations in the correct range. With nine rows in lines 2–10, COUNT(D2:D10) returns seven, SUM returns 154 and AVERAGE returns 22. COUNT(E2:E10) returns seven, and AVERAGE(E2:E10) returns 35.

The raw sheet contains ten rows through line 11, while the working sheet ends at line 10. Choose each formula range accordingly. In Excel, Data → Remove Duplicates is destructive within the selected range; Google Sheets offers Data → Data cleanup → Remove duplicates or Trim whitespace. Both require human review. For more practice see the Notes for SHS data science tools guide.

LocationFormulaExpected result
C2=TRIM(C2)Clean ordinary whitespace
Raw E2:E11=COUNTBLANK(E2:E11)One raw blank
Clean E2:E10=COUNTBLANK(E2:E10)Two trusted blanks
D2=ISNUMBER(D2)Check numeric
D2:D10=COUNT(D2:D10)7
D2:D10=SUM(D2:D10)154
D2:D10=AVERAGE(D2:D10)22
D2:D10=MEDIAN(D2:D10)22
D2:D10=MAX(D2:D10)-MIN(D2:D10)15
E2:E10=AVERAGE(E2:E10)35
C2:C10=COUNTIF(C2:C10,"Science")4
Four spreadsheet cleaning formulas

Optional Python and Pandas Tutorial

Python’s Pandas library can repeat the same documented rules. Read input columns as text, make a working copy, remove exact duplicates, standardize categories with an explicit mapping, create new numeric columns using to_numeric and validate ranges. The original text columns remain available. For a programming introduction, see Learning Python for Data Science.

The errors=’coerce’ option turns unparseable text into missing numeric values in the new column; it does not magically correct twenty. The code flags negative pages and withholds durations outside the project’s trusted review range. Students can compare its output with the hand-calculated mean and the downloaded fully tested version.

import pandas as pd
raw = pd.read_csv("reading_club_raw.csv", dtype=str, keep_default_na=False)
df = raw.drop_duplicates().copy()
club_map = {"science":"Science","arts":"Arts","sport":"Sports","sports":"Sports"}
df["Club_Clean"] = df["Club"].str.strip().str.lower().map(club_map)
df["Pages_Clean"] = pd.to_numeric(df["Pages_Read"], errors="coerce")
df.loc[df["Pages_Clean"] < 0, "Pages_Clean"] = float("nan")
df["Minutes_Clean"] = pd.to_numeric(df["Reading_Minutes"], errors="coerce")
df["Minutes_Trusted"] = df["Minutes_Clean"].where(df["Minutes_Clean"].between(0,240))
print(len(df), df["Pages_Clean"].sum(), df["Pages_Clean"].mean())
print(df["Minutes_Trusted"].sum(), df["Minutes_Trusted"].mean())
df.to_csv("reading_club_checked_copy.csv", index=False)
Pandas cleaning and validation code

Outliers: Keep, Correct or Exclude?

An outlier is unusually far from other observations or from a documented contextual expectation. It might be valid, a measurement error, a typing mistake or genuinely unresolved. Sorting, minimum/maximum checks, simple plots, interquartile-range methods and domain rules help identify values for review; none alone proves that a record is wrong.

The fictional 240-minute review threshold draws attention to R07’s 600-minute observation. Do not silently change 600 to 60 or delete the row. Seek original evidence and, where appropriate, show how a summary changes with and without the flagged observation. Unusual values can be scientifically important.

Reviewing suspicious six hundred minute observation

Validate the Results and Record Every Change

Check the number of rows, uniqueness of IDs, permitted category names, numeric ranges, missing values, dates, totals and accidental losses. The expected results are nine sessions, club totals of 4/3/2, seven validated page counts totaling 154 and seven trusted minute counts totaling 245. Investigate any mismatch against the unchanged raw data.

Keep a cleaning log identifying record ID, issue, action, reason and status. Ask what was changed, why it was justified, what remains unknown and how the result could affect conclusions. More complete-looking data are not necessarily more accurate if someone filled gaps with unsupported guesses.

RecordIssueDecisionStatus
R05Exact duplicateRemove one repeated rowConfirmed
R02 / R04Labels inconsistentScience / ArtsConfirmed
R07Sport categoryStandardize SportsDictionary rule
R03Time blankKeep missingUnresolved
R06-5 pagesValidated pages blankInvalid count
R07600 minutesKeep raw; exclude trusted meanReview pending
R08Text twentyKeep raw; validated pages blankUnverified

Advanced Note: Prevent Machine-Learning Data Leakage

Data leakage occurs when a predictive model uses information during development that would not genuinely be available when forecasting new cases. For instance, computing a mean-imputation value using both training and held-out test records can contaminate the model’s evaluation.

Appropriately split the data and fit learned preprocessing parameters, such as scaling or imputation means, on training data only. Apply those fitted transformations to held-out records. This advanced safeguard differs from basic file-integrity checks and is not required for ordinary descriptive spreadsheet analysis. Scikit-learn documents these common pitfalls.

Protect Privacy and Scientific Integrity

Use fictional or appropriately licensed nonpersonal public datasets. Avoid publicly exposing identifiable student grades, attendance, medical records, family finances, contact information, private messages, login histories or biometric data. Removing names alone may not guarantee anonymity when other identifiers remain.

Follow applicable consent and authorization requirements, minimize data collection, store files securely, limit access and respect copyright or license conditions. Changing numbers to support a preferred conclusion is not data cleaning; it is misrepresentation. A responsible report acknowledges unresolved observations.

Six Student Data Cleaning Project Ideas

Students can practice on fictional reading-club records, licensed public weather observations, invented spending transactions, documented sports results, public environmental measurements or fictional library loans. A project should specify the question, observation unit, common problems, justified method, expected output and privacy safeguards. For more student investigations, see Data Science Projects for High School Students.

A calculator and printed worksheet are sufficient for identifying duplicates, checking ranges and computing valid means. More advanced learners may automate a suitable public dataset with Python. Further ideas are available in Notes for SHS science fair projects, data science projects and research writing tutorials.

ProjectTypical issueOutput
Fictional reading clubDuplicate, outlier, missingValidated summary
Public weatherUnits, date gapsAnnotated chart
Fictional budgetCategory inconsistencyExpense summary
Sports scoresRepeated matchesChecked totals
Public environmental dataMissing sensorsQuality report
Fictional library loansIDs and datesClean ledger

Four-Week Data Cleaning Learning Roadmap

Week one covers quality dimensions and identifying dirty data. Week two practices spreadsheets, duplicate review, trimming spaces, blanks and numeric checks. Week three completes the fictional reading-club project, including its nine-row working copy and verified statistics. Week four validates totals, writes the decision log and explains limitations. For a science fair extension, see How to Use Data Science in Your Science Fair Project.

Students without a computer can use printed records, a pen and calculator. Students who already know Python may run the optional Pandas extension after mastering the calculations. The goal is thoughtful evidence-based decision-making, not memorizing an application menu.

WeekLearning goalDeliverable
1Identify dirty dataData-quality checklist
2Spreadsheet methodsWorking cleaned sheet
3Reading-club projectNine-row validated table
4Validate and explainAudit log and report
Four-week data cleaning learning roadmap

A useful data dictionary for the reading club would say that Record ID identifies a session, Date uses ISO year-month-day format, Club must be Science, Arts or Sports, Pages Read is a nonnegative count and Reading Minutes is a nonnegative duration. It would also distinguish the threshold for reviewing suspicious session lengths from the rule deciding a value is invalid. The former calls for investigation; the latter may justify excluding a value from a particular summary.

An important quality check is to compare information before and after each operation, not only at the end. If the original has ten records and the duplicate review removes more than one, stop and inspect the selected columns. If changing case unexpectedly creates a new club category, check the mapping. Recording intermediate counts helps another student locate an error without rebuilding the entire project.

Missingness can affect interpretation even when calculations are correct. The observed page mean of 22 describes seven validated sessions, not the entire club’s reading behavior. The two unvalidated pages might have been higher or lower. Similarly, a 35-minute trusted average should not be reported as the observed mean of all nine sessions. The number of included observations and the reason for exclusion belong beside each result.

Spreadsheet users should also distinguish numeric blanks from text placeholders such as N/A, Unknown or a dash. COUNT and AVERAGE ignore many text cells, while COUNTBLANK only counts truly blank cells or formulas returning an empty string, depending on the tool. A quality-note column is preferable to entering text inside a numeric summary field. After editing, inspect whether formulas are still referencing the intended nine rows.

A second student may question the decision to exclude 600 minutes. That is useful scrutiny, not a failure of cleaning. The original measurement should be retained, and the analysis can show a trusted summary under the agreed review rule alongside a statement that an unresolved long session exists. If source evidence later confirms 600, the researcher should revisit the calculation and explain the revision.

Conclusion: Make Every Cleaning Decision Reproducible

Data cleaning strengthens research when it improves the reliability of comparisons without disguising uncertainty. Missing is not zero; duplicate identifiers need interpretation; unusual measurements must be checked before they are removed. Spreadsheet formulas and Pandas code support the process, but software cannot replace judgment about what the recorded information means. For reporting your methods clearly, see How to Write a Data Science Research Paper.

The reading-club example preserves ten raw rows, removes one verified duplicate, retains nine unique sessions and calculates a mean of 22 pages and 35 trusted minutes from seven validated observations each. The unresolved text, negative value and long duration remain documented.

Recreate the cleaned table, verify the totals, and submit the raw file, cleaned file and decision log with a short note explaining what remains unknown. If another student can reproduce your calculations, the exercise demonstrates responsible scientific practice.

Ten Student Interpretation Questions

Interpretation questionAnswer
Why remove R05?Confirmed same session twice
Why keep R03 time missing?Unknown is not recorded zero
Why is -5 invalid?Pages Read must be nonnegative
Why flag 600?Illustrative review rule; not proven wrong
Can twenty be converted to 20?Not without source verification
Unique records?Nine
Valid page observations?Seven
Page mean?154 ÷ 7 = 22
Can policy affect results?Yes; it changes analytical subsets
Why retain raw CSV?Audit and reproducibility

Five Knowledge-Check Questions

  1. Raw rows? 10.
  2. Confirmed duplicate? R05.
  3. Unique sessions? 9.
  4. Page median and range? 22 and 15.
  5. Is 600 definitively false? No.

Frequently Asked Questions

1. What does data cleaning mean?

Reviewing, investigating and handling missing values, errors, duplicates and inconsistencies with documented rules.

2. Why is cleaning useful for school projects?

It helps prevent duplicated counts, invalid averages and misleading figures.

3. How do I identify missing values?

Inspect blanks and placeholders, consult the data dictionary and use spreadsheet checks where appropriate.

4. Should all blanks be replaced with zero?

No. Zero is an actual numerical observation, while a blank may mean unknown.

5. How do I remove duplicates?

Compare complete records, retain the raw copy and remove only verified unwanted repetitions.

6. Should outliers always be deleted?

No. Unusual but valid measurements may be important.

7. Can I clean data without Python?

Yes. Excel, Google Sheets and paper-based calculations can complete this lesson.

8. When is data clean enough?

When it meets the stated analysis purpose, checks are documented and unresolved observations remain transparent.

Official Technical References