@rzeta0 my friend, what do you think about the code using np.roll() (in the linked sketch)?
I'm afraid it would be a bit hard to explain on a short class. So I'll use the simpler inefficient function...
The next big step in efficiency would be using #scipy I think:
def count_live_neighbors(status):
"""Counts the number of neighboring live cells"""
kernel = np.array([
[1, 1, 1],
[1, 0, 1],
[1, 1, 1]
])
return scipy.signal.convolve2d(status, kernel, mode='same', boundary="wrap")



