【发布时间】:2019-02-09 21:17:14
【问题描述】:
我是 Python 新手,所以我执行以下代码:
test1 = np.array([95, 91, 104, 93, 85, 107, 97, 90, 86, 93, 86, 90, 88, 89, 94, 96, 89, 99, 104, 101, 84, 84, 94, 87, 99, 85, 83, 107, 102, 80, 89, 88, 93, 101, 87, 100, 82, 90, 106, 81, 95])
plt.hist(test1)
plt.show()
在我标准化数据并再次检查绘图后:
plt.gcf().clear()
test2 = preprocessing.normalize([test1])
plt.hist(test2)
plt.show()
新图有不同的形状,在直方图上我看到每个数字代表一次,与第一个图相比,这对我来说看起来很奇怪。所以我希望 smth similat 首先绘制,但范围从 0 到 1。 我错在哪里了?
【问题讨论】:
标签: python scikit-learn histogram normalize