Data cleaning in python — 10 Essential Steps to Better Data
Practice Data cleaning in python on warehouse receipts. Find inconsistent entries, assign reliable data types, and remove scanner repeats before releasing the monthly intake total.
At Linden Parts, a fictional spare-parts distributor, the receiving supervisor has one afternoon to close the April intake report. Three docks send their scanner exports to the same spreadsheet. When a connection drops, a clerk can resend a receipt. When a scanner is unavailable, the clerk types the entry by hand. The supervisor has spotted a quantity marked “pending” and two spellings of North. A straight sum could count the same arrival twice or leave a real arrival out.
The export contains a receipt number, receiving date, dock and unit count. Each receipt represents one intake event. A receipt number is an identifier, including its leading zeros. The approved docks are East, North and South. A completed intake must have a real calendar date and a positive whole number of units. The supervisor can confirm spelling differences caused by spaces and capital letters. Only the receiving team can confirm an unfamiliar location or an unreadable count.
Your handover must answer one question. How many units can the supervisor release into the April report today? Give a subtotal for each dock, keep the original entries that need someone’s attention, and show where every input row went. A colleague should be able to apply the same rules when the next export arrives.
02
Your role
▥
YOUR ASSIGNMENT
Operations Data Analyst
You are the operations data analyst assigned to receiving. Your first task is to learn what a row represents. Ask the supervisor which differences are only formatting and which differences could mean that two people reported different events. Inspect the file before changing it. A column that looks numerical on screen may still contain text, and an identifier made entirely of digits can still need its leading zeros.
Deliver a working Python reconciliation that another analyst can rerun. Produce one typed table of usable receipts, a separate set of original rows for follow-up, and a count of repeated submissions. Explain how you checked the released total and what evidence the receiving team needs before it can include a held receipt.
03
Identify the problem
What is the core reporting problem, and which data preparation method would you use?
Identify the business outcome, suitable technique and why you would choose it.
Expert Problem Formulation
The supervisor needs a count of units received at each dock. Counting rows answers a different question. A row is one submission, a receipt identifies an intake event, and the units field gives the number of pieces in that event. A repeated submission can change the reported quantity even when every individual number looks sensible.
Data cleaning in python starts here with a small set of rules agreed with receiving. Preserve receipt numbers as text. Normalise spaces and letter case in dock labels. Parse dates and quantities into types that support calendar checks and arithmetic. A parsed quantity still needs a business check because half a spare part or a negative intake falls outside this report’s definition.
Keep the original fields when a row fails any rule. The person investigating an exception needs to see whether the original entry said “pending”, named an unfamiliar dock, or contained an impossible date. Guessing a typical quantity would add unsupported stock to the report.
Compare all four standardised fields before removing repeats. If different valid records still share an ID, stop the release and resolve the conflict. Finally, reconcile the counts of held, repeated and released rows to the original count. The dock subtotals then describe the receipts that passed these checks.
04
Investigate
Ask the right questions before developing your solution.
Q01What exactly should the April report count?
Count individual pieces from completed intake events. A receipt for eight units contributes eight to its dock’s subtotal even though it occupies only one row. The receipt number identifies the event across scanner retries. Two rows with the same quantity on the same day may describe different arrivals, so the date and quantity alone cannot identify a repeat. Ask receiving to confirm that each receipt number belongs to one event and that the export covers April. Keep the report’s scope explicit so a later reader can tell an intake total from the stock currently on the shelf.
Q02Which fields need special treatment at import?
Read all four columns as text first. For example, receipt 00001 must keep its leading zeros so a supervisor can find the matching source document. Examine the distinct dock labels and their frequencies before grouping anything. A leading space is easy to miss on screen, while a quoted representation of the label makes it visible. Dates arrive as year, month and day. Quantities can include a word even when most entries look like integers. Keep an untouched copy so a failed conversion can always be traced back to what the clerk supplied.
Q03Which inconsistencies can we fix automatically?
Spaces around a dock name and differences in capitalisation have an agreed interpretation. Trim the spaces and standardise case before comparing the label with the three approved names. A value such as Annex is different. It might describe a temporary unloading point, but the export gives no approved mapping. Hold that row for review. Apply the same reasoning to quantities. A numeric parser can read 2.5, yet the business accepts only whole pieces. Check both the technical conversion and the operating rule before allowing a value into the report.
Q04How can we check that the cleanup kept the right receipts?
Start with a count reconciliation. Every source row must end in exactly one group: held for review, removed as a repeat, or released. The three counts must add up to the input count. Then check that receipt IDs are unique in the released table and that the units column has an integer type. A count check by itself cannot detect two different receipts accidentally exchanged between groups. Inspect the held IDs and compare the released records with the source. Finally, add the three dock subtotals and check that they give the released unit total.
Q05What should the supervisor do with a held receipt?
Send its original ID and fields to the receiving clerk who can check the delivery note. If the quantity says pending, obtain the counted pieces. If a date is impossible, request the dated source document. For an unfamiliar dock, confirm the authorised location before changing its label. Keep the held receipt outside the current released total until there is evidence for the correction. When a correction arrives, rerun the same checks on the updated source and compare the new release with the previous one. Adding corrected quantities directly to a report could count a resubmitted receipt twice.
receipt_id identifies one intake event. received_on is its calendar date. dock is the unloading location. units counts individual pieces. Each row represents one submitted receipt, including possible retries.
06
Topic Lesson — Data cleaning in python
Explore the topic through interactive visual learning.
TOPIC LESSON
01 / 10
FOUNDATIONS
A value has a spelling and a meaning
A CSV file carries characters. The characters 00001 name a receipt, while the characters 8 measure pieces. Treating both fields as numbers would destroy part of the identifier. Data cleaning in python turns the raw entries into a table whose types and values match the receiving rules. The output also includes the rows that could not be interpreted safely, so someone can investigate them.
00001 → identifier 8 → quantity
Key takeaway: Choose a type by asking what the field means.
CHOOSING A METHOD
Decide what the source allows you to repair
A clerk can confirm that North and NORTH refer to the same receiving dock. That gives you a repeatable rule for correcting the label. Annex has no agreed meaning in this file. A model might guess a dock from nearby rows, but the guess would be weak evidence for a stock report. Use a documented mapping for known variants and ask a person about the remaining exceptions.
Known spelling → standardise Unknown dock → hold
Key takeaway: Automate only the changes the business can justify.
VALUE PROFILING
Inspect labels before grouping
A type check tells you how pandas stores a column. It cannot tell you whether all the labels in that column are legitimate. Count distinct values to see where formatting splits one business group. The North dock appears in three different spellings in this export. Looking at frequencies before changing the values gives you a way to explain why the raw grouping would be misleading.
# Inspect the data type of each source column.
raw.dtypes
# Count rows for each original dock label.
raw["dock"].value_counts()
Key takeaway: Inspect both the storage type and the actual values.
WORKFLOW
Validate first, then compare receipts
Preserve the source and make a working copy. Convert labels, dates and quantities on the copy so equivalent entries can be compared fairly. Put invalid rows aside with their original text. On the accepted rows, compare complete records and retain one copy. Check the remaining IDs for conflicts before you sum any pieces. The order matters because cosmetic differences can hide a repeat in the original export.
Source → parse → validate → deduplicate → total
Key takeaway: Only compare repeated events after standardising their fields.
VALIDATION LOGIC
A usable quantity passes two tests
For the receiving report, a quantity must be greater than zero and have no fractional part. The remainder after division by one detects that fraction. Eight leaves a remainder of zero. Two and a half leaves a remainder of one half. A missing number cannot pass either test. Combine the quantity check with date and dock checks so even one failed requirement sends the original row to review.
valid units = (q > 0) AND (q mod 1 = 0)
Key takeaway: Successful numeric parsing is only the first check.
PYTHON · PREPARE
Convert text without losing the evidence
The first line below parses the source text as a number. The coerce option turns an unreadable token into a missing value so the rest of the batch can still be inspected. The second line selects original rows whose combined validation flag is false. Keeping raw text in that table matters when a clerk needs to distinguish a typed word from a blank or a negative count.
# Convert units to numbers and mark nonnumeric entries as missing.
qty = pd.to_numeric(work["units"], errors="coerce")
# Keep the original entries that failed validation for follow-up.
held = raw.loc[~valid].copy()
Key takeaway: Keep the original token available when conversion fails.
PYTHON · TRANSFORM
Identify resubmissions after standardisation
The first line returns one true-or-false flag per accepted row. By default the first occurrence of each distinct record is kept. The second line constructs a table containing the first occurrence of each complete record. Two receipts at North can have exactly the same quantity and still be different events. Including the identifier in the comparison protects those separate arrivals.
# Flag every exact repeat after its first occurrence.
repeat = accepted.duplicated(keep="first")
# Keep one copy of each distinct accepted row.
clean = accepted.drop_duplicates().copy()
Key takeaway: Use the full standardised receipt to identify a repeat.
EVALUATION
Make every input row accountable
The row balance adds up three mutually exclusive groups. Held rows failed a validation rule. Repeat rows were valid but duplicated an earlier valid entry. Released rows are the distinct accepted records. If the total is short, look for rows dropped between steps. If it is too large, check for overlapping groups. A second test checks that each released ID identifies one receipt.
300 input = 10 held + 6 repeats + 284 released
Key takeaway: Use both a count balance and a unique-ID check.
INTERPRETATION
Read the unit total in context
South has the largest released subtotal in this batch. That tells the supervisor how the accepted intake is distributed. It does not establish that South handled the most physical stock, since held receipts have unresolved quantities or locations. The counts measure pieces received during the reporting period. Stock remaining would also depend on opening balances, transfers, sales and other movements outside this file.
Released units = East + North + South
Key takeaway: Label the total with its scope and reporting period.
BUSINESS DECISION
Release the supported figure and route exceptions
Give the supervisor the released total and its dock breakdown. Send the held source rows to the receiving team with the rule that each entry failed. Keep repeated entries out of the report and retain the original export as evidence. If two distinct accepted records ever share a receipt ID, pause the release until the clerk identifies the right version. Rerun the reconciliation after the corrections arrive.
Release 6,806 units · Follow up on 10 source rows
Key takeaway: Separate the reporting decision from the correction queue.
1 / 10 slides explored
07
Build the solution
Complete the missing Python operations and run your analysis.
Reconcile the April receiving log
Fill each blank with one Python identifier. Use the hint beside a line when you need a clue. The dataset loads automatically when you submit your code.
receiving_audit.py0 / 25 filled
# Import pandas for reading and cleaning the receiving log.
01import as pd
# Read every CSV field as text to preserve receipt IDs and original entries.
# Import pandas for reading and cleaning the receiving log.
import pandas as pd
# Read every CSV field as text to preserve receipt IDs and original entries.
raw = pd.read_csv("receiving_log.csv", dtype="string", keep_default_na=False)
# Record each source column’s data type before making changes.
raw_types = raw.dtypes.astype(str).to_dict()
# Count the original dock labels to spot spelling and spacing differences.
dock_counts = raw["dock"].value_counts().to_dict()
# Make a working copy so held rows can retain their original values.
work = raw.copy()
# Trim spaces and standardize capitalization in the dock labels.
work["dock"] = work["dock"].str.strip().str.title()
# Parse receiving dates and mark unparseable entries as missing.
work["received_on"] = pd.to_datetime(work["received_on"], format="%Y-%m-%d", errors="coerce")
# Convert units to numbers and mark nonnumeric entries as missing.
qty = pd.to_numeric(work["units"], errors="coerce")
# Accept only positive whole quantities, treating missing values as invalid.
valid_units = (qty.gt(0) & qty.mod(1).eq(0)).fillna(False)
# Check each dock against the three approved locations.
valid_dock = work["dock"].isin(["East", "North", "South"])
# Require a valid quantity, an approved dock, and a parsed date.
valid = valid_units & valid_dock & work["received_on"].notna()
# Keep the original entries that failed validation for follow-up.
held = raw.loc[~valid].copy()
# Select the standardized rows that passed every check.
accepted = work.loc[valid].copy()
# Store accepted quantities as nullable integers.
accepted["units"] = qty.loc[valid].astype("Int64")
# Store the accepted dock labels as categories.
accepted["dock"] = accepted["dock"].astype("category")
# Flag every exact repeat after its first occurrence.
repeat = accepted.duplicated(keep="first")
# Keep one copy of each distinct accepted row.
clean = accepted.drop_duplicates().copy()
# Check that no receipt ID remains on two distinct released rows.
assert clean["receipt_id"].is_unique, "Conflicting receipt IDs require review"
# Verify that held rows, repeats, and released rows account for every input row.
assert len(raw) == len(held) + int(repeat.sum()) + len(clean)
# Sum released units for each dock present in the cleaned data.
units_by_dock = clean.groupby("dock", observed=True)["units"].sum()
# Display the original column types.
print("Source types:", raw_types)
# Display the frequency of each original dock label.
print("Raw dock labels:", dock_counts)
# Display the column types after cleaning.
print("Clean types:", clean.dtypes.astype(str).to_dict())
# Report how many rows entered each stage of reconciliation.
print("Input / held / repeats / released:", len(raw), len(held), int(repeat.sum()), len(clean))
# Report each dock’s released units and the combined total.
print("Units by dock:", units_by_dock.to_dict(), "| Total:", int(units_by_dock.sum()))
Complete code walkthrough
LINE 01
Open the table toolkit
# Import pandas for reading and cleaning the receiving log.
import pandas as pd
The import statement loads pandas and gives it the short local name pd. The library provides the DataFrame, a table with named columns, and the Series, a single labelled column. The alias lets the next instruction refer to the CSV reader through a familiar name.
Importing prepares functions for use. At this point Python has neither opened the receipt file nor changed any values.
LINE 02
Read the source as text
# Read every CSV field as text to preserve receipt IDs and original entries.
raw = pd.read_csv("receiving_log.csv", dtype="string", keep_default_na=False)
The reader splits the CSV into four named columns. The dtype argument requests strings for every column, and keep_default_na=False preserves tokens that the reader might otherwise interpret as missing. That makes the export you inspect resemble what the receiving clerk entered.
Receipt 00001 survives as five characters. Automatic number detection could turn it into 1, making a lookup against the original receipt unnecessarily difficult.
LINE 03
Capture the input schema
# Record each source column’s data type before making changes.
raw_types = raw.dtypes.astype(str).to_dict()
The dtypes attribute returns one storage type per column. Converting those type objects to strings and collecting them in a dictionary gives the analyst a readable snapshot. Dictionary keys are column names, so each type stays attached to its field.
The snapshot describes the import policy. Seeing string for units tells you how it is stored now. You still need to inspect the values before deciding which can become integers.
LINE 04
Count the raw spellings
# Count the original dock labels to spot spelling and spacing differences.
dock_counts = raw["dock"].value_counts().to_dict()
Selecting dock returns a Series. Its frequency count groups identical strings and counts their occurrences. The dictionary keeps separate keys for North, north and the version padded with spaces. Quoted keys in the printed output make the extra spaces visible.
Take this count before changing case. Once the labels are standardised, the final table alone cannot show how often the source produced each spelling.
LINE 05
Preserve the original evidence
# Make a working copy so held rows can retain their original values.
work = raw.copy()
A working copy gives later assignments their own table. It starts with the same row labels and values as raw. The row labels will let a Boolean decision made on work select the corresponding original record in raw.
If a calendar conversion fails, the working copy will only show a missing date. The original still holds the exact text that a clerk needs to investigate.
LINE 06
Standardise the dock names
# Trim spaces and standardize capitalization in the dock labels.
work["dock"] = work["dock"].str.strip().str.title()
The str accessor applies a text operation down the column. Strip removes surrounding whitespace. Title then makes the initial letter uppercase in each word. Together these operations put the known spellings of North under a single label before we group or compare records.
This rule is appropriate for the three agreed names in this file. It leaves Annex recognisable as an unfamiliar dock for the membership check.
LINE 07
Interpret calendar dates
# Parse receiving dates and mark unparseable entries as missing.
work["received_on"] = pd.to_datetime(work["received_on"], format="%Y-%m-%d", errors="coerce")
The parser expects year, month and day with the displayed separators. It checks the calendar as part of conversion. April 31 cannot represent an actual day, so the coerce option represents it as a missing date, called NaT in pandas.
Assigning the result to the working column creates a date type that supports calendar operations. The next validation step can distinguish successful parses from failures without losing the original spelling.
LINE 08
Parse the quantity column
# Convert units to numbers and mark nonnumeric entries as missing.
qty = pd.to_numeric(work["units"], errors="coerce")
The numeric converter reads text such as 8 as a number. A word such as pending cannot be interpreted as a count. Coercion gives that position a missing result and lets the pipeline examine the other rows. The new Series keeps the original row labels.
Conversion checks whether a token describes a number. It still accepts negative and fractional values, both of which need a separate business rule here.
LINE 09
Check for positive whole pieces
# Accept only positive whole quantities, treating missing values as invalid.
valid_units = (qty.gt(0) & qty.mod(1).eq(0)).fillna(False)
The greater-than test rules out zero and negative quantities. Taking the remainder after division by one reveals a fractional part. Equality with zero means there is no fractional part. The ampersand combines the two Boolean Series position by position.
A missing number can leave an unknown Boolean in pandas. Filling that flag with False ensures the row reaches the hold queue when the mask is inverted. Otherwise an unknown flag could quietly disappear from both groups.
LINE 10
Check the approved docks
# Check each dock against the three approved locations.
valid_dock = work["dock"].isin(["East", "North", "South"])
Membership compares each standardised label with the receiving team’s approved list. The result is a Series of true-or-false decisions in source order. A padded NORTH has already become North and passes. Annex remains outside the list and fails.
This check represents operational knowledge that the program cannot infer from frequency. A rarely used approved dock still passes, while an unfamiliar location needs confirmation even if it occurs several times.
LINE 11
Combine the three decisions
# Require a valid quantity, an approved dock, and a parsed date.
valid = valid_units & valid_dock & work["received_on"].notna()
The date column’s presence check returns true for a successfully parsed calendar value. Combining that flag with the dock and quantity decisions requires all three conditions on the same row. The resulting mask contains one answer for each source submission.
A row failing two conditions still appears once in the exception set. Counting the union of failed rows avoids double-counting a receipt when reconciling the batch.
LINE 12
Keep rejected source rows
# Keep the original entries that failed validation for follow-up.
held = raw.loc[~valid].copy()
The tilde reverses each Boolean decision. Loc uses that mask against the original table and copy creates the separate review queue. A held record therefore contains the original dock spelling, date and quantity along with its receipt identifier.
This selection depends on raw and work having matching indices. Sorting one table and resetting its index before taking the selection could attach a decision to the wrong source row.
LINE 13
Isolate accepted records
# Select the standardized rows that passed every check.
accepted = work.loc[valid].copy()
The positive mask selects records that met all three rules. Here the selection comes from work, so its dates and dock spellings already contain the successful transformations. An explicit copy gives the next assignments a well-defined destination.
At this stage accepted still includes legitimate-looking scanner retries. Passing the field rules qualifies a record for comparison, though the receipt may already be represented by another valid row.
LINE 14
Store counts as whole numbers
# Store accepted quantities as nullable integers.
accepted["units"] = qty.loc[valid].astype("Int64")
Selecting qty with the same mask retrieves just the parsed numbers for accepted rows. The cast gives them the pandas nullable integer type Int64. Assignment aligns row labels, so the converted count goes back onto its own receipt.
Casting before validation can fail on a fractional value. Rounding 2.5 would allow a made-up count into stock. The order here lets the receiving team settle that record.
LINE 15
Encode the approved dock names
# Store the accepted dock labels as categories.
accepted["dock"] = accepted["dock"].astype("category")
The category type stores a vocabulary of labels and a code for each row. Grouping can still use readable names while the representation captures the fact that dock is a category. The converted Series replaces the text column on accepted.
The earlier membership rule established which labels were allowed. Casting arbitrary text to category alone would simply add every observed spelling to the vocabulary, including unwanted variants.
LINE 16
Flag repeat submissions
# Flag every exact repeat after its first occurrence.
repeat = accepted.duplicated(keep="first")
The duplicate detector compares all columns and returns one Boolean per accepted row. The first matching record receives false and later copies receive true. The DataFrame index is outside this comparison, which matters because a scanner retry occupies a different input row.
Summing the flags later counts the excess submissions. If a receipt appears three times with identical fields, the detector marks the second and third copies.
LINE 17
Build the released table
# Keep one copy of each distinct accepted row.
clean = accepted.drop_duplicates().copy()
Removing duplicates applies the same full-row comparison and keeps the first occurrence by default. The new table therefore contains one instance of each standardised receipt. Copy makes it available for independent checks and reporting.
Dropping duplicates using only the dock and number of pieces would merge unrelated arrivals. Using only the ID would also conceal two versions of one receipt that disagree about the quantity.
LINE 18
Stop on conflicting receipt IDs
# Check that no receipt ID remains on two distinct released rows.
assert clean["receipt_id"].is_unique, "Conflicting receipt IDs require review"
The uniqueness property checks the ID column of the released table. An assertion stops execution if a repeated ID remains. Because identical records were already collapsed, a repeated ID here signals a difference in at least one other accepted field.
The analyst cannot establish the right version from arrival order alone. The assertion makes that limitation visible before any dock total is presented to the supervisor.
LINE 19
Reconcile the row counts
# Verify that held rows, repeats, and released rows account for every input row.
assert len(raw) == len(held) + int(repeat.sum()) + len(clean)
A Boolean true contributes one when summed, so repeat.sum() counts the surplus valid copies. Adding that count to the held and released lengths should recover every source row. The assertion halts the program if those two sides disagree.
In this export the balance is 300 = 10 + 6 + 284. This checks row accounting. A separate check and inspection of receipt IDs are needed to confirm that the correct rows went into each group.
LINE 20
Add the units within each dock
# Sum released units for each dock present in the cleaned data.
units_by_dock = clean.groupby("dock", observed=True)["units"].sum()
Grouping partitions the released receipts by their standardised dock. Selecting units identifies which measurement to aggregate. Summation then produces a Series indexed by dock name. The observed option requests only category labels represented by released rows.
Each receipt now contributes its positive whole count exactly once. Counting rows instead would measure the number of receipts per dock, which answers a different question from the supervisor’s unit request.
LINE 21
Display the original types
# Display the original column types.
print("Source types:", raw_types)
Print writes a label followed by the dictionary captured at import. This records what the analysis started with, even though columns in the working table have since changed. There is no assignment on this line and the call leaves the tables untouched.
Read this output alongside the clean types printed later. Receipt IDs should remain strings across the two snapshots while dates and counts acquire types suited to their purpose.
LINE 22
Show the original labels
# Display the frequency of each original dock label.
print("Raw dock labels:", dock_counts)
This print call exposes the frequency dictionary saved before normalisation. For example, the North label appears 83 times in title case, 14 times padded and uppercase, and four times lowercase. These are counts of input submissions, including any repeats.
The numbers explain why a raw grouping is unreliable. They are distinct from the quantity subtotal, which uses pieces on released receipts after all validation and duplicate checks.
LINE 23
Display the released schema
# Display the column types after cleaning.
print("Clean types:", clean.dtypes.astype(str).to_dict())
Reading the final dtypes reports the actual representation of the released fields. A dictionary lists the receipt ID as text, the receiving day as a datetime, the dock as a category and the quantity as Int64. Pandas versions can display different datetime resolutions.
Check these types before passing the table to another analyst. An integer quantity aggregates numerically, and a calendar date can support later work such as grouping intake by week.
LINE 24
Report the batch reconciliation
# Report how many rows entered each stage of reconciliation.
print("Input / held / repeats / released:", len(raw), len(held), int(repeat.sum()), len(clean))
The printed counts use a fixed order that matches the labels. The raw length measures source submissions, held measures exceptions, the flag sum measures repeated copies, and the clean length measures usable distinct receipts. Python prints the actual values calculated in this run.
This line makes the earlier assertion understandable to someone reading the execution log. In particular, ten held rows means ten source records to investigate, regardless of how many individual fields need correction.
LINE 25
Publish the unit totals
# Report each dock’s released units and the combined total.
print("Units by dock:", units_by_dock.to_dict(), "| Total:", int(units_by_dock.sum()))
Converting the grouped Series to a dictionary pairs each dock label with its released unit count. Summing the Series once more combines the three dock subtotals. The integer conversion gives the printed total a plain whole-number representation.
The resulting 6,806 units are supported by the released receipts. An unresolved quantity in the hold queue contributes nothing yet. If receiving supplies a corrected document, rerun the reconciliation before changing the reported figure.
Verified reference output
Source types: {'receipt_id': 'string', 'received_on': 'string', 'dock': 'string', 'units': 'string'}
Raw dock labels: {'South': 84, 'East': 84, 'North': 83, ' NORTH ': 14, ' SOUTH ': 14, ' EAST ': 13, 'north': 4, 'Annex': 2, 'south': 2}
Clean types: {'receipt_id': 'string', 'received_on': 'datetime64[ns]', 'dock': 'category', 'units': 'Int64'}
Input / held / repeats / released: 300 10 6 284
Units by dock: {'East': 2231, 'North': 2269, 'South': 2306} | Total: 6806
284Receipts released
10Source rows held
6Repeat submissions
The three dock subtotals describe 284 distinct, usable receipts. South accounts for 2,306 units, North for 2,269 and East for 2,231. Counting submissions would mix physical intake with scanner retries. Grouping the original dock labels would also split North into several apparent locations.
Ten source rows still need evidence. Six have invalid quantities, two have impossible dates, and two name an unapproved dock. Because all ten rows are outside the released table, the batch supports a confirmed intake figure while the final physical intake remains open to correction.
BUSINESS RECOMMENDATION
6,806 units
Release the validated April intake
284 unique receipts across three approved docks
Release 6,806 units into the April receiving report, with a subtotal for each approved dock. Label the figure as intake from validated receipts. The row reconciliation accounts for the entire export and the final ID check shows that every released receipt contributes once. Keep the six repeat submissions in the original file so a colleague can retrace the decision.
Assign the ten held rows to receiving for follow-up. Ask for the delivery note on date exceptions, a confirmed count on quantity exceptions, and an approved dock on location exceptions. After the clerk supplies evidence, rerun the batch and document the change in the release total.
08
End of the lesson
Reflect on your learning experience.
How was your learning experience?
Select a rating
Explore more lessons
Continue building practical skills with other interactive labs.
APPLIED DATA ANALYTICS
Data Joining in python — 3 Essential Checks for Better Parcel Pricing
Data Joining in python with pandas. Stack parcel manifests, merge zone tariffs, verify every shipment and reconcile delivery charges in an interactive coding lab.
Group by data analysis in Python: 10 Powerful Steps to Success
Learn Group by data analysis in Python through 10 visual lessons, a real-world retail project, pandas exercises, revenue summaries and profit analysis.
Missing value in Python — 10 Essential Steps to Better Data
Learn to detect a Missing value in Python and use SimpleImputer to repair a delivery dataset. Explore 10 visual slides and run a hands-on Python exercise.
Pivot data analysis in Python — 10 Practical Steps to Better Decisions
Learn Pivot data analysis in Python with 10 visual lessons. Build pandas pivot tables from dispatch records, check late rates, and recommend a depot review.