Numpy array requires explicit `resize`s, while `array` dynamically resizes. An `array` is typed, and hence compact, and a memcpy can be used when constructing a numpy array from it.

This is a standard algorithm (see `DictVectorizer`, `CountVectorizer`, etc.) for compiling CSR directly, but I haven't worked out whether there's a nice, efficient way to refactor it.