mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-04 17:13:02 +00:00
fixup
This commit is contained in:
parent
0b676fa391
commit
ce1467461d
1 changed files with 0 additions and 18 deletions
|
@ -1,18 +0,0 @@
|
||||||
from copy import deepcopy
|
|
||||||
from random import randint
|
|
||||||
|
|
||||||
|
|
||||||
def shuffle(lst):
|
|
||||||
"""
|
|
||||||
Shuffles a list with the Fisher-Yates algorithm.
|
|
||||||
@ref https://poopcode.com/shuffle-a-list-in-python-fisher-yates/
|
|
||||||
@param lst list The list to shuffle.
|
|
||||||
@return list The a new list that is a shuffled copy of the original.
|
|
||||||
"""
|
|
||||||
tmplist = deepcopy(lst)
|
|
||||||
m = len(tmplist)
|
|
||||||
while (m):
|
|
||||||
m -= 1
|
|
||||||
i = randint(0, m)
|
|
||||||
tmplist[m], tmplist[i] = tmplist[i], tmplist[m]
|
|
||||||
return tmplist
|
|
Loading…
Reference in a new issue