在完成作业之前,先引入需要用到的库
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
题目1:
代码:
x = np.linspace(0,10,1000)
y = np.power(np.sin(x - 2),2) * np.exp(-1 * x * x)
plt.plot(x,y,'r-',label = '$sin2(x-2)e-x2$')
plt.xlim((0,2))
plt.xlabel('my x label')
plt.ylabel('my y label')
plt.title('my func')
plt.legend()
plt.show()
运行结果:
题目2:
代码:
X = np.rando