0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NumPyのrandomモジュールでの乱数の作り方

Posted at

NumPyはnp.randomモジュールで乱数を生成することができる。

・0以上1未満の一様乱数を生成するnp.random.rand()
 ()の中に指定した整数の個数分の乱数を生成します。

・x以上y未満の整数をz個生成するnp.random.randint(x, y, z)
 x以上y未満の整数を生成することに注意しましょう。
 さらに、zに(2,3)のように引数を指定すると、2×3の行列を生成することができます。

・ガウス分布に従う乱数を生成するnp.random.normal()

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?