Finished Pandas rewrite.

Selection-level analysis is memory-efficient and fast.