Six rows, four sessions: define a duplicate before removing it
Counting rows is easy. Deciding what each row represents takes a little more care. A study log can contain repeated-looking entries for different reasons: two separate sessions may have the same duration, or one session may have been imported twice. Those situations call for different treatment.
This original Academia Master Trader workshop uses a small fictional log. It contains no real learner records or course results. Our aim is to write a clear counting rule, test it against known records and preserve enough information to explain every change.
Start with six rows
Make a table with two columns: session identifier and minutes. Enter these six rows in order:
- S01, 20 minutes.
- S02, 30 minutes.
- S02, 30 minutes.
- S03, 20 minutes.
- S04, 40 minutes.
- S04, 40 minutes.
For this exercise, the log owner confirms two facts. Each session identifier names exactly one completed session. The second appearance of S02 and the second appearance of S04 are accidental copies from the same import. We are not inferring those facts from the numbers alone; they are part of the fictional record description.
Adding all six rows gives 180 minutes. Dividing by six gives a row-level average of 30 minutes. That calculation is correct for the six rows as stored, including their confirmed copies. It does not yet describe the four distinct sessions.
Write the removal rule first
Our rule is specific: within this file, keep one copy of a row when the session identifier and recorded duration are both identical, provided that the extra row has been confirmed as an import copy.
Applying that rule leaves S01, S02, S03 and S04 once each. Their durations are 20, 30, 20 and 40 minutes. The total is 110 minutes and the average is 27.5 minutes per session.
Write both the original and cleaned row counts in a change note: six source rows, two confirmed copies removed, four sessions retained. Keep the original file unchanged and work on a separate copy. In this exercise, that makes it possible to reconstruct how the total changed from 180 to 110.
Equal durations are not duplicate sessions
Notice that S01 and S03 both last 20 minutes. They have different identifiers and represent separate sessions. Removing one simply because its duration matches another would discard a valid observation.
If we kept just one instance of each duration, we would retain 20, 30 and 40. Their sum would be 90 and their average would be 30. Those are summaries of distinct duration values, not summaries of all distinct sessions in our file. The answer to one question cannot silently replace the answer to the other.
The phrase remove duplicates is therefore incomplete. Duplicate according to which fields, for which unit of observation, and with what evidence?
Pause when repeated identifiers disagree
Now imagine an extra row labeled S02 with 35 minutes. Do not choose between 30 and 35 merely because one appears later in the file. File order alone does not establish which entry is correct.
Our original rule covers confirmed identical import copies. It does not settle a disagreement about the duration of one session. That new case needs a separate check against the source record or a documented correction rule. Until then, mark the conflict rather than quietly selecting a value.
Make the unit visible
Finish your worksheet with two labeled summaries: the six stored rows before cleaning, and the four distinct sessions after removing confirmed copies. Add the selection rule and a short list of changes.
A useful check is to ask someone else to recreate your cleaned list from the original and your written rule. If they cannot tell why S02 lost one row while S01 and S03 both remained, improve the explanation before interpreting the average.
Academia Master Trader is a Brazilian educational project. Domain: academiamastertrader.com.br. Continue learning at Aprenda.