SHARE
TWEET

aaa

a guest Nov 12th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def get_size(liste, nb_process):
  2.     if len(liste) > nb_process:
  3.         taille = len(liste) // nb_process
  4.         liste_finale = []
  5.         i = 0
  6.  
  7.         for _ in range(nb_process):
  8.             if _ == nb_process - 1:
  9.                 liste_finale.append(liste[i:])
  10.             else:
  11.                 liste_finale.append(liste[i:i+taille])
  12.             i += taille
  13.         del taille
  14.     else:
  15.         taille = 1
  16.         liste_finale = [[iteration] for yr in liste]
  17.  
  18.     return liste_finale
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top