🐍 Move from Excel to Python in 3 simple steps


Move from Excel to Python in 3 simple steps

Use the workbook you already have.

Most finance work still runs on Excel.

When I was a derivatives trader, most the $7 billion operation was based on Excel.

The process was the same:

You build the model, drag the formulas down and refresh it every Monday.

Eventually, the sheets got too big and wouldn't even open. The analysis was basic and not that interesting.

An actuary in one of my courses said most of his analysis lived in Excel, and "it was hard to get projects started because of a lack of framework."

Today, we'll talk about how you can take the existing work you've done on Excel and quickly move it to Python.

Why Python is the new Excel:

  • Microsoft caps an Excel worksheet at 1,048,576 rows by 16,384 columns. Useful, until it's not.
  • In October 2020, Public Health England left 15,841 positive COVID-19 cases out of its daily count because an old Excel file format which capped each sheet at 65,536 rows.

Excel works until your data outgrows it.

The solution: Replace Excel with Pandas

Each step takes about one minute. Your workbook keeps running the whole time.

Step 1: Load the workbook you already refresh

Start with the workbook you refresh.

Here, it’s an NVDA tracker with three formula columns: a 20-day moving average, 20-day annualized volatility and a one-year percentile rank.

Load the raw prices with one line: pd.read_excel().

You end up with your data in a pandas DataFrame that looks just like Excel. Here's a super simple way to think about it:

And here's what the data actually looks like in the DataFrame.

Step 2: Translate one column at a time

I call this the drag-down rule: any formula you drag down a column in Excel is one line of pandas. =AVERAGE(B2:B21) dragged down 2,000 rows becomes prices.rolling(20).mean().

In this code example, you'll see the equivalent Excel functions for each line of pandas.

If it looks simple, it's because it is. Now instead of being limited by Excel's constraints, you are limited by the amount of RAM on your computer.

I'm showing how to do this live (with Agentic AI).

This is exactly what I'll demonstrate in my next free workshop: How to Become an Agentic Quant. I'll show you exactly the Agentic AI workflows professionals use for algorithmic trading, market data analysis, and quant finance (and how to do it without a PhD).

  • Build a working strategy from a single prompt
  • Generate a backtest blueprint on the fly
  • Bridge a backtest into a live broker connection

... even if you have never programmed a computer before or traded a single stock.

​See how it works live - reserve your free seat (only 500 registrations available) 👉​

​

Step 3: Hand back the same spreadsheet

The last line writes the results back with to_excel(), so you can use the same file.

The moving average and volatility match the old workbook to the decimal. The percentile rank is close, since PERCENTRANK uses a slightly different formula.

Start working through your existing sheets methodically. Eventually, you will completely replace your Excel-based workflow with Python and pandas.

Challenge: Copy the sma_20 line as sma_50, change 20 to 50 and add it to the last line. If a 50-day column shows up, you just translated your fourth formula.

Bonus list: the free Excel-to-Python starter kit

If you want to explore further, here are some Twitter posts you can use to get your hands on more code:

  1. JPMorgan’s Python training: J.P. Morgan’s notebooks for analysts and traders. Use them in Step 1. (source post)
  2. The 30-second pandas guide: The NVDA rolling stats build behind Step 2. (source post)
  3. xlwings: Calls Python from Excel and back, for colleagues who never leave the workbook in Step 3. (source post)
  4. 7 free YouTube channels: PyData, PyCon recordings, Real Python and four more. (source post)

Remember, a career upgrade starts with the finance you already know:

  • Your finance knowledge transfers. You know what a 20-day moving average should look like, so you spot a wrong number in seconds.
  • Your analysis outgrows one sheet. Ten years of daily prices for all 500 S&P stocks, one row per stock per day, is about 1.26 million rows, past Excel’s limit but routine for pandas.

Final thoughts and next steps:

The 3-bet sort works on one idea at a time. An agent pipeline runs it on every idea you have, in minutes. It validates the idea, runs the one-number test, and backtests only the promising ideas.

You want trading results you can explain: rules that beat both luck and doing nothing before risking anything.

