Advice on RAM for data science usually stops at 16 GB being fine and 32 GB being better. We wanted a number you can work out for your own files, so we generated one table of invented orders at 1, 2 and 4 million rows, ran the same jobs on it in pandas, Polars and DuckDB, each in a fresh process, and measured the peak memory every time. This page turns those measurements into a rule, a table for 8 to 64 GB, and the arithmetic for renting a bigger machine instead.
The short answer: for pandas, plan on about 3 times your CSV's size in free memory to load and summarize it, and about 6 times for a working session that keeps joined, filtered and sorted copies; we measured 3.0 and 6.1 with pandas 3. Leave about 4 GB for the system and your apps. Then 16 GB handles a CSV of about 4 GB, or 2 GB in a session, and 32 GB about 9 GB, or 4.6 GB. If your biggest files are under 2 GB, 16 GB is enough; up to about 4.5 GB, or 9 GB for one pass, get 32. DuckDB and Polars' streaming engine needed about 1.3 times the CSV. Checked 2 December 2026.
Fastero
Connect your database. Ask questions. Get dashboards.
Postgres, BigQuery, Snowflake, and 10+ sources — live-connected, AI-powered, no dashboard builder learning curve.
Try free →How much RAM do you need for data science?
Work it out from your largest file:
RAM you need = what the system keeps + CSV size × multiplier
The multipliers we measured, as a multiple of the CSV's size on disk (4 million rows, a 338 MB CSV):
| Tool | Load and summarize | Working session | Held after loading |
|---|---|---|---|
| pandas 3 (Arrow strings, the default with pyarrow) | 3.0× | 6.1× | 1.6× |
| pandas, strings as Python objects (pandas 2 and earlier) | 3.3× | 4.5× | 1.9× |
Polars, eager (read_csv) |
3.7× | 6.7× | 2.3× |
Polars, streaming (scan_csv) |
1.3× (1.6× with a join) | not measured | no table kept |
| DuckDB, querying the CSV | 1.3× | not measured | no table kept |
Load and summarize is the highest peak of three jobs: read the file, group 4 million orders by 500,000 customers, and join a customers table, then total revenue by segment and country. The working session reads, joins, keeps only paid orders, sorts them, and holds on to every result, as a notebook does. Held after loading is what stayed in use once the file was loaded.
The rule agrees with the one Wes McKinney, who created pandas, gave in 2017: "my rule of thumb for pandas is that you should have 5 to 10 times as much RAM as the size of your dataset." A single pass needs less than that; a session sits at the low end of his range.
What we measured, and how to measure your own file
The table has 10 columns: five numbers (order ID, customer ID, quantity, unit price, amount) and five text columns (order date, customer email, region, product code, status). As a CSV it's 84.5 MB per million rows; as Parquet, 29% of that. Every job ran twice at 1, 2 and 4 million rows, each time in a new Python process, and we recorded the peak working set above the process's starting memory with psutil, on Windows 11 with 16 threads, Python 3.14.3, pandas 3.1.2, Polars 2.2.0, DuckDB 2.0.1 and pyarrow 26.0.1. All sizes are in MB of 1,048,576 bytes. The largest file was 0.33 GB, so the bigger numbers below are arithmetic from those measurements, not runs.
pandas scaled in a straight line: 274, 255 and 255 MB per million rows at 1, 2 and 4 million rows, and its two runs of each CSV job agreed within 1 MB. Other jobs varied by up to 51 MB between runs; the tables use the average.
To get your own multiplier, this script reads a CSV once and reports how much the process held and peaked at:
# python ram_check.py your.csv
import os, sys
import pandas as pd, psutil
path = sys.argv[1]
proc = psutil.Process(os.getpid())
def peak_bytes():
info = proc.memory_info()
if hasattr(info, "peak_wset"): # Windows
return info.peak_wset
import resource # Linux reports KiB, macOS bytes
peak = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
return peak if sys.platform == "darwin" else peak * 1024
start = proc.memory_info().rss
df = pd.read_csv(path)
held = proc.memory_info().rss - start
peak = peak_bytes() - start
size = os.path.getsize(path)
print(f"CSV on disk: {size / 2**30:6.2f} GB")
print(f"held after loading: {held / 2**30:6.2f} GB ({held / size:.1f}x the file)")
print(f"peak while loading: {peak / 2**30:6.2f} GB ({peak / size:.1f}x the file)")On our 4-million-row file, on Windows:
CSV on disk: 0.33 GB
held after loading: 0.52 GB (1.6x the file)
peak while loading: 1.00 GB (3.0x the file)Run it on a sample of your real data, say the first million rows, and multiply up. If the file is already too big to load, reading a large CSV in pandas covers doing it in pieces.
Why a CSV takes 3 to 6 times its size in pandas
Four things decide the multiplier, and they show where your file will differ from ours:
- Numbers cost 8 bytes each, however short they look. A quantity of
7is two bytes in the CSV, with its comma, and eight in memory. A file of short numbers grows more than ours did; a file of long decimals grows less. - Text depends on how it's stored. For 4 million unique 13-character codes, pandas 3's string type used 21.8 bytes a value and Python objects 72.3. pandas 3 makes the first the default: its release notes say a dedicated string type is "backed by PyArrow under the hood, if installed, otherwise falling back to being backed by NumPy object-dtype".
- Reading needs about twice the result.
read_csvpeaked at 1.00 GB to build a frame that then held 0.52 GB. Even if the finished DataFrame would fit, the read may not. - Every derived table is new memory. A merge, a filter and a sort each built another frame, which is why the session needed twice a single pass. pandas' own scaling guide warns that "some pandas operations need to make intermediate copies."
One surprise: in the session, strings as Python objects needed less (4.5×) than pandas 3's Arrow strings (6.1×). Filtering and sorting copied every Arrow string's bytes, while object columns copied only 8-byte pointers to strings they shared. For a single load, Arrow strings were smaller. Which wins depends on how many copies your work makes.
What fits in 8, 16, 32 and 64 GB of RAM
From the pandas 3 multipliers, leaving 4 GB for the operating system, a browser and an editor (our assumption: measure your own with Task Manager or Activity Monitor), with rows of our 10-column table:
| RAM | Free for data | CSV you can load and summarize | Rows | CSV for a working session | Rows |
|---|---|---|---|---|---|
| 8 GB | 4 GB | 1.3 GB | 16 million | 0.7 GB | 8 million |
| 16 GB | 12 GB | 4.0 GB | 48 million | 2.0 GB | 24 million |
| 32 GB | 28 GB | 9.3 GB | 112 million | 4.6 GB | 55 million |
| 64 GB | 60 GB | 19.9 GB | 241 million | 9.8 GB | 118 million |
These are estimates by arithmetic: we measured up to 4 million rows and multiplied, which held well for pandas because it scaled in a straight line. A table with more columns per row has fewer rows per GB.
Is 8 GB of RAM enough for data analysis?
For learning and for files under about 0.7 GB, yes. With a browser open, 8 GB leaves little room: a 1 GB CSV is past what our session could hold, and when memory runs out the kernel is killed or Python raises a MemoryError.
16 GB vs 32 GB RAM for data science
Take your largest regular file, multiply by 6 and add 4 GB. Under 16, buy 16; under 32, buy 32. In practice:
- 16 GB covers files up to about 2 GB in a full pandas session and 4 GB for a single pass, and much larger ones in DuckDB, which spills to disk when it runs short.
- 32 GB is the choice for 2 to 4.6 GB files in a pandas session, up to 9 GB for a single pass, or for running two big notebooks side by side.
- 64 GB pays off when you need 5 to 10 GB files in a pandas session, or up to 20 GB in one pass. Before buying it, try the tools below: they cut the multiplier more than doubling RAM raises the ceiling.
Connect any database. Ask in plain English.
Start free →What changes with Polars, DuckDB or Parquet

