79756673

Date: 2025-09-05 10:34:55
Score: 1.5
Natty:
Report link

Taking inspiration from the answer posted by jin-pendragon, I found a solution using np.minimum.reduceat. You need an array of length m containing the slice starting points (so the first element is always 0), let's call it start_indices, and then you can do:

mins = np.minimum.reduceat(myarray, start_indices)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: emengd