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
  • 107,652
  • 25
  • 181
  • 264
hoof_hearted
  • 675
  • 1
  • 9
  • 18

0 Answers0