I'm an engineer with minimal to zero knowledge about economical topics, please be patient with me if the following question makes no sense or is too basic ...

Currently I'm working through the "Python Data Science Handbook" of Jake van der Plas. In the chapter about time series data there are several examples with financial numbers, in particular stock rates.

Although the latter both definitions come quite close to the formular above, I'm unable to see the relationship between stock rates used in the data of the code example and the words used in the definitons from Wikipedia.

Can anyone help me to understand this a bit better, with a brief explanation or a hint where to continue reading on this topic?

$\begingroup$I'm not certain his maths is exactly right, but I assume that he is working out the return on buying a stock and keeping it for a year, i.e. $f_0$ = "cost of investment" and $f_1$ = "gain from investment" in the second WP definition you give. I would have thought $\frac{f_1 - f_0}{f_0}$ made more sense -- could it be a typo?$\endgroup$
– DanNov 8 '19 at 16:50

$\begingroup$Putting aside that multiplying by $100$ boils down to considering that a percentage is a unit/constant, which is not to me. I mean: $0.01=1\%=10^{-2}$. But he does so probably only for the plot.$\endgroup$
– keepAliveNov 10 '19 at 10:55

To understand the return formula, think of it this way: ROI is the effect/effort - 1. If you invest 100 dollars today, which is your effort, and one year later you have 105 dollars (effect), you get a 5% payoff.