scientific-programming-exer.../exam/ex13/model.py
2019-02-23 21:01:16 +01:00

9 lines
135 B
Python

import numpy as np
def prepare_model(n, p):
"""
p must be between 0 and 1.
"""
return (np.random.rand(n, n) < p).astype(np.int8)