I have two array and after plotting the line graph with respect to x-axis and y-axis, I want to extract the linear part of graph in python. How can i do that with precision? For example: x-axis = [1,2,3,4] (Time in seconds) and y-axis = [values]. So, just want to calculate the slope and intercept of the linear part.
I tried using linregress function from scipy but the results weren't accurate enough. Is there any other function I can use.