Fin Maverick
Foundations VocabularyAccounting & ReportingEconomics & MacroQuant Methods & ProgrammingBusiness & Company AnalysisCorporate Finance & ValuationBehavioural Finance
Banking & Market InfrastructureFixed Income & RatesDerivatives & Structured ProductsPublic EquitiesTransactions & DealsPortfolio ConstructionFunds & AMCs
Private Markets & AlternativesRisk, Treasury & ControlAI & Digital FinanceStochastic Calculus & PricingWealth & Personal FinanceIndian Markets & RegulationProfessional Practice
CalculatorComparison
Frameworks
Explore Bootcamps
Equity ResearchPortfolio ManagementMutual Fund MasteryFinancial LiteracyInvestment Banking Analyst
Private Equity AnalystHedge Funds AnalystBreaking Into VCBreaking Into QuantsAI For Finance
Financial Analyst ProgramRisk Management ProgramPrivate Wealth ManagementDebt Capital MarketsDerivatives Foundation
Explore Internships
Equity Research InternMutual Fund Intern
Portfolio Management InternFinancial Literacy Intern
Explore Micro Courses

Equity Research6

Writing an Investment ThesisBuilding a Discounted Cash FlowReading an Annual Report FastReading a Sector Before a CompanySpotting Quality of Earnings Red FlagsBuilding a Revenue Forecast From Drivers

Portfolio Management3

Rebalancing: When, Why and What It CostsStrategic and Tactical Asset AllocationMeasuring Risk in a Portfolio

Mutual Fund Mastery3

Comparing Funds Without Being FooledHow a NAV Is Struck and Which Day You GetReading a Fund Factsheet Properly

Derivatives Unlocked4

Hedging a Real ExposureThe Greeks, PracticallyFutures, the Basis and What Moves ItReading an Option Payoff

AI For Finance2

Retrieval and Grounding for FinanceDocument Extraction in Finance

Breaking Into Quants4

Backtesting a StrategyHypothesis TestingCleaning Financial DataRegression for Finance

Breaking Into VC3

Sizing a MarketReading a Term Sheet as a FounderHow a Venture Round Actually Works

Financial Analyst Program4

Common Size and Trend AnalysisReading a Cash Flow StatementRatio Analysis That Says SomethingBuilding a Working Capital Schedule

Risk Management Program2

Credit Exposure and How It Is ReducedValue at Risk and What It Hides

Investment Banking Analyst3

Precedent Transactions and Why They DifferReading a Term Sheet StructurallyBuilding a Comparable Companies Table

Private Wealth Management3

Tax Aware Portfolio DecisionsBuilding a Client Risk ProfileGoal Based Planning Arithmetic

Debt Capital Markets3

Analysing an Issuer's CreditDuration and What It Does Not Tell YouBond Pricing and Yield Mechanics

Private Equity Analyst2

Fund Waterfalls and CarryThe LBO in Structure

Hedge Funds Analyst2

