Feb-22-2020, 11:30 PM
Everything you wrote in Post#4 makes sense when we treat x as a time series data. For example, x[0] is the starting position of a dog. x[1] is the position 1s later, x[2] is its position 2s later, etc. So, x[1] is the old positional data compared with x[2].
However, when I think of x.shift(1), my own way of reasoning (in Post#3) led to wrong answer. Usually, when do people use the function shift()?
However, when I think of x.shift(1), my own way of reasoning (in Post#3) led to wrong answer. Usually, when do people use the function shift()?