<jupyter_start><jupyter_text>SciPyCongratulations! In the previous 3 notebooks we have covered the fundamentals of numerical computing with Python - Variables, operations and functions - Conditionals, lists and looping - Arrays, vector operations and plottingPlus some handy concepts like print formating, list comprehensions and lamda functions to keep your code tidy and efficient.For the final tutorial notebooks we will look at specialized Python libraries which are often useful in practise.These topics are covered in more detail in walk-throughs online, so we will only give an overview here and link to more complete tutorials. Typically, we only have access to the noisy measurements, not the true model. We can use the [curve_fit](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html) function to fit a `linear` model function to this data.<jupyter_code>from scipy.optimize import curve_fit
def linear(x,m,b): return m*x+b
params,_ = curve_fit(linear,data.time,data.y)
params
data['y fit'] = linear(data.time,*params)
data.plot(x='time');<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07129963898916968, 'fraction_numerical': 0.0009025270758122744, 'mean_word_length': 5.93125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '27946', 'license': 'MIT', 'n_tokens_mistral': 308, 'n_tokens_neox': 295, 'n_words': 129, 'path': 'Scipy.ipynb', 'repo_name': 'Maselko/NumericalPython', 'size': '1108'}