Short Selling MechanicsLong Short Mechanics
Courses
Explore Career Roadmaps
Investment Banking AnalystEquity Research AnalystVC AnalystPrivate Equity AnalystHedge Funds Analyst
Quant AnalystAI For FinanceFinancial Analyst ProgramPrivate Wealth ManagementDebt Capital Markets
Risk Management ProgramDerivatives FoundationPortfolio ManagementMutual Fund Mastery
PartnershipsShowdown
Log inSign up
Quantitative Methods, Financial Data & Programming
1Probability
Probability in FinanceRandom VariableProbability DistributionsThe Normal DistributionNormal Distribution ProbabilityThe Lognormal DistributionRandomness vs Uncertainty
2Statistics and Inference
Population and SampleMean, Median and ModePrecision and AccuracyVariable TypesVariance, Standard Deviation and…Dispersion MeasuresStatistical BiasEffect SizeHypothesis TestingThe Sampling DistributionSkewnessKurtosisCovarianceConfidence IntervalArithmetic Mean vs Geometric MeanStatistical Significance vs Economic…Confidence Interval vs Prediction IntervalHow to Summarise a…
3Correlation and Regression
RegressionCorrelation and CausationOrdinary Least SquaresInteraction TermsRegression CoefficientsRegression vs ClassificationHow to Build a…Spurious CorrelationRegression, Correlation and FitResidualsMulticollinearityAutocorrelation and Partial Autocorrelation
4Time Series
Time Series in FinanceSimple, Weighted and Exponential…Moving Average CalculatorPrice, Return and Level SeriesHow to Prepare Time-Series…LagFrequencySeasonalityTimestampsTrendStationarity and the Unit RootHeteroskedasticityLeadRolling WindowsDifferencing
5Simulation and Numerical Methods
SimulationMonte Carlo SimulationHow to Run a…Numerical MethodsIterationResampling and the BootstrapPseudorandom Numbers and the SeedConvergence and ToleranceNumerical Stability
6Optimisation
OptimisationLocal and Global OptimaConstraintsConvex OptimisationThe SolverLinear ProgrammingThe Objective FunctionConstraint ViolationThe Feasible SetLagrange MultipliersQuadratic Programming
7Modelling Practice
Linear, Logistic, Ridge and…Training, Validation and Test…The ModelModel ErrorDependent and Independent VariablesThe ROC Curve and AUCWhat a Model HoldsMSE, RMSE, MAE and MAPEPrecision and RecallCross Validation and RegularisationOverfitting and UnderfittingReturn Series MeasuresSimple, Compound and Log Return
8Backtesting and Research Integrity
BacktestingBacktest vs Live PerformanceHow to Document a…How to Prevent Backtest…Out-of-Sample TestingWalk-Forward AnalysisMultiple TestingP-HackingData Snooping
9Data Quality and Structure
Data QualityThe DatasetSelection and Survivorship BiasVersioned DatasetsData Structures in FinanceData CleaningMissing Data and Null ValuesStructured Data vs Unstructured DataMissing Data vs ZeroData Validation vs Data CleaningOutliersDuplicate Records
10Programming for Finance
Data PipelinesAPIs for Financial DataAPI vs CSV FileDatabases in FinancePython for FinanceJoinsSQL for FinanceThe Analysis Workflow
11Quantitative Research
Research DesignThe Data Generating ProcessReproducibilityPeer Review in Analytical WorkThe Research HypothesisRobustness and Sensitivity

Data Cleaning: The Steps, in Order, and What Each Risks

What is cleaning, and what is it not?

Start with the thing most people get wrong before they touch a single cell. Finding a fault and fixing one are two different acts, done at two different moments, and often by two different people. Somebody reads the file against the written column list and says this cell cannot be right. Reading and flagging is one job, and it changes nothing at all: the file after it is exactly the file before it, with a note attached. Then somebody sits down and changes something, and from that moment the numbers coming out are different numbers. Only the second act moves a figure, and every step below is the second act. Finding set against fixing has a treatment of its own, so the faults are taken here as already found and worked on.

Cleaning is not tidying. Cleaning does not make a file look nicer and it does not improve anything. Every step below is a decision about what a cell means, and a decision is a thing that can be right or wrong and can be argued with. A blank cell means something. A cell reading Rs 99,999/- means something. Two rows for one stall in one month mean something. Cleaning does not repair the file. Cleaning states in writing what has been concluded about the file, and then acts on that conclusion.

A household sorting out a year of electricity bills before working out what a month costs on average meets the same problem. One bill is missing. One arrived twice. The first copy was reissued after a meter reading was corrected. One reads ten times the usual amount because somebody wrote an extra zero at the counter, and one reads five times the usual amount because the house was full of guests that month and the air conditioner never stopped. None of that is an arithmetic problem. Each sheet of paper needs a decision, taken one at a time, in an order, and remembered afterwards. A run of decisions like that, in order and remembered, is cleaning.

The order matters more than it looks, and so does the writing down. A decision that is not recorded cannot be undone, cannot be checked and cannot be argued with. The figure it produced has to be taken on trust by everybody downstream of it. Six steps follow. Each one is named, each one has an authority behind it, and each one has an effect on a single headline number, reprinted after every step so the movement can be watched.

The record and the column list behind every figure

