<jupyter_start><jupyter_text>[SciPy](https://docs.scipy.org/doc/scipy/reference/)[SciPy](http://cs231n.github.io/python-numpy-tutorial/numpy-array-indexing) provides a large number of functions that operate on numpy arrays and are useful for different types of scientific and engineering applications such as:1. [Custering](https://docs.scipy.org/doc/scipy/reference/cluster.html).2. [Discrete Fourier Analysis](https://docs.scipy.org/doc/scipy/reference/fftpack.html).3. [Interpolation](https://docs.scipy.org/doc/scipy/reference/interpolate.html).4. [Linear algebra](https://docs.scipy.org/doc/scipy/reference/linalg.html).5. [Signal](https://docs.scipy.org/doc/scipy/reference/signal.html) and [Image processing](https://docs.scipy.org/doc/scipy/reference/ndimage.html).6. [Optimization](https://docs.scipy.org/doc/scipy/reference/optimize.html).7. [Sparse matrix](https://docs.scipy.org/doc/scipy/reference/sparse.html) and [sparse linear algebra](https://docs.scipy.org/doc/scipy/reference/sparse.linalg.html). Table of Contents1&nbsp;&nbsp;Optimization example  Optimization example<jupyter_code>try:
    import scipy
except:
    !pip3 install scipy

try:
    import numpy as np
except:
    !pip3 install numpy
    import numpy as np
    
try:
    import matplotlib.pyplot as plt
except:
    !pip3 install matplotlib
    import matplotlib.pyplot as plt

# http://www.scipy-lectures.org/advanced/mathematical_optimization/
from scipy import optimize
def f(x):
    return -np.exp(-(x - .7)**2)
sol = optimize.brent(f)
print('min =', sol, '\nx =', f(sol))
x = np.arange(-10, 10, 0.1)
plt.plot(x, f(x))
plt.plot([sol],[f(sol)], 'ro')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15930787589498807, 'fraction_numerical': 0.013126491646778043, 'mean_word_length': 4.723549488054608, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 10, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '599808', 'license': 'CC0-1.0', 'n_tokens_mistral': 633, 'n_tokens_neox': 611, 'n_words': 106, 'path': 'scientific_computation/scipy.ipynb', 'repo_name': 'vicente-gonzalez-ruiz/python-tutorial', 'size': '1676'}