liveBook · Manning

Columnar data

As explained in Fast Python: High performance techniques for large datasets

Columnar data is tabular data organized and stored by column rather than by complete row, enabling efficient access to selected fields and data compression.

Columnar data organizes tabular values by column rather than complete row. This layout supports selective field access, typed representation, compression, and efficient transfer between processes or languages. section 7.0 section 8.2

Use columnar representations when performance depends on memory, I/O, or selecting only part of a table:

  • Read only the columns required by an analysis instead of loading complete rows. section 8.2
  • Assign narrow, appropriate types because overly general column types increase memory use and slow operations. section 7.1.2
  • Apply compression and encodings such as dictionaries or run-length encoding when columns contain repeated patterns. section 8.5
  • Use Apache Arrow when columnar data must move across languages, processes, or machines. section 7.0

Converting taxi data to Parquet

Apache Arrow can read a compressed CSV table and write it as Parquet: `table = csv.read_csv("yellow_tripdata_2020-01.csv.gz")`; `pq.write_table(table, "202001.parquet")`. Parquet stores typed data by column, enabling selective access and compression for the New York City taxi dataset. section 8.2 section 8.5

Figure 7.2 The internal architecture of PyArrow

Use the architecture diagram to trace how Python wrappers connect pandas-oriented workflows with Arrow's lower-level implementations, persistence layers, and interprocess or intermachine communication. section 7.4.1

How Fast Python: High performance techniques for large datasets covers it

How deep it goes
Explains layout, typing, encoding, compression, and interoperability, but defers detailed persistent formats and on-disk implementations.
Examples
Uses pandas dtype optimization, PyArrow CSV conversion, Parquet storage, and New York City taxi records.
What it assumes
Assumes familiarity with pandas data frames and tabular analytics while demonstrating column typing and memory measurement.
What you can do after
Operate/configure pandas, Arrow, and Parquet workflows to select, type, compress, store, and transfer tabular columns.
How it connects
Connects columnar data with pandas, Apache Arrow, Parquet, data compression, type inference, and chunking.

Also explained in

Compare how 4 books explain columnar data →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fast Python: High performance techniques for large datasets. The section links point to the parts of the book it draws on.