One record, already printed and already counted. The Neelbagh stall record is an invented file kept by the market office of an invented covered market: one row for each stall in each of four months numbered 1 to 4, thirty two rows, eight columns. Thirty one of its takings cells carry a number and they add to Rs 21,40,099/-. The headline figure is the average takings for each stall month, and its conventionA rule everybody has agreed to follow that could reasonably have gone another way. Conventions are not discoveries, so the only thing that makes one binding is that somebody wrote it down before it was needed. is this: the sum of the takings cells that carry a usable number, divided by how many carry one. A blank is not a number. The office code for no return received is not a number. A real zero is a number. On the file as handed over that gives Rs 21,40,099/- over 31, or Rs 69,035.45/-.

One written column list. The market office keeps a plain description of what each of the eight columns is allowed to hold. Every step below draws its authority from that description. Without it, three of the six steps cannot be taken at all.

THE SIX STEPS, IN THE ORDER THEY ARE TAKEN headline starts at Rs 69,035.45/- STEP ONE STEP TWO STEP THREE STEP FOUR STEP FIVE STEP SIX copy the source file set aside a code resolve two rows correct an error decide a blank leave one alone WHAT EACH STEP DOES TO THE HEADLINE FIGURE no change down Rs 1,032.12/- up Rs 1,089.77/- down Rs 14,896.55/- no change no change The three that move nothing are step one, step five and step six. They are the copy, the stated convention and the restraint, and they decide whether the figure is right.
Six cleaning steps in a fixed order move the headline no change, down Rs 1,032.12/-, up Rs 1,089.77/-, down Rs 14,896.55/-, no change and no change, so half the run leaves the number exactly where it found it.
Breaking Into Quants Bootcamp — Fin Maverick

Why is the source file never written to?

How to Clean Financial Data Without Overwriting the Source

Step one takes no cleverness at all, and it is the step people skip. Skipping it costs nothing on the day and everything three weeks later. The file that arrived from the market office gets copied, and every one of the five steps that follow happens on the copy. The file as it arrived is kept exactly as it arrived, untouched, with its blank cell and its Rs 99,999/- and its two rows for one stall month all still sitting in it.

The everyday version is a household that photocopies the electricity bill before writing corrections on it. The photocopy can be scribbled on freely. When the supplier disputes the correction, the bill itself is still in the drawer, unmarked, and the argument can be settled in a minute. Once the bill itself carries the scribbles, the argument cannot be settled at all. The only record of what the supplier actually sent now has handwriting on top of it.

The whole value of step one shows up on the day somebody disagrees with step four. Step four is where a cell reading Rs 4,80,000/- becomes a cell reading Rs 48,000/-. If the copy was made, that disagreement is a five minute conversation: here is the original, here is the return slip the correction rested on, here is the line in the log. If the copy was not made, the disagreement has no floor to stand on. Nobody can see what the cell said before, nobody can check whether the correction was the one described, and the only honest answer to the question is that the file used to say something else and nobody now knows what.

Notice what step one does to the headline figure. Nothing. Copying a file changes not one cell, so the average takings for each stall month, computed as the sum of the takings cells that carry a usable number divided by how many carry one, is still Rs 21,40,099/- over 31, still Rs 69,035.45/-. Step one is the step that makes every other step reversible, and it buys that for the price of a copy and no movement in any number at all.

ONE WAY ONLY THE SOURCE FILE 32 rows, 8 columns, 256 cells one blank takings cell one cell reading Rs 99,999/- two rows for one stall month two cells reading Rs 4,80,000/- still exactly as it arrived THE WORKING COPY the same 32 rows to start with step two happens here step three happens here step four happens here steps five and six happen here every figure in this guide comes from here copy, once nothing is ever written back
Cleaning happens on a copy while the source file stays exactly as it arrived, which is the single arrangement that makes every later step reversible and every later decision checkable.
Try it out

Why is the source file never written to, once the copy has been made?

AI For Finance Bootcamp — Fin Maverick

What comes off first, and what does that move?

Step two is setting aside what was never a value in the first place. NB-02 Chandan Tea's month 4 takings cell reads Rs 99,999/-. Nothing in that number announces itself. The code is a whole number of rupees, it sits in a column of whole numbers of rupees, it sorts between other figures and it will happily add and average with them. The written column list is the only thing on the table that knows the truth: Rs 99,999/- is the market office's code for no return received. The figure is not money and never was money. The code is the form's way of writing that nothing arrived.

