FunctionRacerProblemsRace

Daily Returns

EasyPyTorchPython

prices holds one price per day. Return the return of each day after the first: its price divided by the price of the day before, minus 1.

Example 1

prices [100.0,110.0,99.0]
returns [0.1,-0.1]

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More PyTorch problems