Exploratory Data Analysis
Looking hard at a dataset before you model it — plotting it, summarizing it, and hunting for the things that would embarrass you later, like a typo that reads as a $0 price or a column that is secretly two different units.
Prerequisites: Standard Deviation, Correlation
Before you fit a model, trade a strategy, or trust a number, you have to know what is actually in the data. A backtest built on a price series with a stray decimal error, a column of returns that are secretly percentages mixed with decimals, or a "missing" code stored as the number 999 will produce a confident, wrong answer. Exploratory data analysis (EDA) is the discipline of looking at the data first — with your eyes, not just a model — before you ask it to answer anything.
An analogy: walking the property before you buy it
A buyer doesn't judge a house from the listing photos and the asking price alone. They walk every room, open the cabinets, check the water pressure, and look for a suspicious patch on the ceiling. Most rooms are fine. The point of the walk-through is to find the one thing that isn't — the thing that changes the deal. EDA is that walk-through applied to a spreadsheet: you are not trying to prove the data is good, you are hunting for the specific way it might be bad.
What you actually do
There is no single formula for EDA — that is the point, it is a set of habits, not a computation. But the habits cluster into three questions, each with standard tools.
1. What does one variable look like on its own? Compute the center and spread — mean, median, standard deviation — and look at the shape with a histogram. If (the sample mean) and the median disagree sharply, the distribution is skewed, and the mean is being pulled by a tail. In plain English: two numbers that "should" agree telling different stories is itself information.
This just says: add up every observation and divide by how many there are, . It is the arithmetic center of mass — and a single wild value can drag it far from where "most" of the data sits.
2. How do two variables relate? A scatter plot of against , or the correlation coefficient, tells you whether they move together, and — more importantly for EDA — whether the relationship is a clean line or an artifact of a handful of extreme points.
3. Where does the data break the rules it should follow? Dates that go backward, prices that are exactly zero, a "volume" column with negative numbers, timestamps that repeat. These are not statistical questions; they are bookkeeping questions, and EDA is where you catch them, before a model quietly learns to exploit them.
Drag the mean and standard deviation above and watch how a histogram's shape changes with them — this is the picture you are checking your real data against every time you plot it.
EDA is not a preliminary formality before "the real analysis" — for a working quant, catching one bad row before it corrupts a Sharpe ratio calculation is the real analysis. Look at the data before you trust any number computed from it.
Worked example 1: the mean that lied
You are handed 10 days of a stock's daily returns, in percent: . The last value looks like a typo — perhaps a return of that lost its decimal point.
Compute the mean including it:
A "typical" daily return of would be an extraordinary stock. Now drop the suspect value and recompute over the remaining 9 points:
One value moved the mean by a factor of about 25. That gap between and is exactly the kind of thing EDA is built to surface — not by a formal test, but by simply plotting the ten points and noticing that one of them sits nowhere near the others. A quick fix (drop it, cap it, or go verify the source) now saves a wrong Sharpe ratio later.
Worked example 2: correlation driven by one point
Five (x, y) pairs: . The first four points lie on a perfect line . Compute the correlation with all five points and it comes out close to zero — the last point, far from the rest on the x-axis but low on y, drags the relationship apart. Drop that one point and the correlation among the remaining four is exactly . Nothing here required a formula to catch; a scatter plot showing four points on a line and one point isolated far to the right tells you immediately that the summary statistic is being distorted by a single observation, not describing the bulk of the data.
Drag the correlation slider above and watch the point cloud tighten or scatter — then imagine one point placed far outside the cloud, and notice how much it can move the fitted line and the reported .
What this means in practice
- Before any backtest, plot the raw price and return series. A single spike, a flat line where prices should move, or a gap where data is missing will otherwise show up later as an inexplicable strategy edge or loss.
- Before any regression or factor model, check each input variable's histogram and its scatter against the target. A wrongly-scaled column (percent vs. decimal, or a currency column with a stray $ sign that failed to parse as a number) is invisible in a correlation matrix but obvious in a plot.
- Summary statistics are a starting point, not a verdict. Two datasets can share the same mean and standard deviation and look completely different — this is the entire lesson of skewness and kurtosis and the classic reason to plot, not just summarize.
The most common mistake is treating EDA as something you do once, superficially, then move past. In practice you re-check the data every time you add a new source, a new date range, or a new column — a dataset that was clean in January can silently start recording a field in a different unit in February. EDA is a habit applied at every stage of a pipeline, not a checkbox at the start of the project.
Related concepts
Practice in interviews
Further reading
- Tukey, Exploratory Data Analysis, ch. 1
- Wilkinson, The Grammar of Graphics, ch. 1