Sub topic 11
Look for patterns across days
This chapter assumes you have a cleaned seven-day log in the CSV format from earlier chapters, with date, start, end, category, activity, and energy columns. It also assumes you have already calculated hours and percentages per category. Totals tell you how much time each category took. Patterns tell you when and under what conditions it happened.
Why totals are not enough
A weekly total hides how the hours were spread out. Ten hours of deep work could be five two-hour blocks, or one long day and four days with almost none. Those weeks feel very different, and they call for different changes.
You are looking for three kinds of pattern:
- Day patterns: which days gain or lose time in a category.
- Time-of-day patterns: when in the day each category tends to happen.
- Energy patterns: which categories and times go with high or low energy ratings.
Build a day-by-category view
Start by splitting each category's hours by date. The script below extends the earlier summary. It prints a table with one row per category and one column per date.
import csv
from collections import defaultdict
from datetime import datetime
by_day = defaultdict(lambda: defaultdict(float))
dates = set()
with open("time_log.csv", newline="") as f:
for row in csv.DictReader(f):
start = datetime.strptime(row["start"], "%H:%M")
end = datetime.strptime(row["end"], "%H:%M")
hours = (end - start).total_seconds() / 3600
by_day[row["category"]][row["date"]] += hours
dates.add(row["date"])
dates = sorted(dates)
print("category".ljust(16) + "".join(d[5:].rjust(8) for d in dates))
for category in sorted(by_day):
cells = "".join(f"{by_day[category][d]:8.1f}" for d in dates)
print(category.ljust(16) + cells)The script uses a nested defaultdict, so a day with no entries in a category prints as 0.0. Dates are printed as month-day (for example 03-02) to keep the columns narrow.
Read the table
Scan each row for the largest and smallest cells, then ask what was different about those days. Check these things:
- Does a category spike on one day, such as meetings on Tuesday? A spike may be a fixed commitment, which you can plan around.
- Does a category disappear on some days? Deep work that never appears on meeting-heavy days suggests the meetings are crowding it out.
- Do weekdays look alike? If they do, your routine is stable and a change will be easy to measure. If they differ a lot, a single "typical day" does not exist and you should plan per day.
Add time of day and energy
Next, compare the start times and energy ratings. Look at your log for the morning, midday, and afternoon. A simple check is to average the energy rating by category.
import csv
from collections import defaultdict
energy = defaultdict(list)
with open("time_log.csv", newline="") as f:
for row in csv.DictReader(f):
energy[row["category"]].append(int(row["energy"]))
for category, values in sorted(energy.items()):
print(f"{category}: average energy {sum(values) / len(values):.1f}")An average hides how many entries stand behind it. A category with two entries is weak evidence. Treat a pattern as real only if it shows up on at least three days.
Common errors
- Over-reading one day. A sick day or a deadline makes one column unusual. Mark such days as exceptions and judge patterns from the rest.
- Confusing a fixed commitment with a habit. A weekly meeting on Tuesday is a schedule fact. A habit of checking email every ten minutes is something you can change.
- Ignoring the observer effect. Early in the week you may behave better because you are logging. If Monday and Tuesday look different from Thursday and Friday, say so in your notes.
- Comparing days with different amounts of logged time. If one day has gaps, its totals are lower for that reason alone.
Exercise
Your table shows 6 hours of meetings on Wednesday and about 1 hour on every other weekday. Deep work on Wednesday is 0.5 hours, and it is 2 to 3 hours on other days. What pattern can you record, and what should you check before you act on it?
Show answer
The pattern is that heavy-meeting days coincide with almost no deep work. Before acting, check that the Wednesday log has no large gaps that would lower its totals, and whether the meetings are a fixed weekly commitment. Also check whether the pattern holds on other heavy-meeting days. One Wednesday is a single observation, so treat it as a hypothesis for the follow-up experiment.