Archived
15 lines
212 B
Python
15 lines
212 B
Python
import numpy as np
|
|
|
|
|
|
def pick(lst):
|
|
if len(locals()) < 2:
|
|
n = 1
|
|
|
|
lst = np.array(lst)
|
|
# i = np.random.permutation(len(lst))
|
|
i = np.random.randint(len(lst))
|
|
|
|
k = lst[i]
|
|
|
|
return k, i
|