SHARE
TWEET

Untitled

a guest Oct 18th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data = [
  2.     ['Ухмыляюсь', 2.26, 1.02, 87.3],
  3.     ['Сияю от радости', 19.1, 1.69, 150.0],
  4.     ['Катаюсь от смеха', 25.6, 0.774, 0.0],
  5.     ['Слёзы радости', 233.0, 7.31, 2270.0],
  6.     ['Подмигиваю', 15.2, 2.36, 264.0],
  7.     ['Счастлив', 22.7, 4.26, 565.0],
  8.     ['Глаза-сердца', 64.6, 11.2, 834.0],
  9.     ['Целую', 87.5, 5.13, 432.0],
  10.     ['Задумчивость', 6.81, 0.636, 0.0],
  11.     ['Равнодушие', 6.0, 0.236, 478.0],
  12.     ['Солнечные очки', 4.72, 3.93, 198.0],
  13.     ['Громко плачу', 24.7, 1.35, 654.0],
  14.     ['След от поцелуя', 21.7, 2.87, 98.7],
  15.     ['Два сердца', 10.0, 5.69, 445.0],
  16.     ['Сердце', 118.0, 26.0, 1080.0],
  17.     ['Червы', 3.31, 1.82, 697.0],
  18.     ['Класс', 23.1, 3.75, 227.0],
  19.     ['Пожимаю плечами', 1.74, 0.11, 0.0],
  20.     ['Огонь', 4.5, 2.49, 150.0],
  21.     ['Переработка', 0.0333, 0.056, 932.0]
  22. ]
  23.  
  24. emojixpress_sum = 0
  25. instagram_sum = 0
  26. twitter_sum = 0
  27. for row in data:
  28.     emojixpress_sum += row[1]
  29.     instagram_sum += row[2]
  30.     twitter_sum += row[3]
  31.    
  32. emojixpress_mean = emojixpress_sum / len(data)
  33. instagram_mean = instagram_sum / len(data)
  34. twitter_mean = twitter_sum / len(data)
  35.  
  36. for i in range(len(data)):
  37.     emojixpress_normalized = data[i][1] / emojixpress_mean
  38.     instagram_normalized = data[i][1] / instagram_mean
  39.     twitter_normalized = data[i][1] / twitter_mean
  40.     index = emojixpress_normalized + instagram_normalized + twitter_normalized
  41.     datа[i].append(index)
  42.    
  43. print('Название эмодзи  | Индекс использования')
  44. print('---------------------------------------')
  45. for row in data:
  46.     print('{: <16} | {: >20.2f}'.format(row[0], row[4]))
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top