liveBook · Manning

Bit array

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

A bit array is a compact, indexed data structure whose elements are individually accessible binary values.

A bit array is a compact, indexed structure whose entries hold binary values. Apache Arrow uses one validity bit per row to record whether a value is missing, keeping null metadata separate from the column’s value representation. section 7.4.2

This design lets Arrow store nullable integers as integers instead of recoding them, and makes columns with few possible states especially compact. The trade-off is conversion cost and higher memory use when the data moves into pandas. section 7.4.2

Nullable categorical columns

A CSV column such as VendorID can be converted to boolean values while its missingness remains in the separate bit array. Arrow can therefore represent the values compactly, whereas the pandas version may require a larger object representation. section 7.4.2

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

How deep it goes
Explains per-row validity bits, nullable integer storage, and pandas conversion costs, but does not detail bit-level operations.
Examples
Uses nullable VendorID and store_and_fwd_flag columns to compare Arrow and pandas memory representations.
What it assumes
Assumes familiarity with columns, null values, and Python data libraries while contrasting Arrow with pandas and NumPy representations.
What you can do after
Operate/configure PyArrow conversions while evaluating nullable-column memory costs across Arrow and pandas.
How it connects
Connects bit arrays with missing values, Apache Arrow, pandas, NumPy, booleans, and integer representation.

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.