This stems from a related discussion, How to subtract specific elements in a list using functional programming in Mathematica?
How does one go about easily calculating percent differences between values in a list?
The linked question uses Differences to easily calculate absolute differences between successive elements in a list. However easy the built-in Differences function makes that particular problem, it still leaves the question as to how to perform different manipulations.
As I mentioned earlier, I am looking to now calculate percent differences. Given a list of elements, {value1, value2, ..., valueN}
, how does one perform an operation like (value2-value1)/value1
to said list?
I've tried finding a way to use Slot
or SlotSequence
to isolate specific elements and then apply a custom function to them. Is this the most efficient way to do something like this (assuming that there is a way to isolate elements and perform operations on them)?