WhereToGoNum by myke, 2016-02-15 2016-02-15 1.1

Test many countries on many parameters


In [14]:
# all imports
import csv
import numpy as np

In [5]:
# all data
tsvdata = "wheretogonum.tsv"

In [30]:
# read data
with open(tsvdata) as tsv:
    tsvr = csv.reader(tsv, delimiter="\t")
    tab = list(tsvr)
    head = np.array(tab[:2])
    data = np.array(tab[3:])
    mul  = np.array(tab[2])
    del tab

In [31]:
# show data
print (head)
print (mul)
print (data)


[['land' 'place' 'code' 'place' 'markdig' 'markest' 'status-soon'
  'status-later' 'available' 'politics' 'economy' 'future' 'work' 'prices'
  'currency' 'family' 'culture' 'society' 'educatuion' 'activity' 'world'
  'transport' 'nature' 'languages']
 ['страна' 'место' 'код' 'место' 'оценка_взвеш' 'оценка_общая'
  'статус_скоро' 'статус_потом' 'доступность' 'политика' 'экономика'
  'перспективы' 'работа' 'цены' 'валюта' 'семья' 'культура' 'общество'
  'образование' 'активность' 'мир' 'транспорт' 'природа' 'языки']]
['' '' '' '' '' '4' '3' '3' '3' '1' '2' '2' '2' '2' '2' '2' '2' '2' '2' '2'
 '1' '1' '2' '1']
[['США' 'Новая Англия' 'US-NEng' ..., '3' '4' '3']
 ['США' 'Калифорния' 'US-CA' ..., '3' '3' '3']
 ['Канада' 'Торонто' 'CA-GTA' ..., '3' '3' '3']
 ..., 
 ['Кавказ' 'везде' 'KAV' ..., '2' '3' '2']
 ['везде' 'везде' 'XXX' ..., '2' '2' '2']
 ['Африка' 'везде' 'AFR' ..., '1' '1' '1']]

In [39]:
# columns
PLACE = 3
EST   = 4
FIRST = 5
LAST  = len(mul)
CODE  = 2
print ("we study data in columns from {} to {}".format(FIRST, LAST-1))


we study data in columns from 5 to 23

In [48]:
# print info, pre-calculated in Google Calc
res1 = data[:,CODE:CODE+3]
res1


Out[48]:
array([['US-NEng', '1', '95'],
       ['US-CA', '2', '91'],
       ['CA-GTA', '3', '89'],
       ['CA-QUE', '4', '89'],
       ['AU', '5', '59'],
       ['CA-VAN', '6', '87'],
       ['US-MW', '7', '89'],
       ['US-NW', '8', '89'],
       ['FI-TUR', '9', '87'],
       ['FI-TAM', '10', '87'],
       ['FI-LAH', '11', '87'],
       ['AT', '12', '86'],
       ['BE', '13', '86'],
       ['LU', '14', '88'],
       ['NL', '15', '86'],
       ['CZ', '16', '88'],
       ['CH', '17', '88'],
       ['NZ', '18', '87'],
       ['FI-HEV', '19', '85'],
       ['RU-SPB', '20', '83'],
       ['RU-MSK', '21', '83'],
       ['FI-NOR', '22', '83'],
       ['DK', '23', '82'],
       ['NO', '24', '82'],
       ['SE-STO', '25', '82'],
       ['CA-X', '26', '81'],
       ['BG', '27', '80'],
       ['DE', '28', '80'],
       ['SE-GET', '29', '80'],
       ['RU-NSK', '30', '79'],
       ['SE-MAL', '31', '78'],
       ['US-SE', '32', '77'],
       ['BY', '33', '77'],
       ['SK', '34', '76'],
       ['RU-CHE', '35', '73'],
       ['SE-NOR', '36', '74'],
       ['GB', '37', '73'],
       ['SI', '38', '72'],
       ['US-NT', '39', '71'],
       ['US-SS', '40', '69'],
       ['PL', '41', '70'],
       ['RU-CHB', '42', '67'],
       ['PT', '43', '68'],
       ['FR', '44', '68'],
       ['HU', '45', '67'],
       ['IL', '46', '66'],
       ['KR', '47', '68'],
       ['ES', '48', '66'],
       ['LV', '49', '65'],
       ['LT', '50', '65'],
       ['US-GP', '51', '63'],
       ['EE', '52', '63'],
       ['US-X', '53', '60'],
       ['IT', '54', '61'],
       ['GR', '55', '53'],
       ['RO', '56', '53'],
       ['CN', '57', '53'],
       ['UA', '58', '38'],
       ['YUG', '59', '37'],
       ['SAM', '60', '31'],
       ['SEA', '61', '30'],
       ['KAV', '62', '25'],
       ['XXX', '63', '25'],
       ['AFR', '64', '19']], 
      dtype='<U17')

In [ ]: