Question: please use python language to solve, thank you. Problem 3 (3 points) Write a function called local_peak that takes as its input a one-dimensional Pandas

please use python language to solve, thank you. Problem 3 (3 points)please use python language to solve, thank you.

Problem 3 (3 points) Write a function called "local_peak" that takes as its input a one-dimensional Pandas series and returns a list of the positions of all local "peaks". That is, your function should return a list of the position values of all numbers in the series have have smaller values on both sides of them. Example: For pd. Series ([1, 3, 2, 4, 4, 5, 7, 4, 5]) your function should return (1,6] . For pd. Series ([1,2,3,3,3,2]) your function should return [] (since there is no local peak in this series, but rather a "plateau".) In [ ]: import pandas as pd import numpy as np def local_peak (x): ***Finds position of local peaks in Pandas Series** # YOUR CODE HERE raise NotImplementedError() # check your answer: X=pd. Series([1, 3, 2, 4, 4, 5, 7, 4, 5]) local_peak (X) = (1,6]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!