new_learner
new_learner

Reputation: 51

matrix of mean 0 and standard deviation 0.1 with python

How do I initialize a matrix with random values so that the mean should be 0 and standard deviation should be 0.1? Is there a easy way to do this with python??

Some one please tell me how to do this.

Upvotes: 0

Views: 1466

Answers (1)

Thibaut
Thibaut

Reputation: 1408

I am assuming that you mean that each entry of the matrix should be drawn from a normal distribution with mean 0 and standard deviation 0.1. This can be achieved using numpy with:

from numpy import random

a = random.normal(0, 0.1, (10, 10))

This will create a 10x10 random matrix.

Upvotes: 6

Related Questions