Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 204922

Equivalent R codes for Python function numpy.random.normal [closed]

$
0
0

What is the R equivalent codes for Python function numpy.random.normal? I am doing translation from python to R and I encounter this

Def generate_covariates(m = 500, d = 10): x = rand.normal(0, 1, (m, d)) # normalization of rand, rand is an object in another python file. X_normed = x / np.linalg.norm(x,axis=1).reshape(-1,1)# reshape: return X_normed

I understand rnorm() could be used to replace rand.normal but why is there (m,d) here? I thought rand.normal() only has mean, sd, and size. What does (m,d) mean here?


Viewing all articles
Browse latest Browse all 204922

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>