What a quant analyst does and how to build one's workflow in Python

August 20, 2026
Facebook logo.
Twitter logo.
LinkedIn logo.
Newsletter issue count indicatorNewsletter total issues indicator
What a quant analyst does and how to build one's workflow in Python

What a quant analyst does and how to build one's workflow in Python

A quant analyst uses math and code to answer questions about financial markets. Those questions might sound like "What should this asset be worth based on current market data, and does the market price match?" or "How much money could we lose in a bad week?" If you've looked into the role online, you've probably found reading lists full of advanced math textbooks covering topics like stochastic calculus and measure theory (branches of mathematics used in some pricing and risk models). That's one path. But the fastest way to understand what a quant analyst actually does is to build something yourself. This article explains the role and the core skills, then walks through a complete Python example you can run on your own. If you're getting started with quant finance, this is a practical entry point. The mathematical foundations of quantitative finance matter too, but they make more sense when you see them applied in code.

Many articles about becoming a quant analyst focus entirely on which textbooks to read. That's useful background, but it skips the part where you sit down and do the work. A quant analyst spends most of the day writing code and cleaning data. The output is usually a model (a set of rules or equations that turns data into an estimate or prediction) that other people use to make decisions. You need Python basics and time spent working with real market data.

What a Quant Analyst Actually Does

The title "quant analyst" covers a wide range of jobs. At an investment bank, a quant analyst might build pricing models for complex financial products like options (contracts that give you the right to buy or sell an asset at a specific price). At a hedge fund, the same title might mean someone who researches trading strategies by analyzing historical data. At a risk management firm, it could mean someone who estimates how much a portfolio could lose under extreme market conditions.

What ties these roles together is the workflow. The work usually starts with a question. Then you gather data, build a model, check how well it matches real outcomes, and explain the result to the person making the decision.

That workflow helps explain why Python is one of the most common tools in this field. It handles data analysis, statistics, and charts in one place, so you can move from raw data to a finished report without switching tools.

Quant Analyst Skills That Matter Most

You don't need a PhD to begin. A beginner should focus on statistics, Python, and market basics.

On the statistics side, you need to understand how values spread out (a concept called a distribution), whether two things tend to move together (correlation), and how to test whether a result might have happened by chance (hypothesis testing). You don't need to master all of this before writing your first line of code, but you need enough to interpret what your calculations mean.

On the Python side, you need to load data, reshape it, and calculate results without a lot of manual work. In Python, pandas works well for tables. NumPy helps with fast numerical work. SciPy and statsmodels cover many common statistical tasks. Matplotlib makes charts.

You also need some knowledge of financial markets. You need to know what a return is (how much an investment gained or lost over a period), what volatility means (how much prices bounce around), and why risk matters. This comes from practice more than from textbooks.

A Complete Quant Analyst Workflow in Python

Let's walk through a realistic task. Suppose you're a quant analyst at an asset management firm, and your portfolio manager asks you to compare two ETFs (exchange-traded funds, which are baskets of stocks you can buy like a single share). She wants to know which one delivered better returns after accounting for how much its price moved up and down over the past few years.

This is a common quant analyst task. Let's do it from start to finish.

Setting Up and Loading Market Data

We'll use the yfinance library to download historical prices for SPY (which tracks the S&P 500, a broad US stock market index) and QQQ (which tracks the Nasdaq-100, a tech-heavy index).

import numpy as np
import pandas as pd
import yfinance as yf
import matplotlib.pyplot as plt
from scipy import stats

tickers = ["SPY", "QQQ"]
data = yf.download(tickers, start="2019-01-01", end="2024-01-01")
prices = data["Adj Close"]

print(prices.head())

The Adj Close column gives us prices adjusted for dividends and stock splits. This gives a more realistic basis for return calculations than raw closing prices, though it still won't capture taxes, fees, or the exact timing of dividend reinvestment.

Calculating Daily Returns and Summary Statistics

A quant analyst almost never works with raw prices. Prices tend to go up over time, which makes them hard to compare across different assets or time periods. Instead, we convert prices to daily returns, which tell us the percentage change from one day to the next.

returns = prices.pct_change().dropna()

summary = pd.DataFrame({
    "Mean Daily Return (%)": returns.mean() * 100,
    "Std Dev Daily (%)": returns.std() * 100,
    "Min Daily (%)": returns.min() * 100,
    "Max Daily (%)": returns.max() * 100,
    "Total Observations": returns.count()
})

print(summary.round(4))

The standard deviation (labeled "Std Dev" above) measures volatility, which means how much daily returns bounce around their average. Higher standard deviation means more uncertainty. A quant analyst uses this as a basic measure of risk.

One thing to keep in mind is that daily averages can jump around a lot depending on the time period you choose. They work better as rough summaries than as forecasts.

Measuring Risk-Adjusted Performance

Your portfolio manager didn't just ask "which one went up more?" She asked which one delivered better returns relative to the risk involved. The most common way to measure this is the Sharpe ratio. It divides the average excess return (return above the risk-free rate, which is what you'd earn from a very safe investment like short-term government debt) by volatility. A higher Sharpe ratio means you got more return for each unit of risk.

risk_free_rate = 0.04
daily_rf = risk_free_rate / 252

excess_returns = returns - daily_rf

sharpe_ratios = (excess_returns.mean() / excess_returns.std()) * np.sqrt(252)

print("Annualized Sharpe ratios")
for ticker in tickers:
    print(f"  {ticker}: {sharpe_ratios[ticker]:.3f}")

We set risk_free_rate = 0.04 as a simplifying assumption for this example. In real work, you'd use an actual market rate from the same period, usually based on short-term US Treasury yields. We multiply by the square root of 252 to annualize the ratio (convert it from a daily number to a yearly one). This is standard practice, though it's an approximation that works best when returns are fairly stable across time.

