Return the day-to-day changes in x — the gaps between consecutive values

NumPy · from Running totals and differences

.cumsum.cumprodnp.diffnp.gradientnp.maximum.accumulateprepend=

Putting the kettle on…

Starting up…

Exercise 2

Return the day-to-day changes in x — the gaps between consecutive values.

your answer
stuck? the lesson behind it
Running totals and differences
The reductions that don’t reduce — cumsum, diff, and their friends.