Value in Between
The points (xs[i], ys[i]) are joined by straight lines, with xs increasing. Return the height of that line at each position in at.
Example 1
xs [0,10]
ys [0,100]
at [2.5,5]
returns [25.0,50.0]
A quarter of the way from 0 to 100 is 25, and halfway is 50.
Constraints
2 <= len(xs) <= 30- Every position in
atis betweenxs[0]andxs[-1]
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More SciPy problems
- Are They IndependentMedium
- Break-Even RateMedium
- Cheapest PairingMedium
- Do the Groups DifferMedium
- Fit the DecayMedium
- Is the Mean DifferentMedium
- Lowest PointMedium
- Nearest Point to Each QueryMedium