One limitation worth noting is that the Sharpe ratio treats upside and downside volatility the same. It assumes that how much returns move around is a reasonable stand-in for risk. That works for basic comparisons, but it doesn't fully capture the danger of sudden large losses.

Estimating Downside Risk with Value at Risk

Your portfolio manager cares more about losses than gains. Value at Risk (VaR) estimates a loss threshold where only 5% of days were worse. It answers the question "How bad does a bad day get, most of the time?"

One important limitation is that VaR doesn't tell you how bad losses can get beyond that cutoff. If you're in the worst 5%, VaR says nothing about whether you lost 3% or 15%.

confidence_level = 0.05

var_historical = returns.quantile(confidence_level)

var_parametric = pd.Series(
    stats.norm.ppf(confidence_level, returns.mean(), returns.std()),
    index=tickers
)

var_table = pd.DataFrame({
    "Historical VaR (95%)": var_historical * 100,
    "Parametric VaR (95%)": var_parametric * 100
})

print("Value at Risk (daily, %)")
print(var_table.round(3))

The historical method looks at the actual 5th percentile of past returns. The parametric method assumes returns follow a normal distribution (a bell curve) and calculates the 5th percentile mathematically. In practice, real returns often have fatter tails than a normal distribution, which means extreme losses happen more often than the bell curve predicts. A quant analyst would note this and might use more advanced models.

Visualizing the Results

Numbers alone don't convince portfolio managers. A quant analyst needs to present findings clearly.

fig, axes = plt.subplots(1, 2, figsize=(14, 5))

cumulative = (1 + returns).cumprod()
cumulative.plot(ax=axes[0])
axes[0].set_title("Cumulative Returns (2019-2024)")
axes[0].set_ylabel("Growth of $1")
axes[0].legend(tickers)

for ticker in tickers:
    axes[1].hist(
        returns[ticker], bins=80, alpha=0.5, label=ticker, density=True
    )
axes[1].set_title("Distribution of Daily Returns")
axes[1].set_xlabel("Daily Return")
axes[1].set_ylabel("Density")
axes[1].legend()

plt.tight_layout()
plt.savefig("quant_analysis_output.png", dpi=150)
plt.show()

The left chart shows how $1 invested in each ETF would have grown over the period. The right chart shows the distribution of daily returns, which lets you compare how spread out each one is and whether either has a longer left tail (more extreme losses). If the overlaid histograms are hard to read, try plotting them in separate panels or adding vertical lines at each ETF's average return.

Interpreting Results Like a Quant Analyst

Running the code is half the job. The other half is interpreting what the numbers mean and communicating that clearly. Here's what a typical run might produce.

In one run of this code, QQQ showed a higher mean daily return than SPY (roughly 0.08% versus 0.06%) but also higher volatility (about 1.5% daily standard deviation versus 1.2%). QQQ's annualized Sharpe ratio came in around 0.75, compared to SPY's 0.65. Your exact numbers will differ depending on when you run it, but the pattern is usually similar.

If both Sharpe ratios are close, the portfolio manager might prefer SPY for its lower volatility. If QQQ's Sharpe ratio is meaningfully higher, the extra risk was compensated.

The VaR numbers add another dimension. Even if two assets have similar Sharpe ratios, one might have a much worse worst-case scenario. A quant analyst would flag this. Something like, "QQQ delivered slightly better risk-adjusted returns, but its 95% VaR is 20% worse than SPY's, meaning on bad days, losses are significantly larger."

This kind of analysis uses more than one measure and makes the tradeoffs clear. That is a big part of the quant analyst job.

Where This Fits in the Bigger Picture

The example above is a simplified version of what quant analysts do each day, and conclusions based on just two ETFs don't generalize to all assets. In practice, you'd extend this in several directions.

You might test whether the difference in Sharpe ratios is large enough to take seriously, or whether a dataset of this size could produce it by chance. You might break the analysis into sub-periods, for example by comparing performance during the 2020 selloff with the 2021 rally, to see if one ETF held up better under stress. You might add more assets and look at how they move relative to each other to build a diversified portfolio.

Each of these extensions follows the same pattern. You load data, calculate a result, check whether it is reliable, then explain it. The math gets more complex, but the structure stays the same. You can explore more of these quantitative finance techniques in Python as you build confidence with the basics.

How to Become a Quant Analyst

The quant analyst role is one of the few jobs where your technical skills are directly testable. Firms often test candidates with coding problems, probability questions, and market analysis exercises, so practical skill matters a lot. On the job, your models either produce useful answers or they don't.

Many guides to this career focus almost entirely on which math textbooks to study. That's important background, but it misses the practical reality. Most quant analysts today spend more time writing Python than solving differential equations by hand. The math guides the model, but code is what lets you create it, check it, and put it into use.

If you're coming from a non-finance background (engineering, physics, computer science, or a self-taught programming path), you already have many of the skills. What you need is the financial context and practice applying your technical skills to market data. The foundations and future of quantitative finance can help fill in that context.

This article shows a common type of entry-level market analysis task. Some quant analyst roles focus more on pricing, risk systems, or research support, but the workflow here (load data, calculate returns, measure risk, present the result) appears in many of them. If you can run this code, understand why each step matters, and explain the results to someone who doesn't code, you're already practicing the job.

Start Building Quant Analyst Skills

You learn this work by running code on real market data and checking what the numbers mean. A good next step is to run the code above, change the date range, swap in two different ETFs, and compare how the Sharpe ratio and VaR change. Getting Started With Python for Quant Finance covers this from start to finish, with code templates to help you run it yourself.