Setting aside means something narrow and worth stating precisely. Setting aside means taking the cell out of the numbers while leaving the row exactly where it is. NB-02 Chandan Tea still traded in month 4, the stall still has a row, the row still carries its identifierA value whose whole job is to say which thing a row is about. It looks like a number here but it is a label, so adding two of them or averaging them produces something that means nothing., its category and its pitch area. The pretence that the takings cell holds an amount is what has gone. Nothing in the takings column could ever have shown this. Step two cannot be done by looking at the figures, only by reading the written column list.

The headline moves. The sum drops from Rs 21,40,099/- to Rs 20,40,100/- and the count of usable figures drops from 31 to 30, so the average takings for each stall month, still the sum of the cells carrying a usable number divided by how many carry one, becomes Rs 68,003.33/-. The fall is Rs 1,032.12/-. Both the top and the bottom of the calculation changed, so the fall is small. Pulling out one large figure also pulls out one of the things being divided by.

There is a habit hiding in this step that is worth naming. An empty cell provokes a question and Rs 99,999/- provokes nothing, so a code that looks like data is more dangerous than a cell that is obviously empty. The code gets added up. The code gets averaged. The code gets quoted in a summary by somebody who never opened the written column list, and the figure they quote is wrong in a way that no arithmetic check will ever catch. The arithmetic is perfect.

Try it out

NB-02 Chandan Tea's month 4 takings cell reads Rs 99,999/-. Which document requires it to be set aside?

How are two rows answering one question resolved, and why does the figure rise?

NB-03 Harit Greens filed month 2 twice. One return reached the market office on day 5 of the following month reading Rs 36,400/-, and a second reached it on day 19 reading Rs 39,700/-. Two rows, one stall, one month. The record is meant to hold one row for each stall in each month, so both rows cannot stand, and the grid is asking one question that has arrived with two answers.

Here is the part that separates a decision from a guess. The rule is stated before the two figures are looked at, not after. The rule used here is keep the later filing, on the reasoning that a return arriving on day 19 after one arrived on day 5 is a revision and the office's own practice is to treat a revision as replacing what it revises. The rule could have been written before anybody knew what either cell said, and being writable in advance is exactly what makes it a rule rather than a preference dressed up as one. Row for row it drops the Rs 36,400/- and keeps the Rs 39,700/-.

Now watch what happens. Most readers quietly stop trusting the run right here. The sum falls from Rs 20,40,100/- to Rs 20,03,700/- and the count of usable figures falls from 30 to 29. The average takings for each stall month, on the same convention as always, becomes Rs 69,093.10/-. The headline goes up by Rs 1,089.77/-, and it goes up because the figure that was dropped, Rs 36,400/-, sat below the average that was being computed. Take something below the average out of an average and what is left rises. There is nothing subtle about that arithmetic and it still surprises people every time.

Cleaning is not the same thing as making a number smaller. Anybody carrying the assumption that a clean figure is a lower figure will meet this step, feel that something has gone wrong, and start looking for a way to make it go the other way. A well run cleaning job turns into a badly run one exactly there: not through a bad step, but through a good step quietly rejected for moving the wrong way.

THE HEADLINE FIGURE, STEP BY STEP the scale does not start at nothing Rs 69,035.45/- Rs 68,003.33/- Rs 54,196.55/- peak Rs 69,093.10/- raw one two three four five six steps applied, in order down Rs 1,032.12/- up Rs 1,089.77/- down Rs 14,896.55/- flat, twice over
The headline falls, then rises above where it started, then falls hard and stops moving, and the step that raises it is the one most readers would not have predicted.
Try it out

Keeping the later filing and keeping the larger figure both give Rs 54,196.55/- on this record. Does that confirm the rule was the right one?

What does correcting a proven error move?

NB-08 Peeli Mithai's month 3 takings cell reads Rs 4,80,000/-. The market office keeps the stall's own return slip for month 3 on paper, and it reads Rs 48,000/-. Somebody typing the file up added a zero. The correction is obvious and it is right, and the reason it is right needs saying very carefully. The wrong reason is sitting right there and looks identical.

ProvenanceWhere a figure came from and what paper or system it passed through on the way. Two identical numbers can have completely different provenance, and that is often the only thing that separates them. is what authorises this step. There is a document, it says Rs 48,000/-, the cell says Rs 4,80,000/-, and the document wins because the cell is a transcription of it. Provenance is the whole argument. Nothing about Rs 4,80,000/- being a large number licenses the change, and if the return slip did not exist there would be no step four at all. The size of a figure is a reason to go and look for the paper. Size is never, on its own, a reason to change anything.

