Loading tutorials
read_csv, and that you can write a simple groupby aggregation. The rest of the tutorial builds on this chapter's working model of memory.3 min readread_csv, and you can read a short Python loop. Before you pick a chunk size, you need to know how much memory your rows take. Here you will measure it and use a small sample to estimate the cost of the whole file.2 min readread_csv and DataFrames. You will learn how chunksize changes what read_csv returns and how to loop over the result.3 min readpandas.read_csv before. It also assumes you have seen chunksize in the previous chapter. Here you will look at the object that read_csv returns when you pass chunksize, and at three ways to work wit3 min readread_csv. It also assumes you have read the chapters on measuring memory and reading in chunks. Chunking limits how many rows are in memory at once. usecols and dtype shrink each row, so the two techniques work together.3 min readfor loop and a with block in Python, and that you know how to filter a DataFrame with a boolean mask. It also assumes you have already read a CSV with chunksize. The goal is to keep only the rows you need from a file that is too large to load, and to end up3 min readread_csv(..., chunksize=...), loop over the chunks, and filter a DataFrame with a boolean mask. You should also know the basics of DataFrame.to_csv.3 min readread_csv, loop over a chunksize reader, and use groupby in pandas. You will compute totals, counts and means over a file that does not fit in memory.3 min readchunksize, you know groupby and agg, and you have seen how a total or count is built up chunk by chunk. Here the same idea is applied per group. Each chunk produces a small table of partial results, and you merge those tables as you go.3 min readpandas.read_csv, loop over a chunksize reader, and use basic groupby aggregation. It covers how to pick the chunksize value and how to check that your choice works.3 min readread_csv(..., chunksize=...) and combine partial groupby results. Chunked code often runs without errors and still gives wrong numbers, or runs out of memory anyway. Three causes account for most of these failures.3 min readread_csv with chunksize, can loop over a reader, and can combine partial results across chunks. Here you apply the same pattern to three other sources. The loop and the combining logic stay the same. Only the way you get an iterator of DataFrames changes.2 min readread_csv loops, combine partial groupby results, and know the limits of statistics that cannot be combined. Here you learn when to stop hand-writing chunk loops and switch tools.2 min read