简单随机采样

代码示例

path = r"C:\data\采样表示例.csv"
xlimts = {"x1": [0, 10], "x2": [0, 20]}
s = RandomSampling(xlimts)
points = s.sample(50, tablePath=path)

    # 画图展示
plt.plot(points[:, 0], points[:, 1], "o")
plt.xlabel(s.xTitle[0])
plt.ylabel(s.xTitle[1])
plt.show()
../../_images/%E7%AE%80%E5%8D%95%E9%9A%8F%E6%9C%BA%E9%87%87%E6%A0%B7%E6%95%88%E6%9E%9C%E5%9B%BE.png