Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import itertools
- import random
- g_row=10
- g_col=10
- m_prob = np.ones((g_row, g_col), dtype=np.int)
- s_acomulada = list(itertools.accumulate(itertools.chain.from_iterable(m_prob)))
- papeletas = np.ones((g_row, g_col), dtype=np.int)
- for i, fila in enumerate(s_acomulada):
- for j, n in enumerate(fila):
- papeletas[i][j] = tuple(range(inicio, inicio+n))
- inicio += n
- print(papeletas)
- TypeError: 'numpy.int32' object is not iterable
Add Comment
Please, Sign In to add comment