python - Uniformly distributed data in d dimensions -


how can generate uniformly distributed [-1,1]^d data in python? e.g. d dimension 10.

i know how generate uniformly distributed data np.random.randn(n) dimension thing confused me lot.

assuming independence of individual coordinates, following generate random point in [-1, 1)^d

np.random.random(d) * 2 - 1 

the following generate n observations, each row observation

np.random.random((n, d)) * 2 - 1 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -