<jupyter_start><jupyter_text>Solutions for SciPy Exercises **Question 1**Let's try to interpolate a smooth curve between some data.Use the list of data as below.`y = np.linspace(0, 20, 5)``x = np.sin(x)`Import `numpy` and import `interpolate` from `scipy.`Use `.interp1d()` funtion to interpolate.Use `matplotlib.pyplot` library to plot the graph.<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate

x = np.linspace(0, 20, 5)
y = np.sin(x)

func = interpolate.interp1d(x, y, kind = 'cubic')

x_interp = np.linspace(0,20,1000)
y_interp = func(x_interp)

plt.figure(1)
plt.plot(x, y, 'o')
plt.plot(x_interp, y_interp)
plt.show()<jupyter_output><empty_output><jupyter_text>**Question 2**Let's try to use the FFT package to transform a data by using Discrete Cosine Transform (DCT).DCT expresses a finite sequence of data points in terms of a sum of cosine functions oscillating at different frequencies. Use `scipy.fftpack` library to import `dct`. Inverse it back again by using `idct` function.Use the data below to transform.`np.array([4. , 3. , 5. , 10., 5., 3.]))`<jupyter_code>from scipy.fftpack import dct, idct

data = np.array([4. , 3. , 5. , 10., 5., 3.])
print (data)
dct_data = dct(data)
print (dct_data)
idct_data = idct(dct_data)
print(idct_data)<jupyter_output>[ 48.  36.  60. 120.  60.  36.]
{'fraction_non_alphanumeric': 0.13140311804008908, 'fraction_numerical': 0.034892353377876766, 'mean_word_length': 4.8354978354978355, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '15235', 'license': 'MIT', 'n_tokens_mistral': 562, 'n_tokens_neox': 515, 'n_words': 160, 'path': 'Lesson13/SciPy_solution.ipynb', 'repo_name': 'KeyBlades/AI_course', 'size': '1347'}