11.23读书笔记
import numpy as np ls1 = [10, 42, 0, -17, 30] nd1 =np.array(ls1) print(nd1) print(type(nd1))
fig = plt.figure() ax = fig.add_subplot(2, 2, 1) y = np.random.randn(100) plt.plot(y); ax.set_title('1') y = np.random.rand(5) x = np.arange(5) ax = fig.add_subplot(2, 2, 2) plt.bar(x, y) ax.set_title('2'); y = np.random.rand(5) y = y / np.sum(y) y[y < .05] = .05 ax = fig.add_subplot(2, 2, 3) plt.pie(y) ax.set_title('3') plt.draw() plt.show()



浙公网安备 33010602011771号