Fitting multiple cones to 2D data, how to impose ordering constraint on parameters

Are you saying the cumsum casts the variables into float and then you can’t index with them? If that’s the case, just cast the output of cumsum back to integer with cumsum(x).astype(int)