Premium problem162. Log Returns from a Price Series

Easy Locked

Given a 1-D float array of n positive closing prices, return the 1-D array of n-1 continuously-compounded (log) returns log(p[t] / p[t-1]).

Input

[100. 105. 103. 110.]

Output

[ 0.04879016 -0.01923136  0.06575138]

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)