Is there a way that I can give python a list of values like [ 1, 3, 4.5, 1] and obtain a function that relates to those values? like y = 3x+4 or something like that?
I don’t want to plot it or anything, I just want to substitute values in that function and see what the result would be.
edit: is there a way that python can calculate how the data is related? like if I give it the list containing thousands of values and it returns me the function that was adjusted to those values.
Based on your comments to David Heffernan’s answer,
it seems like you are trying do a regression analysis (probably a linear regression) and fit the values.
You can use NumPy for linear regression analysis in Python. Here a sample from the NumPy cookbook.