Build a one-step lag feature from an ordered, non-empty numeric series: position t holds the value from position t−1, and position 0 has no predecessor so it is NaN.
Implement solve(x).
Returns. Return a float NumPy array of the same length as the input.
Example 1
Input:
solve([10.0, 20.0, 30.0, 40.0])
Output:
[nan, 10.0, 20.0, 30.0]
Example 2
Input:
solve([7.0])
Output:
[nan]
No results yet
Run your code to check it against the examples, or submit to run every test.