Step four is the step that does the work. The sum falls from Rs 20,03,700/- to Rs 15,71,700/-. A corrected cell is still a cell, so the count of usable figures stays at 29. The average takings for each stall month, sum of the usable cells over how many there are, becomes Rs 54,196.55/-. The fall is Rs 14,896.55/-, by a very wide margin the largest move any of the six steps makes. One cell, one extra zero, and a fifth of the headline.

Notice that the one sentence in the market office's day bookA running written ledger kept alongside the file, in sentences rather than columns. It records what happened rather than what was totalled, which is why it can settle a question the columns cannot. about a wedding order, and the one return slip reading Rs 48,000/-, are together worth Rs 14,896.55/- on this record. The word worth is meant literally. The correction happens only because the slip exists, so the slip and the move it makes are one quantity under two names: what a sheet of paper outside the file is worth to a figure inside it.

ONE CELL, ON THE AUTHORITY OF ONE SHEET OF PAPER NB-08 PEELI MITHAI, MONTH 3, TAKINGS Rs 4,80,000/- Rs 48,000/- RETURN SLIP NB-08, month 3 Rs 48,000/- kept on paper by the office the authority is the slip, not the size of the figure THE HEADLINE FIGURE, DRAWN FROM NOTHING before step four Rs 69,093.10/- after step four Rs 54,196.55/- down Rs 14,896.55/-
Correcting NB-08 Peeli Mithai's month 3 cell on the authority of its return slip moves the headline down Rs 14,896.55/-, which is the largest move any single step in this run makes.
Try it out

What gives the authority to change NB-08 Peeli Mithai's month 3 cell from Rs 4,80,000/- to Rs 48,000/-?

Try it out

Before the panel below. Six cleaning steps are applied in order, one after another. Does the headline figure fall at every step?

Play with it

Step the run forward and watch where the movement actually comes from

Moving the control applies more of the six steps, in the order they are taken. The bar rescales, the step just applied lights up in the list beside it, and the sentence underneath restates the current reading and the move the last step made. The panel opens on all six applied, the reading printed throughout, and the second control changes what step five decides about the blank cell.

six of six steps applied Rs 15,71,700/- over 29 usable figures 1. copy the source and never write to it 2. set aside what is not a value at all 3. resolve two rows answering one question 4. correct what provenance proves wrong 5. decide what a blank means and say so 6. leave alone what cannot be proved wrong click a step, or drag the control below THE AVERAGE TAKINGS FOR EACH STALL MONTH Rs 54,196.55/- the last step moved it not at all raw nothing Rs 70,000/- on the scale the blank has been decided HOW FAR THE RUN HAS GOT raw 1 2 3 4 5 6
six

Educational illustration. No amount this panel prints describes money that anybody took. The steps are applied in the order stated above and in no other. Until the second control is switched, the reading is always the sum of the takings cells that carry a usable number divided by how many carry one. The second control has no effect until the run reaches step five, and no convention about blanks has been stated before then. The whole calculation is a column added up and divided by a count.

Risk Management Program Bootcamp — Fin Maverick

What is done about a blank, and why is that a decision rather than a step?

There is a row for NB-05 Bansi Flour in month 2, and where its takings should be there is nothing. Not a code, not a zero, not a stray character. Empty. The stall exists, the month exists, the row exists, and the one thing the row was supposed to carry is not there. The nature of a blank like this, why a null valueA cell holding no value at all, as against a cell holding the value nothing. Which of the two a blank represents changes the answer, and it is a question about the record rather than about arithmetic. is not the same thing as a zero, and how the reason for the absence changes what may be done about it, are all covered separately. Step five needs none of that. Step five needs one sentence, written down.

Under the convention this subject uses, printed beside every figure above, the average takings for each stall month is the sum of the cells that carry a usable number divided by how many carry one. A blank carries no number, so it never enters either the top or the bottom of the calculation. The blank was never in the sum, never in the count of 31, and it is not in the count of 29 now. Under that convention step five moves the headline by nothing at all: it stays at Rs 54,196.55/-.

