Skip to main content

How to Evaluate Data Analysis Methods and Build a Workflow You Can Defend

A six-stage workflow with the checks that survive a hostile review

How to Evaluate Data Analysis Methods and Build a Workflow You Can Defend
Topic Technology
Published
Author Daniel Odoh
Read Time 16 min

Most bad analysis can be caught before it reaches a decision. Before a number leaves your hands, it has to pass three tests: the query re-runs and returns the same rows, the coverage is accounted for, and the statistic matches the shape of the data.

That is the discipline. Tools, dashboards and credentials sit downstream of it.

Engineers and analysts who own a pipeline end to end get the most from this. So do product managers who commission analysis and have to spot a fragile claim in review. Teams already running PostgreSQL alongside Python, and handing dashboards to non-technical stakeholders, are the natural fit.

Three situations sit outside it: one-off spreadsheet questions, regulated statutory reporting that needs dedicated governance, and modeling work that belongs to machine learning engineering. Those are different jobs with different controls, and pretending otherwise wastes everyone’s time.

Quick Take

  • The loop runs frame, extract, validate the join, clean, explore, report, and validation sends you backwards more often than forwards.
  • Add validate= and a before-and-after row count to the next join you write. That habit can make duplicate-key inflation visible before it reaches downstream steps.
  • On roughly symmetric data, report the mean. On skewed data where the tail is the story, report the median or a percentile, and say which you chose.
  • Every correlation you report needs a companion sentence naming the confounder or alternative explanation.
  • Ask who was excluded from the dataset before you ask what it shows.
  • SQL extracts and audits, pandas and NumPy transform, BI platforms deliver.

Prerequisites

  • Read access to a database replica, warehouse or export you are permitted to query.
  • A schema you can read, or a person who can explain which columns are keys and which are free text.
  • Python with pandas and NumPy installed, plus a SQL client that keeps your query history.
  • A place to log row counts before and after every join: a text file is enough.
  • A named person who will act on the result, and a decision they are trying to make.

Run the analysis loop in six defensible stages

Each stage ends with something you can show a reviewer. Work through them in order, then expect to loop back: the validation stage exists to send you upstream.

  1. Write the decision and the result that would change it.Turn the request into one sentence that names the decision, the person who owns it and the metric you will measure.

    Then write down the result that would make you recommend the opposite action. A statement you cannot disprove is a description, and descriptions are where analysis projects go to be ignored. Do this before you open a query editor, because once you have seen the numbers you will rationalize them.

    If nobody can name the decision the analysis informs, stop. That is a report request and it should be scheduled as one.

  2. Extract with named CTEs a reviewer can follow.Put each transformation in a named WITH block so the query reads top to bottom like a paragraph. PostgreSQL computes the WITH list before the main query and treats each block as a temporary table the main query can reference.

    Two behaviors catch people out. A block referenced more than once is computed once unless you write NOT MATERIALIZED, and since PostgreSQL 12 a side-effect-free block referenced a single time gets folded into the parent query unless you write MATERIALIZED. Separately, window functions such as OVER (PARTITION BY depname ORDER BY salary) keep every row and add a calculation across related rows: they are permitted only in the select list and order by clause, so filtering on row_number() needs a sub-select wrapped around the query.

    Run each CTE on its own with a LIMIT before you run the whole thing. You should be able to predict the row count before you see it.

  3. Defend the join before you trust the columns.Record the row count on both sides and in the result of every merge. Then pass validate= the key relationship that matches reality: "one_to_one", "one_to_many", "many_to_one" or "many_to_many".

    This is cheap insurance. The pandas documentation warns that merging on duplicate keys significantly increases the dimensions of the result and can cause a memory overflow, and validate checks key uniqueness before the merge runs. Add indicator=True and you get a _merge column recording left-only, right-only and matched rows, which is how you find out which keys silently dropped out.

    The check is arithmetic. If three left rows and two right rows on a duplicated key return six, you have a fan-out, not a join. Stop and find the duplicate.

  4. Clean with the missing-value rules written down.Profile missingness per column with isna(), decide drop or fill per column, and record the reason next to the decision. A column that is missing at random can be dropped; a column that is missing because a customer churned cannot.

    pandas uses different sentinels by dtype: numpy.nan for NumPy types, NaT for datetime and timedelta types, and NA for nullable and Arrow dtypes. Equality comparisons against these do not behave like None, so use isna() and notna(). Note that NA cannot be evaluated as a boolean and raises a TypeError inside an if statement: use isna() or the bitwise &, | and ~ operators instead.

    Two more cleaning traps. pandas reductions skip missing values by default while NumPy’s return nan, so mixing libraries in one pipeline changes totals without an error. And NumPy slice indexing returns a view, not a copy, so mutating the slice mutates the original array; numpy.median(..., overwrite_input=True) saves memory and modifies your input, which is a bad trade if you still need the raw values.

  5. Explore the distribution before you name a statistic.Run the same five inspections in the same order every time: shape and dtypes, a missingness profile, one histogram per numeric column, bivariate scatter or cross-tab for the pairs that matter, then an outlier review.

    Exploratory data analysis exists to surface patterns that suggest hypotheses, and to test the assumptions a later statistic will rest on. A histogram shows skew and tail weight together, which matters because skewness statistics themselves are ambiguous: several definitions exist, software computes different values, and multi-modal data can flip the sign.

    At the end you should be able to say in one sentence whether the distribution has one peak or several and which way the tail runs. If you cannot, you are not ready to pick a location statistic.

  6. Report a decision brief with the alternative explanation attached.Five lines, in this order: the recommendation, the evidence behind it, the alternative explanation you considered, your confidence, and the next check that would change your mind.

    This is where the delivery layer earns its place. Microsoft describes Power BI Desktop as the tool for data modeling and report creation and the Power BI service as the surface for sharing and collaboration; Tableau’s own getting-started material is about building views in the workspace, with links out to chart types, maps and using Tableau on the web. Both inherit whatever the extraction handed them, so a polished dashboard on top of an unvalidated join is a confident chart of the wrong number.

    A reader who disagrees with your recommendation should be able to point at the specific number they would challenge. If they cannot, the brief is too vague to be useful.

