from numpy import random import csv def generate_wdl(): wins = 0 draws = 0 losses = 0 while wins < 4 or losses < 0: wins = int(random.normal(16.5,4)) draws = int(random.normal(7, 5)) losses = 33-(wins+draws) return wins,draws,losses def generate_goals(): goals_for = 0 goals_against = 0 while goals_for < 30 or goals_against < 20: goals_for = int(random.normal(40, 15)) goals_against = int(random.normal(40, 15)) return goals_for,goals_against file_path = "J_resultlarge.csv" result = [[0] * 6 for _ in range(100000)] for i in range(0,100000): result[i][0] = "Team " + f"{i}" result[i][1:4] = generate_wdl() result[i][4:6] = generate_goals() with open(file_path, mode="w", newline='') as csv_file: csv_writer = csv.writer(csv_file) csv_writer.writerows(result)