Paste Search Dynamic
Recent pastes
maincheck
  1. import numpy as np
  2. from random import choice
  3. def fun(x, cond):
  4.     i = m - len(str(x))
  5.     res = '#-' if x<0 else '#'
  6.     if cond:
  7.         return res + str(abs(x)) + ''.join([choice(pack_check) for _ in range(i)])
  8.     return res + ''.join([choice(pack_check) for _ in range(i)]) + str(abs(x))
  9.  
  10. list = [4347, 1067, -3092, -7294, -10439, -12071, -12112, -10899, -9109, -7468, -6188, -5118, -4100, -3510, -3726, -4411, -4615, -3557, -1465, 667, 2177, 3301, 4484, 5731, 6591, 6776, 6464, 6156, 6135, -15501, -16769, -18439, -20594, -23248, -43, -927, -1454, -1662, -1912, -2446] * 25000
  11. n = len(list)
  12. m = 6 # максимальное количество символов в числах list
  13. print(f'{n:_d}')
  14.  
  15. a = np.array(list)
  16. maincheck = np.random.randint(0,2,n).astype(bool)
  17. pack_check = 'ABCDE'
  18.  
  19. vect = np.vectorize(fun)
  20. lost = vect(a, maincheck)
  21.  
  22. print(lost[:40])
Parsed in 0.007 seconds