Now change one sentence and nothing else. Suppose the office instead writes that the average is taken over every row that survived the earlier steps, and that a blank takings cell is read as a month in which the stall took nothing. A blank contributes nothing to a sum either way, so the numerator does not move. The denominatorThe figure the total is divided by. Two people can hold the same total and still hand in different answers, because they disagreed about what belonged underneath the line rather than above it. goes from 29 to 30. The same record now reads Rs 52,390/-. Step five's effect is either nothing or Rs 1,806.55/-, and a sentence somebody writes decides which. The sentence has to be written for exactly that reason.

Step five is the step that gets left out of logs, and it is the most dangerous omission on the list. A step that changes a cell leaves a mark: the cell is different and anybody comparing the copy with the source will see it. A step that changes a denominator leaves no mark anywhere. The cells are all identical, the file looks the same, and two people can hand in Rs 54,196.55/- and Rs 52,390/- from the same file with neither of them able to say why the other is wrong.

ONE NUMERATOR, TWO SENTENCES, TWO ANSWERS the convention this subject uses the other defensible one a blank is not a number, so it is not counted a blank is a row, so it is counted as nothing out in Rs 15,71,700/- over 29 Rs 15,71,700/- over 30 Rs 54,196.55/- Rs 52,390/- the step moves the headline by nothing the step moves it Rs 1,806.55/-
The blank moves the headline by nothing under the convention this subject uses and by Rs 1,806.55/- under the other one, and only a written sentence decides which of the two applies.
Try it out

Under the convention this subject uses, step five moves the headline by nothing. Does that make it the harmless step?

Rebalancing: When, Why and What It Costs — free micro-course from Fin Maverick

What is left alone, and what would touching it have cost?

NB-07 Sundari Chaat's month 3 takings cell also reads Rs 4,80,000/-. The same number, in the same month, in the same column, in the same file. Its other three months read Rs 40,000/-, Rs 41,000/- and Rs 42,000/-, so it stands out from its own record exactly as far as NB-08 Peeli Mithai's cell did. And the market office's day book records a wedding order paid to NB-07 Sundari Chaat that month.

NB-07 Sundari Chaat's month 3 is a real month. Nothing is corrected, nothing is set aside, nothing is dropped, and the headline stays at Rs 54,196.55/-. Step six is doing something even though it looks like doing nothing. The alternative was available, was tempting, and was wrong. Restraint counts as a step only when it is a decision rather than an oversight, and a decision has to be written down like every other step.

Here is what touching it would have cost. Correct NB-07 Sundari Chaat's month 3 cell to Rs 40,000/-, in line with its other months, and the sum falls from Rs 15,71,700/- to Rs 11,31,700/- across the same 29 usable figures. The headline lands at Rs 39,024.14/-, a move of Rs 15,172.41/-. The move is further than the Rs 14,896.55/- that fixing the genuine error made. The most expensive step available on this record is the one that cleans something that was never dirty.

The two cells hold the same number. Nothing in the takings column separates them, and how to tell an outlierA figure far away from the others around it. Whether a particular one is worth investigating, and what follows once it has been, is a subject in its own right and it is not settled by how far away the figure sits. that is a real observation from one that is a recording error is a subject of its own, covered separately. The two cells are separated by something outside the record entirely. One cell has a return slip contradicting it. The other has a day book entry supporting it. Both of those are sheets of paper the market office keeps beside the file, and neither of them is a number.

THE SAME NUMBER, TWICE, AND ONLY ONE OF THEM MOVES NB-07 SUNDARI CHAAT, MONTH 3 Rs 4,80,000/- day book: a wedding order, paid that month left alone NB-08 PEELI MITHAI, MONTH 3 Rs 4,80,000/- return slip: Rs 48,000/- corrected HOW FAR EACH MOVE WOULD TAKE THE HEADLINE fixing the real error, down Rs 14,896.55/- trimming the real month, down Rs 15,172.41/- the extra distance, drawn ten times larger so it can be seen the unnecessary step travels further than the necessary one
Correcting the real month would have moved the headline Rs 15,172.41/-, further than fixing the genuine error moved it, so restraint saves more here than any correction earns.
Try it out

Correcting NB-07 Sundari Chaat's real month would move the headline Rs 15,172.41/-. How does that compare with fixing the genuine error?

Rebalancing: When, Why and What It Costs teaches you to choose a rebalancing rule and say what it buys and what it costs.

Why does the order matter, and what does the whole run cost?

The six steps are not a checklist that may be worked through in any convenient order. Three of the orderings are forced, and each one is forced for the same kind of reason: a later step counts something that an earlier step changes.

The office code is set aside before cells are counted. Left in, the count of usable figures is 31 when it should be 30, and every average built on that count is wrong from the start. The two rows on one keyThe column or combination of columns that is supposed to identify one row and never repeat. Here it is a stall together with a month, so two rows carrying the same pair is a fault by definition. are resolved before rows are counted. Left in, the denominator counts NB-03 Harit Greens' month 2 twice, so the record claims 30 stall months when the market had 29 to report. And correction comes before averaging, never after: an average computed on the file as handed over and then adjusted by hand is not the same number as an average computed on the corrected file, and nobody downstream can tell which one they have been given.

Run all six in order and the headline moves from Rs 69,035.45/- to Rs 54,196.55/-, a fall of Rs 14,838.90/-. Notice that this net fall is smaller than the single move step four makes on its own. Step three pushed the figure up on the way. Three of the six steps moved it not at all, and those three, the copy, the stated convention and the restraint, are the three that decide whether the figure is right. The three that moved it decided only what it is.

THREE ORDERINGS THAT ARE NOT NEGOTIABLE set the office code aside then count the cells done in this order the count of usable figures reads 30 swapped, it reads 31 and Rs 99,999/- is treated as takings resolve the two rows on one key then count the rows done in this order the count of usable figures reads 29 swapped, NB-03 Harit Greens is counted twice in one month correct what provenance proves wrong then take the average done in this order the headline reads Rs 54,196.55/- swapped, an average is adjusted by hand and nobody can tell which one they hold every one of the three is a count that an earlier step changes
The codes are set aside before cells are counted and repeated keys resolved before rows are counted, or both denominators are wrong before a single average is taken.

The whole run in one table

StepThe headline after itThe move
1. Copy the source and never write to itRs 69,035.45/-no change
2. Set aside what is not a value at allRs 68,003.33/-down Rs 1,032.12/-
3. Resolve two rows answering one questionRs 69,093.10/-up Rs 1,089.77/-
4. Correct what provenance proves wrongRs 54,196.55/-down Rs 14,896.55/-
5. Decide what a blank means and say soRs 54,196.55/-no change
6. Leave alone what cannot be proved wrongRs 54,196.55/-no change
The whole run, raw to cleanedRs 54,196.55/-down Rs 14,838.90/-
What step five would have given under the other conventionRs 52,390/-down Rs 1,806.55/-
What step six would have given had the real month been trimmedRs 39,024.14/-down Rs 15,172.41/-

What does a cleaning log actually look like?

Everything above is worth nothing to anybody but the person who did it unless it is written down, and the form the writing takes is not a matter of taste. A lender reading a borrower's own figures, an analyst handed a file by somebody else, or a household comparing this year's electricity against last year's all want the same four things, and a log with four columns gives them all four.

Which cell or row. The change itself, stated as what the cell said before and what it says now. On whose authority, naming the written column list or the specific document. And what the headline figure was before the step and after it. The fourth column is the one that gets left out and the only one that makes the log readable. A step whose cost is written down is a step somebody can argue with, and a step nobody can argue with is a step nobody can check.

Read the three filled rows below and notice what a reader can now do that they could not do before. A reader can see that one step accounts for almost all of the movement. A reader can see that another step moved the figure the wrong way and was kept anyway, so the rule was fixed in advance. And a reader can see that the two steps not listed, the blank and the real month, were decided rather than forgotten. A log that names its zero moves is a log written by somebody who understood that a zero move is still a decision.

THE CLEANING LOG, FOUR COLUMNS WIDE WHICH CELL OR ROW WHAT WAS CHANGED ON WHOSE AUTHORITY HEADLINE BEFORE AND AFTER NB-02 Chandan Tea month 4, takings Rs 99,999/- set aside, row kept in place the written column list, the no return code entry Rs 69,035.45/- Rs 68,003.33/- NB-03 Harit Greens month 2, two rows day 5 row dropped, day 19 row kept keep the later filing, written before either was read Rs 68,003.33/- Rs 69,093.10/- NB-08 Peeli Mithai month 3, takings Rs 4,80,000/- becomes Rs 48,000/- the stall's return slip for month 3 Rs 69,093.10/- Rs 54,196.55/- Also decided, and recorded although neither moved the figure: NB-05 Bansi Flour's blank is not counted, and NB-07 Sundari Chaat's month 3 stands, on the day book entry.
A cleaning log records which cell, what changed, on whose authority, and what the headline figure read before and after, and the last of those four is the column that makes it worth reading.

Where this goes wrong, and it goes wrong by being too thorough

An analyst cleaning the Neelbagh stall record reaches month 3 and finds two cells reading Rs 4,80,000/- in a file where every other takings figure sits between nothing and Rs 55,000/-. Both look wrong. Both are corrected in line with their own stall's other months, a defensible sounding rule applied consistently to both, and the analyst writes down what was done.

The headline lands at Rs 39,024.14/- rather than Rs 54,196.55/-. The unnecessary half of that work moved the figure Rs 15,172.41/-, further than fixing the genuine error moved it. The analyst was careful, consistent and wrong, and nothing in the file could have said so: the two cells hold the same number and no rule read off the takings column separates them.

Here is the habit that fixes it: a cell is corrected on the authority of a document, never on the authority of how the cell looks. Rs 4,80,000/- being large is a reason to walk over to the market office and ask for the paper. Size is a reason to look. Size is never, by itself, a reason to change.

Try it out

The analyst corrects both cells reading Rs 4,80,000/- because both look wrong. What went missing from the reasoning?

What is covered elsewhere. How a fault gets found in the first place is covered under fault detection, and finding set against fixing is treated on its own. A missing value, why a cell can be empty for reasons that change what may be done about it, what makes a figure worth investigating, and how a repeated row arises and what it distorts, are each covered separately. All four faults are named above and acted on in order.

Writing something that performs these steps automatically, rather than doing them by hand on thirty two printed rows, belongs with the notes on programming and is covered there. A record cannot show what was taken out of it before it ever arrived, and no amount of cleaning reaches that gap. The subject is covered separately.

Breaking Into VC Bootcamp — Fin Maverick

Where do these numbers come from?

No register, no published series and no office stands behind any amount above. Every rupee amount was constructed for teaching and then recomputed from the small record printed where this subject opens, so the table below names a construction rather than an authority.

What was usedWhat it actually isWhere it sitsHow it is checked
The Neelbagh stall recordAn invented file of ten stalls across four months, faulted on purposePrinted whole where this subject opensTotal the takings column by hand; thirty two rows is small enough to add up
The written column listThe market office's own description of what each column is allowed to holdSet out where the record's structure is coveredRead the entry for the takings column before accepting any cell in it
The day book and the return slipsPaper the market office keeps beside the fileKept at the market office, beside the recordAsk the market office for the day book entry and the return slip behind each corrected cell

The Neelbagh market and its fourteen pitches, the Neelbagh stall record, the market office, its day book, and all ten stalls in it, NB-01 Kadamba Idli, NB-02 Chandan Tea, NB-03 Harit Greens, NB-04 Peetal Utensils, NB-05 Bansi Flour, NB-06 Ilaka Fruit, NB-07 Sundari Chaat, NB-08 Peeli Mithai, NB-09 Roshni Juice and NB-10 Amber Rolls, are invented.
Educational material. Not advice on any investment, tax, budget or market position.

Covered in this topic

Subtopics

How to Clean Financial Data Without Overwriting the Source
← PreviousNext →
Fin Maverick Micro CoursesExplore Micro Courses
Fin Maverick BootcampsExplore Bootcamps
Fin Maverick

Finance education that ends in a job, not a certificate that gathers dust. Built for young India.

LEARN
CalculatorsFrameworksComparisonsCareersShowdown
RESOURCES
All CoursesMicro CoursesBootcampsInternships
COMPANY
AboutJob openingPartnership
LEGAL
Privacy PolicyTerms & ConditionsContent LicenseReturn & Refund Policy
© 2026 FIN MAVERICK / BUILT FOR INDIA.DO FINANCE, DO NOT JUST READ ABOUT IT.