Simulaciones
import random as r | |
import csv | |
n = 10000000 | |
min = [] | |
res = [] | |
pts = [ 10, 9, 8, 7, 6, 5.5, 5, 4.5, 4, 3.5 ] | |
for i in range(0, n ): | |
r.shuffle(pts) | |
res = pts.copy() | |
r.shuffle(pts) | |
res = [ r1 + r2 for r1, r2 in zip( res, pts ) ] | |
res.sort() | |
min.append([res[2]]) | |
with open('LMP_2019.csv', 'w', newline='') as archivo: # Python 3 | |
w = csv.writer(archivo, delimiter='\t') # override for tab delimiter | |
w.writerows(min) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment