This might be too confounded. I think the logic is right, again, not sure if this would be a performance benefit though (but I think the forloop might be absorbing some runtime)

```python
indptr_subset = h5_indptr[1::2] - h5_indptr[:-1:2] if h5_indptr % 2 else h5_indptr[1::2] - h5_indptr[::2]
indptr = np.empty(len(keep) + 1, dtype=np.int32)
indptr[0] = 0
indptr[1:] = indptr_subset.cumsum()
```