Peak memory per million rows for each tool, measured at 4 million rows on Windows 11. Invented data.
Polars, eager. Its finished table was the smallest of the three in-memory tools, 357 MB against pandas' 510 MB by its own count, but the process held 2.3 times the CSV after read_csv and peaked higher than pandas in the group-by (3.7×) and the session (6.7×). Limiting Polars to one thread cut the peak only to 681 MB, from 766 to 798 MB with 16 threads. We measured this on Windows only; Polars' allocator differs by platform, so treat our eager numbers as one data point. The Polars vs pandas comparison covers the rest.
Polars, streaming. pl.scan_csv(...) followed by .collect(engine="streaming") reads the file in batches. Polars' docs say this lets it "process datasets that do not fit in memory", and the group-by peaked at 1.3 times the CSV.
DuckDB. SQL over the file, read_csv('orders.csv') in the FROM, needed 1.3 times the CSV for both the group-by and the join. DuckDB also limits itself: its memory_limit "By default, this is set to 80% of the physical RAM of your system", and when a join, sort or aggregation needs more, "Larger-than-memory intermediates are (partially) written to disk in the temporary directory when required." Our DuckDB larger-than-memory guide tests that.
Parquet. The file was 29% of the CSV's size, but loading all of it into pandas still peaked at 2.8 times the CSV: Parquet shrinks the file, not the DataFrame. It helps when you read less: three columns peaked at 0.7 times, and DuckDB's group-by over the Parquet file at 0.6.
One caution on the streaming numbers: they rose with rows at our sizes (DuckDB used 161, 130 and 108 MB per million rows at 1, 2 and 4 million), probably in part because each thread keeps its own working state. They don't extrapolate in a straight line, and a group-by with millions of groups still needs room for them. Past that, DuckDB spills to disk; when even that's not enough, see pandas out of memory and when to move beyond one machine.
When renting a machine for the hours you need beats buying RAM
A laptop's RAM is soldered in on many models, so it's bought once, with the laptop. Apple's 14-inch MacBook Pro with M6 is a current example: 9to5Mac lists the 16 GB model with a 1 TB SSD at $1,999, and iClarified tracks the 32 GB, 1 TB model at a retail price of $2,399. The second 16 GB costs $400.
Fastero is an AI and data platform where people and AI agents work together on a team's data, and its notebooks, Streamlit apps and Python runs can rent the memory instead. A notebook's standard machine, included on every plan, is 1 CPU and 2 GB. On the Pro plan ($20 per editor a month), a notebook can move to a bigger machine, charged by the second from money added to the balance:
| Machine | Memory | Price | CSV to load and summarize | CSV for a session |
|---|---|---|---|---|
| Standard | 2 GB | Included | 0.5 GB | 0.2 GB |
| Medium | 8 GB | $0.20 an hour | 2.5 GB | 1.2 GB |
| Large | 16 GB | $0.40 an hour | 5.1 GB | 2.5 GB |
| Extra large | 32 GB | $0.80 an hour | 10.4 GB | 5.1 GB |
The last two columns apply our pandas multipliers after keeping 0.5 GB for the notebook server, our estimate. A hosted machine has no browser or editor sharing its memory, which is why we kept back 0.5 GB there instead of the laptop's 4.
$400 buys 500 hours on the 32 GB machine, or 1,000 on the 16 GB one. Here is how long renting 32 GB takes to cost as much as the laptop upgrade:
| Hours a month on 32 GB | Machine cost a month | Months to $400 | If you'd pay for Pro only for this |
|---|---|---|---|
| 5 | $4 | 100 | 16.7 months ($24 a month) |
| 10 | $8 | 50 | 14.3 months ($28 a month) |
| 20 | $16 | 25 | 11.1 months ($36 a month) |
| 40 | $32 | 12 | 7.7 months ($52 a month) |
So renting wins clearly when the big jobs come a few times a month and you or your team are on Pro anyway. If you need 32 GB all day, every working day (160 hours, $128 a month), the upgrade pays for itself in about three months. If you'd subscribe only for the machine, it takes 8 to 17 months at the rates above. Either way, the laptop's extra memory also helps everything else you run on it. A notebook server stops after about 10 idle minutes, which ends the charge. Prices are on pricing.

