Skip to content

Instantly share code, notes, and snippets.

@SnowyPainter
Created March 19, 2023 09:02
Show Gist options
  • Save SnowyPainter/066b7f9fd8dd00b123dfe17a0c56fada to your computer and use it in GitHub Desktop.
Save SnowyPainter/066b7f9fd8dd00b123dfe17a0c56fada to your computer and use it in GitHub Desktop.
import random
def r():
nums = list(range(1, 26))
random.shuffle(nums)
return nums
table = []
for i in range(9):
table += r()
import pandas as pd
df = pd.DataFrame(0, index=range(15), columns=range(15))
for i in range(9):
for k in range(5):
df.iloc[(int(i/3)*5)+k, (i%3)*5:(i%3)*5+5] = list(map(str, table[k*5:k*5+5]))
df.to_csv("result.csv", index=False, header=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment