I think you need to specify dtype here (to avoid issues on 32-bit plat), e.g. ``np.arange(len(v),dtype='int64')``