<jupyter_start><jupyter_text>![Matplotlib](images/matplotlib_logo-s.png) Matplotlib Let's take a quick look at the matplotlib essentials.First let's import the neccesary modules: And now let's go with some examples.  1D plot A tangent between 0 and 4$\pi$.$$y = \tan(x), \; x\in[0., 4\pi]$$  1D polar plot  $\theta(\rho) = 2\pi \rho, \; \rho \in [0, 2]$  Exercise Plot the function $$y = \frac{\sin(x)}{x}, \; x\in[0.1, 6\pi]$$and try to * set the figure *legend** change the *line style*hint: checkout the [matplotlib examples](http://matplotlib.org/examples/index.html)<jupyter_code># %load files/sol_sinc.py<jupyter_output><empty_output><jupyter_text>![SciPy](images/scipy_logo.png) The SciPy framework builds on top NumPy and provides a large number of numerical algorithms for working with data. Some of the topics that SciPy covers are:* Special functions ([scipy.special](http://docs.scipy.org/doc/scipy/reference/special.html))* Integration/ODEs ([scipy.integrate](http://docs.scipy.org/doc/scipy/reference/integrate.html))* Optimization ([scipy.optimize](http://docs.scipy.org/doc/scipy/reference/optimize.html))* Interpolation ([scipy.interpolate](http://docs.scipy.org/doc/scipy/reference/interpolate.html))* Fourier Transforms ([scipy.fftpack](http://docs.scipy.org/doc/scipy/reference/fftpack.html))* Signal Processing ([scipy.signal](http://docs.scipy.org/doc/scipy/reference/signal.html))* Linear Algebra ([scipy.linalg](http://docs.scipy.org/doc/scipy/reference/linalg.html))* Sparse Eigenvalue Problems ([scipy.sparse](http://docs.scipy.org/doc/scipy/reference/sparse.html))* Statistics ([scipy.stats](http://docs.scipy.org/doc/scipy/reference/stats.html))* Multi-dimensional image processing ([scipy.ndimage](http://docs.scipy.org/doc/scipy/reference/ndimage.html))* File IO ([scipy.io](http://docs.scipy.org/doc/scipy/reference/io.html))In many cases, you will want to import specific names from `scipy` subpackages. However, as a start, it is helpful to do the following import:  Approach One of the most important skills in data science is to be able to find Python functions and classes in a module and learn how to use them yourself. Here are some recommended steps on how to go about this:* Find the online documentation for the package you are using.* Try to find the subpackage or even the function that looks like will do the job.* Import the module, function or class and use tab completion and `?` to explore it.* Try using the function or class for an extremely simple case where you know the answer.* Then try using for your real problem.  Data FittingLet's randomize a exponential decay function and try to do a linear fit.We have$$D(t) = N e^{(-t/\tau)}$$ * Define the function * randomize data * plot * Look for fit scipy module and fit * plot result  Exercise: simple integration  Calculate $$I = \int_0^\infty e^{-x} dx$$hint: [GIYF](https://www.google.es/search?q=scipy%20integrate%20function&rct=j)<jupyter_code># %load files/sol_integ.py
#help(integrate)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13397287462785312, 'fraction_numerical': 0.005623552762156798, 'mean_word_length': 5.171428571428572, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '296830', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 1015, 'n_tokens_neox': 961, 'n_words': 298, 'path': 'scipy-tutorial-clean.ipynb', 'repo_name': 'iamc/cfmsctracks-ScientificPython', 'size': '3023'}