IT
Undergraduate
Resolved

Pythonです。

x[i] = 1-2*np.random.random()

この2*np
とは何をしているのですか?

python

Answers

✨ Best Answer ✨

たぶんNumPyっていう数値計算用のライブラリを使っています。
np.random.random()でNumPyのメソッドを使って乱数を取得して、それを2倍してるってことだと思います。

ありがとうございます。

Post A Comment
Were you able to resolve your confusion?

Users viewing this question
are also looking at these questions 😉