numpy.random.Wahl vs random.Wahl

Warum numpy.random.Wahl nicht die selben, zufällig.Wahl? Wenn ich dies tun :

 >>> random.choice([(1,2),(4,3)])
 (1, 2)

Es funktioniert.

Aber wenn ich das mache:

 >>> np.random.choice([(1,2), (3,4)])
 Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "mtrand.pyx", line 1393, in mtrand.RandomState.choice 
 (numpy/random/mtrand/mtrand.c:15450)
 ValueError: a must be 1-dimensional

Wie kann ich erreichen das gleiche Verhalten wie zufällig.Wahl() in numpy.random.Wahl()?

InformationsquelleAutor user2399453 | 2017-04-27

Schreibe einen Kommentar