0

I'm going through an online course, and don't understand the 4th line of this code:

 import numpy as np
 H1 = np.random.randn(50, 50) + 10
 p = 0.5
 U1 = np.random.rand(*H1.shape) < p

In particular, what is the * doing to H1.shape inside the np.random.rand function?

Mad Physicist
  • 95,415
  • 23
  • 151
  • 231
hoof_hearted
  • 675
  • 1
  • 8
  • 17

0 Answers0