x = np.arange(start=0, stop=5, step=0.1)
n_data = len(x)
n_rnd = 1000
m = np.random.normal(loc=1, scale=0.3, size=n_rnd)
b = np.random.normal(loc=5, scale=0.3, size=n_rnd)
y = m * x[:, (np.newaxis)] + b
for val in y.transpose():
    plt.plot(x, val, alpha=0.05)
plt.show()
How to efficiently generate a straight line with random slope and intercept in Python?