Sub topic 8
Clean up the log at the end of the week
This chapter assumes you have seven days of log entries in the format from the earlier chapters: one row per activity, with a date, start, end, category, short note, and energy rating. It also assumes you can read a simple spreadsheet or CSV file. The Python examples are optional, because you can do every step by hand in a spreadsheet.
Why cleanup comes before totals
Totals only mean something if each row is a true, non-overlapping slice of time with a consistent label. A raw week-long log almost never meets that standard. You log in a hurry, forget to close an entry, label the same activity two ways, and sometimes record two things at once.
If you total the raw data, three kinds of error end up in your percentages:
- Overlaps count the same minutes twice, so a category looks bigger than it was.
- Gaps leave minutes uncounted, so every percentage shifts.
- Inconsistent labels split one activity across two categories, so each looks smaller than it was.
Cleanup fixes these before you calculate anything. The goal is a log you trust enough to base a decision on, not a perfect one.
Step 1: Back up the raw log
Before changing anything, copy the file. In a spreadsheet, duplicate the sheet and name it raw. With a CSV, copy time_log.csv to time_log_raw.csv.
The raw copy matters for two reasons. If you make a bad edit, you can recover. It also lets you see later how much your cleanup changed the data. If you edited 40% of the rows, the log was weaker than you thought, and that is useful to know when you decide how much to trust the results.
Work only on the second copy from here on.
Step 2: Check each row is valid
A valid row has a real date, a start time earlier than its end time, a category from your list, and an energy rating from 1 to 5. Note that a row can have a valid time range and still be wrong. "09:00 to 10:30" is valid even if you really worked until 09:45.
Start with the mechanical checks, because a script or a spreadsheet filter can find them quickly. Then look at the substantive ones yourself.
Common row-level errors:
- End before start. Usually a typo, such as
11:30to10:15when you meant12:15. It can also mean the entry crossed midnight. - Entries crossing midnight. The summary script from the Topic Spine assumes no entry crosses midnight. Split a late-night entry into two rows, one ending at
23:59and one starting at00:00on the next date. - Missing end times. You started something and never closed it. Fill the end from the next entry's start only if you are sure nothing happened in between.
- Energy out of range. A
0or a6is almost always a slip. Correct it if you remember the right value. Otherwise leave it blank, because a guessed rating is worse than none.
Step 3: Fix overlaps
An overlap is two entries that cover some of the same minutes. For example, 09:00 to 10:30 followed by an entry that starts at 10:15. Fifteen minutes are counted twice.
Overlaps usually have one of three causes. Choose the fix by cause, not by what is quickest.
| Cause | Example | Fix |
|---|---|---|
| Sloppy boundary | Entry A ends 10:30, entry B starts 10:15 | Decide which time is right and move one boundary |
| Real multitasking | Reading email during a meeting | Assign the minutes to the main activity. Put the secondary activity in the note |
| Entry left open | Deep work never closed, later entries inside it | Set the end to when the next distinct activity began |
Pick one rule for multitasking and apply it all week. A good rule is "the activity that would suffer most if I stopped is the primary one." Without a rule, the same situation gets different labels on different days.
If the multitasking is frequent, do not just hide it. Put a note such as half-attention on the row. In the pattern-finding chapter, that note shows how much of your "meeting" time was split. That is often a finding in its own right.
Step 4: Handle gaps
A gap is time between one entry's end and the next entry's start that no row covers. Small gaps of a few minutes are normal. They are walking, getting coffee, and switching tasks. Large gaps usually mean you forgot to log.
Decide in advance what counts as a gap worth fixing. A threshold of 10 minutes works for most people. Below it, leave the gap alone or fold it into the neighbouring entry. At or above it, deal with it explicitly:
- Reconstruct it if you can do so from evidence: your calendar, sent messages, browser history, or a file's modified time. Evidence is better than memory.
- Label it
unloggedif you cannot. This is an honest answer. - Never invent it. Filling a 45-minute hole with a plausible-sounding "deep work" makes your best-looking category larger and your audit less useful.
Keeping unlogged as a real category has a second benefit. Its share tells you how complete the log is. If 4% of your waking hours are unlogged, the percentages are sound. If it is 30%, treat every other number as rough and say so when you draw conclusions.
Sleep and time outside your audit scope are not gaps. If you defined scope as 07:00 to 22:00, the hours outside it are simply out of range and should not be filled.
Step 5: Standardize categories
By the end of the week, you will have drifted. You may have written Email, email, comms, and communication for the same thing. A computer treats each as a separate category, and so does a spreadsheet pivot table.
There are two kinds of fix:
- Spelling fixes. Map every variant to the one name on your list. Do this with find and replace, or a mapping table.
- Judgment fixes. Some entries fit two categories. "Prepare slides for the meeting" could be
meetingsordeep_work. Write down a rule once, for example "preparation goes with the work it produces, not the event it serves", and then apply it to every such row.
Keep a short rule list at the top of your notes. It should be just a few lines, such as:
- Preparation for a meeting is
deep_workif it produces a document, otherwisemeetings. - Chat is
communicationunless it happens inside a scheduled call. - Anything under 5 minutes joins the neighbouring entry.
If one category is a dumping ground, with a large share of vague entries labelled other or admin, that is a signal. Your category list may be too coarse. You can split it now and re-label the affected rows, but only if you can still tell from the notes what each row was.
A script that finds the problems
You can find most of the issues above with a short script. This one reads the CSV in the Topic Spine's format and reports unknown categories, rows where the end is not after the start, overlaps, and gaps of 10 minutes or more. It does not change the file. You still decide each fix.
import csv
from datetime import datetime
ALLOWED = {"deep_work", "communication", "meetings", "admin", "personal", "unlogged"}
MIN_GAP_MINUTES = 10
FMT = "%Y-%m-%d %H:%M"
def load(path):
rows = []
with open(path, newline="") as f:
for line_no, row in enumerate(csv.DictReader(f), start=2):
row["line"] = line_no
row["start_dt"] = datetime.strptime(f"{row['date']} {row['start']}", FMT)
row["end_dt"] = datetime.strptime(f"{row['date']} {row['end']}", FMT)
rows.append(row)
return rows
def check(rows):
problems = []
for row in rows:
if row["category"] not in ALLOWED:
problems.append((row["line"], f"unknown category '{row['category']}'"))
if row["end_dt"] <= row["start_dt"]:
problems.append((row["line"], "end is not after start"))
ordered = sorted(rows, key=lambda r: r["start_dt"])
latest = {} # date -> row with the latest end seen so far that day
for row in ordered:
prev = latest.get(row["date"])
if prev is not None:
gap = (row["start_dt"] - prev["end_dt"]).total_seconds() / 60
if gap < 0:
problems.append(
(row["line"], f"overlaps line {prev['line']} by {-gap:.0f} min")
)
elif gap >= MIN_GAP_MINUTES:
problems.append(
(row["line"], f"{gap:.0f} min gap after line {prev['line']}")
)
if prev is None or row["end_dt"] > prev["end_dt"]:
latest[row["date"]] = row
return sorted(problems)
if __name__ == "__main__":
for line, message in check(load("time_log.csv")):
print(f"line {line}: {message}")Suppose time_log.csv contains this:
date,start,end,category,activity,energy
2026-03-03,09:00,10:30,deep_work,Draft report,4
2026-03-03,10:15,10:45,Comms,Email,3
2026-03-03,11:30,12:15,admin,Expense reports,2The script prints:
line 3: unknown category 'Comms'
line 3: overlaps line 2 by 15 min
line 4: 45 min gap after line 3Line numbers refer to the file, where line 1 is the header. That makes them easy to find in a text editor. In a spreadsheet, the row number matches because the header is row 1.
The script tracks the entry with the latest end time so far, not just the previous row. This catches a long entry that swallows several short ones, which comparing only neighbours would miss.
Step 6: Re-check and record what you changed
After your edits, run the checks again. Fixing one overlap can expose a gap, and fixing a spelling can reveal a second unknown label. Repeat until the check prints nothing.
Then write a two-line cleanup note at the top of your analysis file. For example: "Fixed 6 overlaps, labelled 140 minutes unlogged, merged 3 category spellings." You will want this when you read your results next week, and when you compare with a future audit.
Common mistakes
- Cleaning too aggressively. Rounding every entry to neat half-hour blocks makes the log look tidy and makes it less accurate.
- Deleting awkward rows. A row for time you are embarrassed by, such as 50 minutes of scrolling, is the most useful row you have. Keep it and label it truthfully.
- Changing categories after seeing the totals. If you move rows between categories to produce a better-looking result, you are no longer measuring. Settle the rules before you calculate.
- Skipping the backup. Without the raw copy, you cannot undo or measure your edits.
Exercise
A log has an entry from 14:00 to 15:30 labelled meetings, and the next entry, labelled communication, runs from 15:10 to 15:40. You remember that you stayed in the meeting until 15:30 but answered chat messages during the last 20 minutes. Name the problem and give two reasonable ways to fix it, including which you would choose under the rule "the activity that would suffer most if I stopped is the primary one."
Show answer
The problem is a 20-minute overlap (15:10 to 15:30), so those minutes would be counted twice. One fix is to move the start of the communication entry to 15:30, so it covers 15:30 to 15:40, and add a note such as half-attention to the meeting row. The other is to keep both entries but cut the meeting to end at 15:10, which would undercount the meeting. Under the stated rule, the meeting is primary because stopping it would cost more than pausing the chat. Choose the first fix and record the multitasking in the note.
Exercise
Your log covers 07:00 to 22:00 for each of seven days, which is 105 hours. After cleanup, 21 hours are labelled unlogged. What share of the log is unlogged, and how should that affect how you read the other percentages?
Show answer
21 / 105 = 20%. One fifth of the scoped time is unknown, so the other category percentages describe only 80% of your waking hours. Treat them as rough, and avoid conclusions that depend on small differences between categories. Say in your notes that the log is incomplete. If you can, log more carefully in the follow-up audit.