An algorithm for python3 data Analysis

values range from 1 to 5, and two columns of values A1 and A2 are randomly generated, with an average of 3.5 points and a standard deviation of 0.95. The correlation between A1 and A2 is 0.6
. How to write this in python3, how to look a little confused

Mar.18,2021

import numpy as np
mean = [3.5, 3.5]
cov = [[0.95, 0.6], [0.6, 0.95]]
x, y = np.random.multivariate_normal(mean, cov, 10000).T
print(np.mean(x), np.mean(y))
print(np.cov(x, y))

clipboard.png

Menu