Python Can Handle Millions of Rows: When Beancount + Pandas Finally Beat Excel
I hit a wall last month that I didn’t even know existed. I’ve been tracking my investment portfolio in Beancount for 8 years, and decided it was time to do a comprehensive 25-year historical analysis including my pre-Beancount years. I exported everything to Excel to create some pivot tables and visualizations—and that’s when I discovered Excel’s hard limit: 1,048,576 rows.
My dataset? 1,247,892 rows of daily price data across my entire portfolio history.
Excel silently truncated 199,316 rows. No warning. No error message. Just gone.
The Excel Row Limit Is Real (and Unchangeable)
Here’s what I learned: The 1,048,576 row limit is hardcoded into Excel’s Office Open XML specification. It’s not a setting you can change. It’s not something you can work around with registry hacks. It’s a fundamental constraint that applies to every version of Excel from 2007 to 2026.
For most personal finance tracking, this isn’t an issue. But when you’re doing:
- Multi-decade portfolio analysis with daily price data
- Large-scale transaction history across multiple accounts
- Comparative analysis across 10+ years of spending patterns
- Portfolio optimization using historical correlation matrices
…you hit that wall fast.
Python + Pandas: Where Excel Crashes, Python Is Just Getting Started
After hitting this limit, I rebuilt my entire analysis pipeline using Python and Pandas. Here’s what changed:
Performance: My 25-year dataset (1.2M+ rows) loads and processes in about 30 seconds on my standard business laptop. Excel would crash before even opening the file.
Scalability: Python doesn’t have a 1M row limit. It doesn’t have a 10M row limit. The only constraint is your computer’s memory—and Pandas is incredibly memory-efficient thanks to block-based storage (treating entire columns as continuous memory blocks rather than individual cells).
Analysis depth: With Pandas, I can now calculate:
- Sharpe ratios across different time periods
- Maximum drawdown analysis during market crashes
- Cross-asset correlation matrices
- Monte Carlo simulations for retirement planning
- Tax-loss harvesting opportunities across decades of cost basis data
All of this on plain text Beancount data. No proprietary formats. No vendor lock-in. Just human-readable ledger files and Python scripts.
Why This Matters for Beancount Users
Beancount’s plain text format + Python’s data processing power = unlimited scalability.
Here’s my workflow now:
- Beancount ledger: All transactions in plain text, version controlled with Git
- BQL queries: Extract exactly the data I need using Beancount Query Language
- Pandas DataFrames: Load BQL output into Pandas for complex analysis
- Jupyter notebooks: Document analysis, create visualizations, share with my spouse
The beauty? Beancount’s parsing is C++ optimized in recent versions, so even my 8 years of personal transactions load in under 2 seconds. Then I can pipe that into Pandas for whatever analysis I need.
Real Examples from My FIRE Journey
Here’s what I’m tracking with Beancount + Pandas that would be impossible in Excel:
- Portfolio rebalancing: Analyzing 25 years of historical data to optimize my 60/40 allocation
- Tax optimization: Identifying tax-loss harvesting opportunities across 40+ investment accounts
- Expense trends: Comparing spending patterns across 8 years to calculate my true FIRE number
- Scenario modeling: Running 10,000 Monte Carlo simulations on my retirement withdrawal strategy
Every analysis starts with plain text Beancount data. Every result is reproducible. Every script is version controlled.
The Tipping Point
For most people starting with Beancount, you won’t need Pandas immediately. If you have 2-3 years of transactions and basic reporting needs, Fava’s built-in reports are excellent.
But if you’re doing:
- Multi-year comparative analysis
- Investment performance attribution
- Large-scale data exports from commercial platforms
- Any analysis requiring more than ~50,000 rows
…you’ll want Python + Pandas in your toolkit.
Your Turn
Who else has hit Excel’s limits? What large-scale analyses are you running on Beancount data? I’d love to hear about your workflows, especially if you’ve built interesting Pandas pipelines on top of BQL queries.
And if you’re just getting started: trust me, choosing plain text accounting + Python now means you’ll never hit a scalability wall later.