A notebook in Fastero, with the project's queries, apps and files beside it. Sample data.
The same notebook can run on a cron schedule on the server, with no browser open, and its SQL cells hand a query's rows to Python as a pandas DataFrame, so a big table can be filtered in the database before it reaches memory at all.
FAQ
How much RAM do I need for data science?
Multiply your largest CSV by 3 for a single load-and-summarize pass in pandas, or by 6 for a working session, then add about 4 GB for the system and apps. For files under 2 GB that's 16 GB; files up to about 4.5 GB, or 9 GB for a single pass, call for 32 GB.
Is 16 GB of RAM enough for data science?
For files up to about 2 GB in a full pandas session, or 4 GB for a single pass, yes, by our measurements. DuckDB and streaming Polars stretch it much further, because they read the file as they go instead of loading it.
How much RAM does pandas need for a 1 GB CSV?
About 3 GB at the peak of reading it and summarizing it, and about 6 GB for a session that keeps a joined, a filtered and a sorted copy, plus whatever the rest of the computer is using. Columns of short numbers push that up; long text stored as pandas 3 strings brings it down.
How much RAM do I need for 10 million rows in pandas?
For our 10-column table, about 2.5 GB to load and summarize and about 5.1 GB for a working session, from 255 and 519 MB per million rows. Wider tables need proportionally more, so measure a million rows of yours with the script above.
Does Polars or DuckDB use less memory than pandas?
DuckDB and Polars' streaming engine did, by far: about 1.3 times the CSV against pandas' 3.0, because they never hold the whole table. Eager Polars, which loads the table like pandas does, peaked higher than pandas in our Windows tests.
Do I need 64 GB of RAM for data science?
Only if you work with 5 to 10 GB files in pandas sessions, or up to 20 GB in single passes, or train models that need it. Most analysis fits in 16 to 32 GB once the heavy filtering and grouping is done by DuckDB or in the database, and a bigger machine can be rented by the hour for the jobs that don't.
Sources
Read on 2 December 2026; laptop prices are US retail prices as those pages listed them that day. Measurements were made the same day.
- pandas: What's new in 3.0.0, Scaling to large datasets
- Wes McKinney: Apache Arrow and the "10 Things I Hate About pandas" (2017)
- Polars: Streaming
- DuckDB: Memory management in DuckDB, Configuration
- Laptop prices: 9to5Mac, MacBook Pro prices (29 October 2026), iClarified, MacBook Pro M6 14-inch 32 GB price tracker
- Fastero: pricing
Try Fastero free: run your notebooks next to your data, and rent 8, 16 or 32 GB by the hour on Pro when a file outgrows your laptop. No credit card required.
Fastero Dev Team