Guest User

Untitled

a guest
May 25th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import numpy as np
  2. import itertools
  3. import random
  4.  
  5. g_row=10
  6. g_col=10
  7.  
  8. m_prob = np.ones((g_row, g_col), dtype=np.int)
  9.  
  10. s_acomulada = list(itertools.accumulate(itertools.chain.from_iterable(m_prob)))
  11.  
  12. papeletas = np.ones((g_row, g_col), dtype=np.int)
  13.  
  14. for i, fila in enumerate(s_acomulada):
  15. for j, n in enumerate(fila):
  16. papeletas[i][j] = tuple(range(inicio, inicio+n))
  17. inicio += n
  18.  
  19. print(papeletas)
  20.  
  21. TypeError: 'numpy.int32' object is not iterable
Add Comment
Please, Sign In to add comment