To trade rules you trust, you must evolve:

  • A head full of ideas → one named bet per idea
  • Weekend backtests of dead ideas → one number in one second
  • Losses you can’t explain → knowing which bet broke

Your next step: Name the bet for the next idea you see.

But you don't have to spend 20+ years like I did:

​Build a safe, repeatable AI agentic pipeline 👉​

​

Cheers, Jason

P.S. I have a free Python workshop coming up: How to Become an Agentic Quant. It will give you an inside look at how to use Python for algorithmic trading, market data analysis, AI engineering, and quant finance.

All in the age of AI.

You'll watch me work through an end-to-end agentic AI workflow to build a real trading strategy!

​You can register for free here.


Jason Strimpel, founder of PyQuant News

Say 👋 on X/Twitter, LinkedIn, or book a call with me. You can always reply to these emails. I check them all.

When you're ready, there are 3 ways I can help you:

1. Python Foundations: Join 750+ alumni with a complete, self-paced system for learning Python from scratch. It's built specifically for people in finance who don't have time to waste on generic tutorials, broken installs, or "Hello World" exercises that have nothing to do with their actual work. You'll stay motivated since you'll work on practical projects you can use today. It covers the 80% of Python you need to know. Not theory you don't.

2. Getting Started With Python for Quant Finance: Join 1,700+ alumni who are finally using Python for algorithmic trading, market data analysis, AI engineering, and quant finance. It's the complete, practitioner-built system for going from zero Python to backtesting strategies, analyzing market data, and automating trades. It's my flagship course where I pack 20+ years of experience in less than 1 hour a day.

3. Agentic Quant System: Join 200+ AI engineers in the implementation program where you build a continuous running, 9-step agentic workflow. It's the same workflows I build for the largest trading firms on earth. From your first working AI agent in 60 minutes to a 9-agent pipeline that researches, backtests, validates, and deploys trading strategies autonomously.

⭐️ ⭐️ ⭐️ ⭐️ ⭐️
" A top-tier introduction to Python and quant finance. "
– Zac T
​

You got this email because you joined the PyQuant Newsletter or bought a product of mine.

You told me your email address is Reader.

Not right? Update your profile.

Want to stop getting these emails? No problem! Unsubscribe from all my emails.

Never investment advice. Use at your own risk. For educational purposes.

113 Cherry St #92768, Seattle, WA 98104

© 2026 PyQuant News, LLC

​

PyQuant Tips

For finance professionals, coders, and complete beginners. Automate your trading, investing, and data analysis with Python. No jargon, no fancy math, code you can use.

Read more from PyQuant Tips
Every strategy makes 1 of 3 bets: Use Python to tell you which one.

Sort any trading idea into 1 of 3 bets with 4 lines of Python Every strategy makes 1 of 3 bets: Use Python to tell you which one. My master's degree taught me MATLAB. Not Python. Since I didn't want to pay the $2,000 license fee, I watched every YouTube video I could find to teach myself. 96% of them were a complete waste of time. The other 4% buried me in strategy ideas. Statistical arbitrage. Trend and momentum. Pairs trading... Maybe that's you. A head full of trading ideas but nothing...

You don't need a $30,000 terminal to build an AI research desk Let Python pick what matters. Let the agent explain it. A Bloomberg Terminal costs about $30,000 a year. So you do what everyone does: You paste news headlines into ChatGPT. Then a 10-K. Then a chart. Then another chat window. By Friday you have 40 chats, 12 browser tabs, and no idea if any of what ChatGPT came up with works. That's experimenting, which is fine, but the sooner you build a system, the sooner you get results. Every...

Shuffle your backtest 1,000 times with 6 lines of Python Shuffle your strategy 1,000 times. If it can't beat 95% of them, it's luck. Nobody taught me how to backtest a trading strategy. So I read the books (and wrote two), the documentation, the research, and the blogs. Most of them end the same way: an equity curve going up and to the right. You copy the code. It loses money. So you change the moving average from 50 days to 43. Now it looks great. A folder full of backtests. And you don't...