a中每个数出现的概率。...若a是整数,则a代表的数组是arange(a)。...>>> random.choice(5)3>>> random.choice([0.2, 0.4])0.2>>> random.choice([0.2, 0.4], p=[1, 0])0.2>>> random.choice...([0.2, 0.4], p=[0, 1])0.4>>> random.choice(5, 5)array([1, 2, 4, 2, 4])>>> random.choice(5, 5, False)array...([2, 0, 1, 4, 3])>>> random.choice(100, (2, 3, 5), False)array([[[43, 81, 48, 2, 8], [33, 79