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.

Python / Numpy > Link > numpy.random と random.randomの違い > thread-safe かどうか

Last updated at Posted at 2017-02-24

numpy.randomrandom.randomの違いについて
http://stackoverflow.com/questions/7029993/differences-between-numpy-random-and-random-random-in-python

thread-safeかどうか

回答の中で気になったのは以下。

answered Aug 11 '11 at 17:56
Hannele
...
For numpy.random.seed(), the main difficulty is that it is not thread-safe -
...
As far as I can tell, random.random.seed() is thread-safe (or at least, I haven't found any evidence to the contrary).

他の違い

The numpy.random library contains a few extra probability distributions commonly used in scientific research, as well as a couple of convenience functions for generating arrays of random data. The random.random library is a little more lightweight, and should be fine if you're not doing scientific research or other kinds of work in statistics.

Mersenne twister

Otherwise, they both use the Mersenne twister sequence to generate their random numbers

crypt関連

上記のリンク先においては、crypt関連の場合は。。。という表記がいくつか見つかる。
deterministic(決定論的な)方法を使っているMersenne twisterなどではcrypt関連では問題になるとのこと。

cryptは使うことはないだろう。

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?