Choose the statistic that fits the distribution

“Average” is a choice with a direction. NIST’s worked comparison, built from 10,000 random values drawn from an exponential distribution, puts the mean at 1.001, the median at 0.684 and the mode at 0.254: three different answers to the same question about the same data. On skewed data the mean is pulled toward the tail, which is exactly what happens to revenue, session time and failure latency.

The rule is short. Use the mean when the distribution is approximately symmetric and the reader cares about totals. On a normal distribution the mean, median and mode are equivalent, so the mean is a reasonable location estimator and there is no argument to have. Use the median or a percentile when the tail is the story, or when outliers are structurally real rather than errors.

Choosing a location statistic by distribution shape. Source: NIST/SEMATECH e-Handbook of Statistical Methods, Measures of Location.
Distribution shapeStatistic to reportWhat it answersWhen it misleads
Roughly symmetric, single peakMeanWhat the whole group adds up to per caseA handful of large values drag it toward the tail
Skewed with a long tail that mattersMedianWhat the typical case looks likeHides total volume and the size of the tail
Contract thresholds and service budgetsPercentiles (p50, p95, p99)The experience at a named point in the curveOne percentile hides the rest of the distribution
Two or more distinct peaksReport the peaks, then segmentWhere each subgroup actually sitsAny single number describes neither group

Whichever you pick, name it in the sentence that reports it. “Median order value” and “average order value” are different claims, and a reviewer should not have to open the notebook to find out which one you meant.

When a correlation is allowed to become a claim

A correlation coefficient runs from +1.0 to −1.0 and describes the size and direction of a relationship. It says nothing about cause. The Australian Bureau of Statistics makes the point concretely with ice cream and sunscreen: both rise and fall across the year in step with each other, and neither causes the other. The season drives both.

Two limits compound the problem. The coefficient usually measures a linear relationship, so a strong non-linear relationship can return a value close to zero and look like no relationship at all. And where a controlled study is the most effective way to establish causation, most business analysis is observational, which is the fallback design used when controlled experiments are impractical or unethical.

So build the habit into the report. Every correlation gets a companion sentence naming the most plausible confounder or alternative explanation. If you cannot rule that explanation out, downgrade the language from “drives” or “causes” to “is associated with”, and say what study would be needed to go further.

Ask who is missing from the data

Survivorship bias is the error you make when you study only the entities that passed a selection process. The classic case is Wald’s aircraft armor work in the second world war: the aircraft that returned damaged were the ones still flying, and the ones that did not return carried the information that mattered.

Business data reproduces this constantly. Churned customers leave your dataset. Failed projects stop filing status updates. Closed funds get merged into surviving ones. Every analysis built on the survivors reports a success rate that is really a selection effect.

Run three questions before you accept any rate. Who was excluded before the data reached me? Who never entered the system at all? Who left between two measurement points? If you cannot answer any of them, say so in the brief and adjust the claim downward.

Where SQL, pandas and BI platforms actually fit

Each layer has one job it does well and one failure it makes easy. The mistake is asking a tool to do the layer above it.

Which layer does which job, and the failure each one lets in. Vendor descriptions attributed to Microsoft’s Power BI product documentation and Tableau’s Desktop getting-started documentation.
LayerPrimary jobOutput artifactFailure it lets in
SQL (PostgreSQL)Re-runnable extraction, joins and windowed aggregationA named query a colleague can review and re-runRow multiplication from a duplicate key nobody checked
pandas and NumPyCleaning, reshaping and location statisticsA script or notebook with a fixed input and a visible outputSilent missing-value handling differences and accidental mutation
BI platformModelling, visualising and sharingA published dashboard or reportA polished chart that inherits an unvalidated extraction

Two practical boundaries follow. pandas does not sanitize SQL statements (it forwards them to the driver) so pass parameters through params rather than interpolating strings, and never accept a statement from an arbitrary source. And read_sql with its default coerce_float=True will convert a decimal.Decimal to floating point, which means an integral identifier larger than 2**53 has no exact float64 representation and can be silently rounded. Set coerce_float=False when the column carries account numbers or transaction IDs. The pandas API reference documents both behaviors.

Analysis, BI and data science are different jobs

Sort these three by the artifact each one produces, and the boundary becomes obvious in a way that job titles never manage.

Analysis starts with a question and ends with a recommendation: evidence assembled, alternative explanations considered, a decision named. Business intelligence takes validated evidence and turns it into a shared, repeatable surface: a model, a report, a dashboard someone else can refresh. Data science builds something that predicts or scores, which means training, evaluation and deployment rather than a report.

This is a working distinction drawn from what each tool’s documentation says about itself and how the U.S. Bureau of Labor Statistics describes data scientist work. Treat it as a practical map rather than a rule. What matters is the handoff: an analyst should not promise a predictive model, and a data scientist should not skip the audit trail on the way to feature engineering. If you are still sorting out which of the three you are being asked to do, these common data science myths are a useful check on role expectations.

Choosing a learning path you can check

Judge a learning route on four things you can observe before you pay. Does it give you feedback on your work? Is there code review or a reviewer who will tell you the join was wrong? Are the datasets messy, real operational records rather than pre-cleaned samples? Does it teach enough statistics to make a decision rule rather than a formula?

Self-study scores well on cost and badly on feedback unless you build the loop yourself. Bootcamps often include code review, which is the part that matters most: ask how much statistics the syllabus covers before you commit. Postgraduate study gives structured depth and a slower feedback cycle, which suits people who want a theory-heavy foundation.

The demand context is real but narrow. The U.S. Bureau of Labor Statistics projects employment of data scientists to grow 35 percent between 2025 and 2035, much faster than the average across occupations, with about 24,800 openings a year on average over that decade and many arising from replacement demand. That is a United States projection from a national statistical agency, not a forecast of any individual’s prospects. If a formal postgraduate route turns out to be the right next step, one option to review is this data science degree.

Whatever route you pick, the fastest way to test whether it is working is to apply it to a real workflow. Teams that put analytics into production, such as the patterns behind these workforce data science techniques, expose gaps in your training that no syllabus will announce.

Verify the result before the number leaves your hands

  • The query re-runs and returns the same row count as the version you reported from.
  • Every join has a recorded before-and-after row count and a validate= argument.
  • The _merge indicator shows how many keys matched in both tables and how many fell out on each side.
  • The location statistic is named in the output sentence, along with the reason it was chosen.
  • Every correlation claim carries an alternative explanation or is written as an association.
  • You can name at least one group that is excluded from the dataset, and say how that changes the claim.
  • The brief states the next check that would change your recommendation.

Common symptoms and how to recover

Your row count jumps after a merge

You have a duplicate key on one side and a many-to-many fan-out. According to the pandas merging guide, merging on duplicate keys significantly increases result dimensions and can cause a memory overflow. Pass validate="one_to_one" (or the relationship that should hold) so the merge fails loudly instead of multiplying rows, add indicator=True to see which keys only exist on one side, and re-check the counts. Then deduplicate the source before joining.

last_value returns something other than the partition’s last row

With an ORDER BY inside OVER, the default frame runs from the start of the partition through the last peer of the current row, returning the current row rather than the final row of the partition for last_value. Write the frame explicitly as ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING, or drop the ORDER BY if you want the whole partition.

Filtering on row_number raises an error

Window functions are evaluated after the WHERE, GROUP BY and HAVING clauses, so they are not permitted there. To filter on a window function, wrap the query containing it in a sub-select or CTE and filter on the alias in the outer query.

A total shifts when you switch libraries

pandas reductions skip missing values by default; NumPy reductions return nan. Two different defaults, two different answers from the same column. Decide which behavior your report needs, pass skipna=False where you need missing values counted, and keep one library responsible for each figure.

Long account numbers come back subtly wrong

The read_sql documentation defaults to coerce_float=True, which converts values like decimal.Decimal to floating point. An integral decimal larger than 2**53 has no exact float64 representation and can be rounded without warning. Pass coerce_float=False so those values stay as Python objects, and treat identifiers as strings end to end.

The two failures that escape review

A join that multiplied rows while nobody counted, and a mean reported over a tail that made the mean meaningless. Both look plausible on a slide. Both survive a meeting. Neither survives a reviewer who asks for the row counts.

So start with the smallest possible change. Add validate= to the next merge you write and log the row count before and after it. Then, when you report a location statistic, name which one you chose and why you chose it. Those two habits will hold up under scrutiny better than any dashboard you could build around them.

Pick one claim you have to defend this week. Run the check that would embarrass it, then write the limitation into the brief. The review gets easier when the weak point is already named.

Daniel Odoh

About the Author

Daniel Odoh

A technology writer and smartphone enthusiast with over 9 years of experience. With a deep understanding of the latest advancements in mobile technology, I deliver informative and engaging content on smartphone features, trends, and optimization. My expertise extends beyond smartphones to include software, hardware, and emerging technologies like AI and IoT, making me a versatile contributor to any tech-related publication.

View all posts by Daniel Odoh →
Comments

Be the First to Comment