P3-2.3 What Should Be Written Down First When a New Table Arrives¶
Section ID:
P3-2.3Version:v2026.09.19
When a new table first arrives, it is easy in many cases to think first of averages, distributions, or model candidates. But what should be written down before that is what does one row of this table mean?, what can be grouped together?, and what is still missing? Only after these three are organized can we distinguish whether what is in hand is already a sample table that can be compared directly, or still raw records that must be regrouped. Rather than deciding immediately whether a new table is a training dataset, it helps interpretation more to write down these three points first. Once they are written down, later sample design and dataset redesign also become much less abstract.
The viewpoint that must be held first here is format consistency and the first data quality check. Format consistency means checking first whether keys that refer to the same object are written in the same format, whether time columns are in a form that really allows order to be read, and whether values with the same meaning are mixed across columns with different units or string rules. The first quality check is the next stage after that. It means checking early whether there are problems that immediately break comparison structure, such as missing values, broken order, duplicate rows, or orphan rows that do not group cleanly.
When a new table is read for the first time, it is safer to write down first what is one row?, what can be grouped?, and what is still missing? The question what is one row? connects to checking the observation unit in statistics and data organization. What can be grouped? connects to the principle that in time data, key and index should be made visible first. The item about preserving raw evidence also connects to the principle that data provenance and traceability must remain available so that quality and reliability can be judged again later.
If the same five-line memo is reread from the perspectives of format and quality, it becomes the following.
| Check perspective | What to check first | Why it has to be caught early |
|---|---|---|
| Format consistency | Are key formats consistent, are time columns sortable, and are units or notation rules unmixed? | Because if the same object is read as different ones or time order is misread, every later comparison will drift |
| First quality check | Are there missing values, duplicates, broken order, or rows that cannot be grouped? | Because cases that are already incomparable should be marked separately before sample reconstruction |
The first five things to write down¶
When a new table is read for the first time, it is safer to write down the following five questions first. They are the minimum checks that keep us from missing row unit, grouping criterion, time structure, comparability, and raw evidence.
- What does one row mean?
- What identifier groups the same object together?
- Is there a column that shows time order or process order?
- Is the current unit directly comparable, or does it need to be regrouped?
- If something looks strange, what is the raw evidence to return to?
Condensed into a table, those five become the following.
| Item to write down first | Why it is needed |
|---|---|
| Row meaning | Because we must distinguish whether it is a time-point record, one full action, or a recent-segment aggregate |
| Identifier | Because we need to know whether multiple lines belong to the same sample |
| Time/order column | Because we must decide whether it is a time-series structure or a static table |
| Comparability | Because we must decide whether samples can already be compared directly, or whether a summary table is needed first |
| Raw-evidence location | Because strange cases must remain traceable later |
Writing down only these five items already reduces how often storage structure and problem-representation structure are mixed together when read.
The order in which the five items are read also matters. Row meaning, identifier, and time/order column belong to the axis that checks format consistency first. Comparability and raw-evidence location belong to the axis that moves into the first quality check. Writing them down this way lets us separate, in order, whether the format is wrong first or the format is fine but quality problems still break comparison, instead of vaguely saying that the quality looks bad.
A wrong start and a better start¶
| What is easy to do as soon as the table is seen | Why it is too early | A better first action |
|---|---|---|
| Compute averages and maxima first | One row and one sample unit may still differ | Write down the row meaning and identifier first |
| Think of classification or regression | The unit that would receive the label may not yet be visible | Check first whether the unit is directly comparable |
| Think of time-series deep learning | Even if a time column exists, the sample boundary may still be unfixed | Check the time/order column and grouping criterion first |
| Attach meaning immediately to one strange value | That one line may not represent the whole sample | Write down the raw evidence and candidate summary structure together |
So the first stage is closer to identity checking than to calculation.
Checking Row Meaning and Comparability¶
When a new table is read for the first time, it is safer to close it in the order row meaning -> grouping criterion -> format/quality checks -> decide on restructuring or source checks.
flowchart TD
A[Read the new table for the first time] --> B[Write what one row means]
B --> C[Find the key and time/order columns]
C --> D[Check format consistency]
D --> E[Run the first quality check]
E --> F{What does the comparison question require}
F -- Restructure units or storage order --> G[Sort a copy or group by sample]
F -- Quality or conditions unverified --> I[Hold comparison and check sources and conditions]
F -- Current structure and conditions suffice --> H[Compare using the current table]
A very short table-reading memo¶
If the following five lines are written down first, the table's identity and comparability can be separated quickly.
- One row means
_____. - The key that groups the same object is
_____. - The column showing time or process order is
_____. - The comparison question is
_____; the required restructuring and conditions still to verify are_____. - The raw evidence to revisit strange cases is
_____.
For example, to compare mean flow across actions using the CSV below, write:
- One row means
a measured value at one time point during the action. - The key that groups the same object is
event_id. - The time column is
elapsed_seconds. - Comparing action-level means requires grouping by
event_id; full action coverage and matching operating conditions remain unverified. - The raw evidence to revisit strange cases is the raw log by
event_id.
Once this five-line memo exists, even the sentence redesign the dataset to match the question in Chapter 3 reads far less abstractly.
Going just one step further, format consistency and the first quality check can be written separately.
- Format consistency: first check whether
event_idgroups the same action in a consistent format, and whetherelapsed_secondsallows time order to be read. - First quality check: check whether some
event_idvalues have abnormally few or many rows, whether time goes backward or has missing segments, and whether there are missing values that should be marked before comparison.
Order Errors and Cases That Need Source Checks¶
The contrasts below copy and modify A’s first three records from the CSV used later. The original (time, flow) pairs are (0, 0.80), (1, 0.92), (2, 1.05), in seconds and L/min. We assume a 1-second sampling interval for this small segment. The original CSV stays unchanged.
| Change to the copy | What changed | Next action |
|---|---|---|
| None: 0→1→2 seconds | Order and spacing match this segment’s assumptions | Continue checking other quality items |
| Reverse only the rows to 2→1→0 seconds | Timestamps and measurements stay the same; storage order changes | Check timestamp meaning, then sort a copy |
| Append an identical 1-second record | The same event, time, and measurements repeat | Check the source for repeated collection before deciding how to handle it |
| Append a 1-second row with flow changed to 9.00 | Values 0.92 and 9.00 conflict at the same event and time | Hold the event summary and check the source |
| Remove the 1-second record: 0→2 seconds | Time increases but leaves a gap in the expected spacing | Check the source for missing records; do not fill with zero arbitrarily |
Repeated event_id values are needed to group an event’s time-point records. The suspected duplicate here is a repeated (event_id, elapsed_seconds) pair. If a real log contains multiple sensors, first check whether sensor identity must also be part of that key. Sorting changes order; it neither selects the correct conflicting value nor recovers a missing measurement.
Record the file path, version or collection time, original row number, and event identifier in the source note. In the derived table’s processing history, record which rows were sorted, excluded, or held, and why. For A’s conflicting 1-second values, for example, inspect CSV data row 2 (file line 3 including the header) alongside the added conflicting row. Keep the original so that the records before and after processing can be compared.
Checking Row Counts, Time Order, and Duplicates Separately¶
Problem situation: when a new log table arrives, check whether it can already be read directly as a sample-comparison table.
Input: the raw log table stored in p3_2_3_first_table_log.csv, and minimum_rows_per_event, the minimum row count used as an observation-count condition
Expected output: check which events pass the row-count condition, then distinguish sorting from checking the source when order, duplication, values, or missing records change in the same three-record segment.
Concept to check: one row may not be one event. Passing a row-count condition does not certify complete event coverage or comparability; even correctly ordered records need separate checks for duplicates, gaps, and differences in conditions.
Expected output: check which events pass the row-count condition, then distinguish sorting from checking the source when order, duplication, values, or missing records change in the same three-record segment.
In steps 1 and 2, has_time_order checks only whether the order read from the file strictly increases within each event. Repeated timestamps and reversed order both yield no, but their causes differ. Missing an intermediate record, as in 0→2 seconds, still passes this increasing-order check.
With minimum_rows_per_event at 12, A and B pass the row-count condition; lowering it to 6 lets A, B, and C pass. enough_rows=True reports only that condition. Duplicate rows also count, so it does not establish enough unique observations or coverage of the full action. Start and end records, sampling intervals, and operating conditions need separate checks.
In step 4, observed_span is the last observed time minus the first observed time. A’s 17s means that observations span 0–17 seconds, not that the action ended after 17 seconds. Mean flow and peak pressure summarize available records; they do not certify immediate comparability.
Step 5 experiments on copies of only A’s first three records. reversed changes only order, so the result is sort_copy; duplicates, conflicts, and missing-record cases yield check_source. Hold the summary for a conflicting case until its source is checked. gap checks this experiment’s 1-second interval assumption, not missing records before or after the segment or missing cell values. continue_checks does not mean every quality check has passed.
Try changing the added flow in conflict from 9.0 to its original value, 0.92. Although conflict becomes False, duplicate_time stays True, so checking the source is still necessary. Then restore the 1-second record in missing: gap becomes False. Even when cases share an order-warning signal, write down their different causes and next actions.
Checklist¶
- Did you write five lines identifying row meaning, identifiers, time columns, comparison conditions, and original evidence?
- Can you distinguish repeated event identifiers from duplicate event-and-time pairs?
- Can you explain when reversed order, conflicting values, or missing records call for sorting, holding a summary, or checking the source?
- Do you distinguish passing a row-count condition and measuring an observed span from evidence of full event coverage?
- Did you record the original file and row location and preserve the derived table’s processing history?
Sources and Further Reading¶
- Hadley Wickham,
Tidy Data, Journal of Statistical Software 59(10), 2014. Because it distinguishes variables, observations, and table structure, it supports this section's starting point thatwhat one row meansshould be written down first. https://www.jstatsoft.org/article/view/v059i10 / Accessed: 2026-07-20 - Earo Wang, Dianne Cook, Rob J. Hyndman,
A New Tidy Data Structure to Support Exploration and Modeling of Temporal Data, Journal of Computational and Graphical Statistics 29(3), 2020. Because it provides the principle for reading temporal data by separating key and index, it strengthens the judgment thatwhat can be groupedandis there a time/order columnshould be checked first. https://robjhyndman.com/publications/tsibble/ / Accessed: 2026-07-20 - W3C,
PROV-Overview. Because it treats provenance and traceability together, it supports the last check item in this section: when a strange case appears, the raw evidence to return to should have been written down early. https://www.w3.org/TR/prov-overview/ / Accessed: 2026-07-20