{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import csv\n",
    "import math\n",
    "import datetime\n",
    "\n",
    "### 用dict保存信息\n",
    "#user_habit_dict:每个用户的乘车记录:起点,终点,距离\n",
    "user_habit_dict={}\n",
    "\n",
    "#start_end_dict:每条记录的起点,终点对\n",
    "start_end_dict={}\n",
    "\n",
    "#end_start_dict:每条记录的起点,终点对\n",
    "end_start_dict={}\n",
    "\n",
    "#user_habit_dict_test:test中每个用户的记录\n",
    "user_habit_dict_test={}\n",
    "\n",
    "#bike_dict:bike中的记录\n",
    "bike_dict={}\n",
    "\n",
    "#弧度转换\n",
    "def rad(tude):\n",
    "    return (math.pi/180.0)*tude\n",
    "\n",
    "#geohash模块提取的\n",
    "__base32 = '0123456789bcdefghjkmnpqrstuvwxyz'\n",
    "__decodemap = { }\n",
    "for i in range(len(__base32)):\n",
    "    __decodemap[__base32[i]] = i\n",
    "del i\n",
    "\n",
    "### geohash转经纬度\n",
    "#返回 精确的经纬度和误差\n",
    "def decode_exactly(geohash):\n",
    "    lat_interval, lon_interval = (-90.0, 90.0), (-180.0, 180.0)\n",
    "    lat_err, lon_err = 90.0, 180.0\n",
    "    is_even = True\n",
    "    for c in geohash:\n",
    "        cd = __decodemap[c]\n",
    "        for mask in [16, 8, 4, 2, 1]:\n",
    "            if is_even: # adds longitude info\n",
    "                lon_err /= 2\n",
    "                if cd & mask:\n",
    "                    lon_interval = ((lon_interval[0]+lon_interval[1])/2, lon_interval[1])\n",
    "                else:\n",
    "                    lon_interval = (lon_interval[0], (lon_interval[0]+lon_interval[1])/2)\n",
    "            else:      # adds latitude info\n",
    "                lat_err /= 2\n",
    "                if cd & mask:\n",
    "                    lat_interval = ((lat_interval[0]+lat_interval[1])/2, lat_interval[1])\n",
    "                else:\n",
    "                    lat_interval = (lat_interval[0], (lat_interval[0]+lat_interval[1])/2)\n",
    "            is_even = not is_even\n",
    "    lat = (lat_interval[0] + lat_interval[1]) / 2\n",
    "    lon = (lon_interval[0] + lon_interval[1]) / 2\n",
    "    return lat, lon, lat_err, lon_err\n",
    "\n",
    "#返回 欧式距离  （其实还可以返回南北方向距离,东西方向距离,曼哈顿距离,方向(-0.5:0.5)，但是删了，没啥吊用）\n",
    "def produceLocationInfo(latitude1, longitude1,latitude2, longitude2):\n",
    "    radLat1 = rad(latitude1)\n",
    "    radLat2 = rad(latitude2)\n",
    "    a = radLat1-radLat2\n",
    "    b = rad(longitude1)-rad(longitude2)\n",
    "    R = 6378137\n",
    "    d = R*2*math.asin(math.sqrt(math.pow(math.sin(a/2),2)+math.cos(radLat1)*math.cos(radLat2)*math.pow(math.sin(b/2),2)))\n",
    "    detallat = abs(a)*R\n",
    "    detalLon = math.sqrt(d**2-detallat**2)\n",
    "    if b==0:\n",
    "        direction = 1/2 if a*b>0 else -1/2\n",
    "    else:\n",
    "        direction = math.atan(detallat/detalLon*(1 if a*b>0 else -1))/math.pi\n",
    "    return round(d)\n",
    "\n",
    "#返回 欧式距离\n",
    "def loc_2_dis(hotStartLocation,hotEndLocation):\n",
    "    StartLocation = decode_exactly(hotStartLocation[:7])\n",
    "    EndLocation = decode_exactly(hotEndLocation[:7])\n",
    "    latitude1 = StartLocation[0]\n",
    "    longitude1 = StartLocation[1]\n",
    "    latitude2 = EndLocation[0]\n",
    "    longitude2 = EndLocation[1]\n",
    "    return produceLocationInfo(latitude1, longitude1, latitude2, longitude2)\n",
    "\n",
    "#返回 是否放假,距0点的分钟数,距5月1的天数\n",
    "def produceTimeInfo(TimeData):\n",
    "    TimeData = TimeData.split(' ')\n",
    "    baseData = datetime.datetime(2017, 5, 1, 0, 0, 1)\n",
    "    if '-' in TimeData[0]:\n",
    "        mydata = TimeData[0].split('-')\n",
    "    else:\n",
    "        mydata = TimeData[0].split('/')\n",
    "    mytime = TimeData[1].split(':')\n",
    "    mydata[0] = int(mydata[0])\n",
    "    mydata[1] = int(mydata[1])\n",
    "    mydata[2] = int(mydata[2])\n",
    "    mytime[0] = int(mytime[0])\n",
    "    mytime[1] = int(mytime[1])\n",
    "    #mytime[2] = int(mytime[2].split('.')[0])\n",
    "    dt = datetime.datetime(mydata[0], mydata[1], mydata[2], mytime[0], mytime[1])\n",
    "    minute = mytime[1]+mytime[0]*60\n",
    "    # return int((dt-baseData).__str__().split(' ')[0]),miao,dt.weekday(),round(miao/900)\n",
    "    isHoliday = 0\n",
    "    if dt.weekday()in [5,6] or int((dt-baseData).__str__().split(' ')[0]) in [29,28]:\n",
    "        isHoliday=1\n",
    "    return isHoliday,minute,int((dt-baseData).__str__().split(' ')[0])\n",
    "\n",
    "#模型之间的融合，粗暴的取了最值，这个可以再提升\n",
    "def add2result(result1,result2):\n",
    "    for each in result2:\n",
    "        if each in result1:\n",
    "            #result1[each] = min(result1[each] ,result2[each] )\n",
    "            result1[each] = result1[each] *0.9 + result2[each] \n",
    "        else:\n",
    "            result1[each] = result2[each]\n",
    "    return result1\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 其实就是knn算法，结合了leak。一般的knn+leak应该是0.26分。这里主要有两点创新。一是给算出来的距离值除以频度的1.1次方，\n",
    "# 这个加了很多分，二是对于新用户又使用了一个新的knn，其他算法在处理新用户的时候也可以参考下。\n",
    "# knn算法产生的特征可以融合进xgb再训练，已实现，但内存不够弃赛\n",
    "def training(trainfile = 'train.csv',testfile = 'test.csv',subfile = 'submission.csv' ,\n",
    "             leak1 = 0.01 ,leak2 = 4 ,leak3 = 20,              #leak\n",
    "             qidianquan = 10,shijianquan = 10,jiejiaquan = 2,bikequan = 0.5,  #都是拼音，字面意思，越大则这个特征比重越大\n",
    "             zhishu = 1.06  #对结果影响很大\n",
    "             ):\n",
    "    tr = csv.DictReader(open(trainfile))\n",
    "    # tr 为一个DictReader类，是一个打开的文件流\n",
    "    #利用train.csv建立user_habit_dict和start_end_dict\n",
    "    for rec in tr:     #rec为每一行\n",
    "        user = rec['userid']\n",
    "        start = rec['geohashed_start_loc']\n",
    "        end = rec['geohashed_end_loc']\n",
    "        rec['isHoliday'] , rec['minute'] , rec['data'] = produceTimeInfo(rec['starttime'])\n",
    "        if user in user_habit_dict: #若用户有记录 则直接添加本行\n",
    "            user_habit_dict[user].append(rec)\n",
    "        else:\n",
    "            user_habit_dict[user] = [rec]\n",
    "\n",
    "        if start in start_end_dict: #若起点有记录 则直接添加\n",
    "            start_end_dict[start].append(rec)\n",
    "        else:\n",
    "            start_end_dict[start] = [rec]\n",
    "\n",
    "        if end in end_start_dict:\n",
    "            end_start_dict[end].append(rec)\n",
    "        else:\n",
    "            end_start_dict[end] = [rec]\n",
    "\n",
    "    print('train done!')\n",
    "    \n",
    "    # te是测试文件\n",
    "    te = csv.DictReader(open(testfile))\n",
    "    for rec in te:\n",
    "        user = rec['userid']\n",
    "        bike = rec['bikeid']\n",
    "        rec['isHoliday'], rec['minute'], rec['data'] = produceTimeInfo(rec['starttime'])\n",
    "        if user in user_habit_dict_test:\n",
    "            user_habit_dict_test[user].append(rec)\n",
    "        else:\n",
    "            user_habit_dict_test[user] = [rec]\n",
    "\n",
    "        if bike in bike_dict:\n",
    "            bike_dict[bike].append(rec)\n",
    "        else:\n",
    "            bike_dict[bike] = [rec]\n",
    "\n",
    "    print(\"test done!\")\n",
    "\n",
    "\n",
    "    #sub是提交文件\n",
    "    sub = open(subfile, 'w')\n",
    "\n",
    "    iter1 = 0\n",
    "    # AllhotLocSort = sorted(end_start_dict.items(), key=lambda d: len(d[1]), reverse=True)\n",
    "    te1 = csv.DictReader(open(testfile))\n",
    "    for rec in te1:\n",
    "        iter1 += 1\n",
    "        if iter1 % 10000 == 0:\n",
    "            print(iter1/20000,'%',sep='') #sep是实现分隔符，比如多个参数输出时想要输出中间的分隔字符\n",
    "        # testTime = timeSlipt(rec['minute'])\n",
    "        rec['isHoliday'], rec['minute'], rec['data'] = produceTimeInfo(rec['starttime'])\n",
    "        user1 = rec['userid']\n",
    "        bikeid1 = rec['bikeid']\n",
    "        order1 = rec['orderid']\n",
    "        start1 = rec['geohashed_start_loc']\n",
    "        hour1 = rec['minute']/60\n",
    "        minute1 = rec['minute']\n",
    "        isHoliday1 = rec['isHoliday']\n",
    "        biketype1 = rec['biketype']\n",
    "        data1 = rec['data']\n",
    "        result = {}\n",
    "        hotLoc = {}\n",
    "\n",
    "        #knn\n",
    "        if user1 in user_habit_dict:\n",
    "            for eachAct in user_habit_dict[user1]: #遍历有记录的用户所有记录\n",
    "\n",
    "                start2 = eachAct['geohashed_start_loc']\n",
    "                end2 = eachAct['geohashed_end_loc']\n",
    "                hour2 = eachAct['minute']/60\n",
    "                isHoliday2 = eachAct['isHoliday']\n",
    "                biketype2 = eachAct['biketype']\n",
    "                data2 = rec['data']\n",
    "\n",
    "                dis = loc_2_dis(start1, start2)  # 全部计算和当前项和test的差异\n",
    "                dis = min(dis, 1000)    #1000\n",
    "                qidian= qidianquan * (dis / 100) ** 2\n",
    "\n",
    "                detalaTime = abs(hour2 - hour1) if abs(hour2 - hour1) < 12 else 24 - abs(hour2 - hour1)\n",
    "                shijian= shijianquan * (detalaTime / 12 * 10) ** 2\n",
    "\n",
    "                dayType = isHoliday2 - isHoliday1\n",
    "                jiejia= jiejiaquan * (dayType * 10) ** 2 #\n",
    "\n",
    "                biType = int(biketype2) - int(biketype1)\n",
    "                bike= bikequan * (biType * 10) ** 2  #0.5\n",
    "\n",
    "\n",
    "\n",
    "                #利用终点预测\n",
    "                # return 欧式距离,南北方向距离,东西方向距离,曼哈顿距离,方向(-0.5:0.5)\n",
    "                # test2train_dis = loc_2_dis(start1,end2)\n",
    "                # train2train_dis = loc_2_dis(start2,end2)\n",
    "                # dis_detal = min(abs(test2train_dis[3]-train2train_dis[3]),1000)  #1000\n",
    "                # direction_detal = abs(test2train_dis[4]-train2train_dis[4])\n",
    "                # direction_detal = direction_detal if direction_detal<0.5 else 1-direction_detal\n",
    "                # jvli = 4 * (dis_detal/100)**2\n",
    "                # fangxiang = 1 * (direction_detal/0.5*10)**2\n",
    "\n",
    "                score = qidian+shijian+jiejia+bike              #jvli+fangxiang\n",
    "\n",
    "                # print(qidian,shijian,jiejia,bike,jvli,fangxiang)\n",
    "                if end2 in hotLoc:\n",
    "                    hotLoc[end2] += 1\n",
    "                else:\n",
    "                    hotLoc[end2] = 1\n",
    "                #hotLoc ={'wx4xxxx':n,...}\n",
    "                if end2 in result:\n",
    "                    if result[end2] > score:\n",
    "                        result[end2] = score   #因为代表差异所以越小代表越接近\n",
    "                else:\n",
    "                    result[end2] = score\n",
    "                #result = {'wx4xxxx':score,....}  #即当前test条目下，根据当前记录的项的终点的差异\n",
    "            for each in hotLoc:\n",
    "                result[each] = result[each] / (hotLoc[each]**zhishu)  #0\n",
    "            #出现次数越多，score越小，即可信度越高\n",
    "            for each in result:\n",
    "                result[each] = math.sqrt(result[each]) #开个方 不知道有啥意义\n",
    "        print(result)\n",
    "        #利用test中的用户历史记录\n",
    "        if user1 in user_habit_dict_test:\n",
    "            resulttest = {}\n",
    "            user_habit_dict_test[user1].sort(key = lambda x:x['data']*60*24+x['minute'])\n",
    "            xuhao = 0\n",
    "            for i in range(len(user_habit_dict_test[user1])-1):\n",
    "                if user_habit_dict_test[user1][i]['orderid'] == order1:\n",
    "                    xuhao = i\n",
    "                    resulttest[user_habit_dict_test[user1][i+1]['geohashed_start_loc']] = 21\n",
    "            for i in range(len(user_habit_dict_test[user1])):\n",
    "                if i not in [xuhao,xuhao+1]:\n",
    "                    resulttest[user_habit_dict_test[user1][i]['geohashed_start_loc']] = 21+abs(i-xuhao)\n",
    "                result = add2result(result, resulttest)\n",
    "\n",
    "        # leak\n",
    "        '''\n",
    "        if bikeid1 in bike_dict:\n",
    "            resultleak = {}\n",
    "            bike_dict[bikeid1].sort(key = lambda x:x['data']*60*24+x['minute'])\n",
    "            for i in range(len(bike_dict[bikeid1])-1):\n",
    "                if bike_dict[bikeid1][i]['orderid'] == order1:\n",
    "                    zhong = bike_dict[bikeid1][i+1]['data']*60*24+bike_dict[bikeid1][i+1]['minute']\n",
    "                    qi = bike_dict[bikeid1][i]['data']*60*24+bike_dict[bikeid1][i]['minute']\n",
    "                    detal = zhong-qi\n",
    "                    if detal<30:\n",
    "                        resultleak[bike_dict[bikeid1][i + 1]['geohashed_start_loc']] = leak1\n",
    "\n",
    "                    elif detal<2*60:\n",
    "                        resultleak[bike_dict[bikeid1][i + 1]['geohashed_start_loc']] = leak2  #4\n",
    "\n",
    "                    else:\n",
    "                        resultleak[bike_dict[bikeid1][i + 1]['geohashed_start_loc']] = leak3   #20\n",
    "            result = add2result(result,resultleak)\n",
    "        '''\n",
    "\n",
    "        #起点终点对的knn\n",
    "        if start1 in start_end_dict:\n",
    "            endDict = {}\n",
    "            resultqizhong={}\n",
    "            for eachAct in start_end_dict[start1]:\n",
    "                score = 0\n",
    "                score += (24-abs(hour1-eachAct['minute']/60))/24\n",
    "                score += (1-abs(isHoliday1-eachAct['isHoliday']))*0.4\n",
    "                if eachAct['geohashed_end_loc'] in endDict:\n",
    "                    endDict[eachAct['geohashed_end_loc']] += score\n",
    "                else:\n",
    "                    endDict[eachAct['geohashed_end_loc']] = score\n",
    "            hotLoc = sorted(endDict.items(),key = lambda x:x[1],reverse=True)\n",
    "            if len(hotLoc)>=1:\n",
    "                resultqizhong[hotLoc[0][0]] = 1000\n",
    "            if len(hotLoc) >= 2:\n",
    "                resultqizhong[hotLoc[1][0]] = 1001\n",
    "            if len(hotLoc) >= 3:\n",
    "                resultqizhong[hotLoc[2][0]] = 1002\n",
    "            result = add2result(result, resultqizhong)\n",
    "\n",
    "        #剔除不合理结果\n",
    "        for each in result:\n",
    "            distance = loc_2_dis(each,start1)\n",
    "            if distance > 2500:\n",
    "                result[each] = 1999\n",
    "\n",
    "\n",
    "        if start1 in result:\n",
    "            result[start1] = min(2000, result[start1])\n",
    "        else:\n",
    "            result[start1]=2000\n",
    "        result['fuck2'] = 2001\n",
    "        result['fuck3'] = 2002\n",
    "\n",
    "        bestResult = sorted(result.items(), key=lambda d: d[1])\n",
    "        string = rec['orderid']\n",
    "        num = 0\n",
    "        for item in bestResult:\n",
    "            #print(item)\n",
    "            string += ',' + item[0]\n",
    "            #print(item[0])\n",
    "            #print('---------')\n",
    "            # string += ':' + str(item[1]) + '\\t'\n",
    "            num += 1\n",
    "            if num == 3:\n",
    "                break\n",
    "        sub.write(string + '\\n')\n",
    "\n",
    "    sub.close()\n",
    "    print('ok')\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "train done!\n",
      "test done!\n",
      "{'wx4gg04': 6.863956830498947, 'wx4g6zb': 15.408362758845826, 'wx4g6xy': 17.858345171627832, 'wx4g6z1': 17.95368378729303, 'wx4g6xe': 17.701868478265485}\n",
      "{'wx4eqfx': 0.0, 'wx4eu36': 8.884044920590176, 'wx4eqep': 13.979625293326185}\n",
      "{'wx4e5ye': 1.70701310980226, 'wx4e5yg': 6.3801059338284425}\n",
      "{'wx4equ4': 16.001700905432195, 'wx4dxtx': 4.1615641703377415, 'wx4eqsu': 16.11214170948095}\n",
      "{}\n",
      "{'wx4ew9t': 17.986993191395783, 'wx4ew9s': 13.780326701995753, 'wx4ewd9': 7.729659204727808}\n",
      "{'wx4ekbw': 2.0626900208895775, 'wx4ekcs': 6.169151361209598, 'wx4ekc1': 5.84705830462633}\n",
      "{'wx4f8mn': 5.756723307608205}\n",
      "{'wx4ffy2': 14.84126942116942, 'wx4g2nw': 15.23351466061543, 'wx4g2np': 16.039483517106596, 'wx4st8m': 9.885430164607694}\n",
      "{'wx4engu': 17.686634854451178}\n",
      "{'wx4er6q': 17.445736271103353, 'wx4erd2': 14.398456052341654}\n",
      "{}\n",
      "{'wx4ff61': 13.480222502278, 'wx4g5fd': 0.24330820434694753, 'wx4g5gm': 8.414315281588499, 'wx4ejmn': 13.84176850705229, 'wx4ff70': 15.558053235519179}\n",
      "{'wx4g5bt': 14.640243866511653, 'wx4g59q': 0.07486406287598356, 'wx4g59n': 3.013220405925328, 'wx4g757': 13.530333194391755}\n",
      "{'wx4dkju': 14.441634774326403, 'wx4ds52': 5.181654452761253, 'wx4ds53': 8.352994821872215}\n",
      "{'wx4eqs8': 15.65182695777583, 'wx4eq7f': 15.881606346224615}\n",
      "{'wx4sp8y': 4.13661571987162, 'wx4smpk': 15.179611828087788, 'wx4epg8': 14.761716818909635, 'wx4sp9n': 12.730554889427895, 'wx4spbe': 12.095997161809915, 'wx4epfg': 14.807242991451332}\n",
      "{'wx4f8mt': 2.8010041339107166, 'wx4f8mn': 8.668008587773377, 'wx4f8mq': 4.714611598929007, 'wx4f8mw': 7.75554478871992, 'wx4f8v8': 14.23659112230674, 'wx4f8mp': 1.9023593659122566, 'wx4f8t0': 5.482869017182322, 'wx4f8ty': 15.157384617933426, 'wx4f8tz': 9.793210345753856, 'wx4f8kg': 2.8633596665512506}\n",
      "{'wx4ej2v': 8.935030321293926, 'wx4g1mn': 11.196378113048524, 'wx4g1mh': 11.153512530451348, 'wx4epxk': 16.142289596238594}\n",
      "{'wx4g35r': 9.188184951815751, 'wx4epff': 13.856982116024765, 'wx4g35v': 3.6014593437538083}\n",
      "{'wx4f8ng': 8.57381937626042}\n",
      "{'wx4f8vh': 15.38706929349062, 'wx4f8vb': 10.544654919334613, 'wx4f8vj': 5.380038841016116, 'wx4en8y': 16.205962302987988}\n",
      "{'wx4g1zx': 14.920503517810547, 'wx4g32y': 14.799056599549868, 'wx4g334': 9.737512247020925}\n",
      "{'wx4uqc6': 13.396038455198347}\n",
      "{'wx4g2j8': 15.009089396622729, 'wx4errr': 19.551787740589628, 'wx4ertt': 19.50277988958763, 'wx4erx2': 19.441751744595763}\n",
      "{}\n",
      "{'wx4fb9s': 8.717240918642908, 'wx4fgr2': 14.800203475205008}\n",
      "{'wx4g3c8': 10.494861412588, 'wx4g3br': 13.394719091155014, 'wx4g1et': 14.81487028530856, 'wx4spbe': 13.477103891128378, 'wx4ez8w': 14.125335532152786}\n",
      "{'wx4g3ud': 10.03022277356365, 'wx4g659': 14.41197697018104}\n",
      "{'wx4ffxq': 2.6563801437976897, 'wx4g48b': 5.850008482737376, 'wx4ffxr': 6.9145230260699995}\n",
      "{'wx4dyc4': 7.749565717836033, 'wx4dyc6': 4.7154158185508255}\n",
      "{'wx4f9j8': 12.090520288098775, 'wx4f8yq': 6.0656481082946705}\n",
      "{}\n",
      "{'wx4f8qx': 15.066148529869787, 'wx4f8mm': 17.770962873880297, 'wx4f8mw': 10.705848061217932}\n",
      "{'wx4g3m3': 18.374552687709297}\n",
      "{'wx4sn2g': 14.367318716214914, 'wx4ez3j': 14.824797622086084}\n",
      "{'wx4gk2h': 18.401270276911028, 'wx4g5kp': 0.0, 'wx4g018': 15.535070982157938}\n",
      "{'wx4ens9': 13.727913660997894, 'wx4dyu1': 13.51622918435888, 'wx4dyub': 10.52837972406202, 'wx4g4cm': 1.4428614678410192}\n",
      "{'wx4g64q': 15.342852715961225, 'wx4eh59': 16.340314403451185, 'wx4ehh0': 15.908932631152172}\n",
      "{'wx4en3f': 18.067005343969665, 'wx4en5s': 18.916179960688307, 'wx4en1r': 14.777073729706077, 'wx4eqse': 14.424998038161732, 'wx4en49': 19.045594528860676, 'wx4en3e': 17.88123087638719, 'wx4f79h': 2.4694927966285416, 'wx4eqsg': 14.129401925349113, 'wx4dyt8': 14.823509807335451, 'wx4eqe3': 13.831743430286176, 'wx4en1q': 17.61331216006411, 'wx4en1n': 14.902462244394655, 'wx4g832': 15.069868084436028, 'wx4en5e': 15.18509145980062, 'wx4enew': 15.167872991618644, 'wx4en4g': 18.16708221913998, 'wx4en5f': 10.445719463725823}\n",
      "{'wx4g4pm': 12.096998132379307, 'wx4g1fq': 18.82961407553117, 'wx4uhnr': 16.893420411285522}\n",
      "{'wx4ff6g': 11.41048096899372, 'wx4ffdg': 10.136519470234653, 'wx4ffe0': 12.052158522113611, 'wx4ffd4': 10.762118999242215, 'wx4ff7n': 10.310622313507597, 'wx4ff90': 12.978730784713955, 'wx4ff7r': 3.2839023304910895, 'wx4ff7u': 14.087450538740905}\n",
      "{'wx4fb85': 14.998660009924278, 'wx4f8ww': 6.792547247871087, 'wx4f8wq': 1.9191325254608853, 'wx4fb8m': 17.784942561128126, 'wx4f8wx': 12.652942880265416}\n",
      "{'wx4f3m3': 15.028960622353754, 'wx4f3m6': 15.180627151238824, 'wx4f2vg': 14.877537364656083, 'wx4f3ph': 11.201172395665154, 'wx4f2vm': 10.318686877317813, 'wx4f3pj': 14.796025507013677}\n",
      "{'wx4enmu': 8.775471349519046, 'wx4enq3': 13.222310469283203, 'wx4enmg': 15.265155157385788, 'wx4ennr': 3.780635175237182}\n",
      "{'wx4f9qs': 12.514874918546877, 'wx4f9qm': 10.900334658372676, 'wx4f9qc': 7.955429562259781}\n",
      "{'wx4erqw': 15.17286050958923, 'wx4ert7': 14.796025507013677, 'wx4dw2k': 13.812419600619016, 'wx4erqr': 14.93458309824112, 'wx4dw22': 0.7647500520419767}\n",
      "{'wx4f9ps': 15.658763247705174, 'wx4f9r0': 10.638209600761083, 'wx4fc0n': 10.42386243653547}\n",
      "{'wx4f9mu': 15.07875642598768}\n",
      "{'wx54bdb': 16.511737491425663, 'wx54b7y': 11.388044336414909}\n",
      "{'wx4gdhw': 14.762665971335634, 'wx4enjk': 13.906188601373334, 'wx4ejvw': 13.960943426772584}\n",
      "{'wx4ep3u': 0.8786617693249116, 'wx4ep6b': 9.593005299581613, 'wx4ep6c': 6.365926546171824}\n",
      "{'wx4f8xe': 16.0574423251339, 'wx4f8wk': 1.5081025962206787, 'wx4f8xg': 9.950345068887437, 'wx4f8w7': 4.579757032437938}\n",
      "{'wx4e5wr': 14.91046370576852}\n",
      "{'wx4e5bz': 13.84605732534262, 'wx4e5cs': 13.79217980881762, 'wx4eh3z': 12.53076064245597, 'wx4e59v': 15.793478563884163}\n",
      "{'wx4snub': 10.663471556079905}\n",
      "{}\n",
      "{'wx4gyct': 8.441356791702725, 'wx4gz09': 7.260856426301959, 'wx4gz01': 16.534665119722728, 'wx4gybp': 10.827486690641098}\n",
      "{}\n",
      "{'wx4dz9n': 15.57245615540698, 'wx4eqzf': 13.029947662344572, 'wx4dz9t': 15.442799946461555, 'wx4evmb': 15.994486276678414, 'wx4ew8b': 14.908021960016034, 'wx4eqxz': 5.415483595243449, 'wx4ew2v': 4.606074325954335, 'wx4evmc': 15.16631405588982, 'wx4ew83': 4.426458634323815, 'wx4evnw': 15.21381851241769}\n",
      "{'wx4f8ke': 15.388301550105332, 'wx4f8ky': 4.317398237279135, 'wx4f8mn': 10.445488313763486, 'wx4f8kz': 3.4829447215740807}\n",
      "{'wx4e5by': 1.4470202528293723}\n",
      "{'wx4epmz': 14.762001571045339, 'wx4ep37': 15.072250441702602, 'wx4ert6': 11.631524654965606}\n",
      "{'wx4fcnj': 15.676649171258259}\n",
      "{'wx4dy20': 11.338828738965601, 'wx4dvdj': 14.339739090305303, 'wx4dv9w': 5.493976020013194, 'wx4dy34': 11.98388648926158}\n",
      "{'wx4ej2s': 14.778827789149576, 'wx4ej89': 14.79886618031442, 'wx4ej2g': 7.2269884124613455, 'wx4ej96': 13.514790758942107}\n",
      "{'wx4dwnm': 10.58094418090062, 'wx4dwrd': 2.944390783097515, 'wx4dwn7': 15.92705446239369, 'wx4dwnh': 10.747528253753046, 'wx4dwry': 9.828443512115355, 'wx4dxn3': 6.506097338787636, 'wx4dwr6': 8.656111744472271}\n",
      "{'wx4embj': 15.767018601791335}\n",
      "{}\n",
      "{'wx4e57z': 15.705413863426674, 'wx4e5ef': 15.043776962821818, 'wx4e62y': 13.71730742972984, 'wx4fg37': 12.896679379709276, 'wx4fg3b': 3.014150268748242, 'wx4e5fs': 16.46329724056869, 'wx4e4np': 15.386898553770218, 'wx4ferm': 12.18846517007934, 'wx4e5cq': 16.73325897904784, 'wx4e5kk': 14.878184833681141}\n",
      "{}\n",
      "{'wx4fkx0': 14.37164063756105, 'wx4fkx8': 13.42523369196806, 'wx4fs2p': 14.678941342160252, 'wx4fkq0': 13.53375013482144, 'wx4fkwt': 13.3093027784914, 'wx4fktg': 13.69010984651517, 'wx4fktu': 13.975049794740896, 'wx4fkx1': 14.833714737560733, 'wx4fkmc': 13.558458446955381}\n",
      "{'wx4gjsj': 16.289458879395674, 'wx4ey8g': 16.8107853299679, 'wx4ewzu': 9.400426922248084, 'wx4ey99': 16.86689994882782, 'wx4gjg1': 3.446816253018942}\n",
      "{'wx4ff5q': 12.970183423509225, 'wx4ff5s': 0.7129025908865898, 'wx4g4p1': 0.08364290796229082, 'wx4ffg4': 11.130601958437158}\n",
      "{'wx4fh8d': 6.024822857013725, 'wx4ff13': 7.6648868066289175}\n",
      "{'wx4etfn': 15.648033073275016}\n",
      "{'wx4en5q': 7.747020801238555, 'wx4dwk6': 15.410101789494423, 'wx4enjq': 9.568603259669784, 'wx4en5g': 8.471662342168624}\n",
      "{'wx4f244': 3.837567897708353, 'wx4f21f': 11.291629833018543}\n",
      "{'wx4fh2k': 15.719617875625847, 'wx4fh2m': 9.54114003802973}\n",
      "{'wx4enbn': 1.6343462784002272, 'wx4dzpd': 10.059559204145156, 'wx4duy4': 15.833749298270577, 'wx4enbq': 14.096042752458184}\n",
      "{'wx4g1u7': 8.643196902184963, 'wx4g62k': 17.447994988561852, 'wx4g1ge': 13.564153973418074, 'wx4g1gu': 11.637825658411504, 'wx4g1gs': 5.2011168007629385, 'wx4g1us': 14.773849509816133, 'wx4g1gv': 16.504087870601758, 'wx4g4j0': 14.717690307475998, 'wx4g1gg': 8.982369092222232, 'wx4g1gb': 12.083164112133003, 'wx4g1sx': 10.073891481096211}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'wx4f3hy': 12.861378898462867, 'wx4f7d2': 16.131251323046342, 'wx4f3jy': 13.133118249025545, 'wx4f791': 13.173751469736539, 'wx4f3k3': 9.0502472414748, 'wx4f3m1': 15.740870220112354}\n",
      "{'wx4g60c': 6.945129873012671, 'wx4g39j': 0.6999407255977435}\n",
      "{'wx4ffdn': 16.361362815146787, 'wx4ffd2': 14.457903659349236, 'wx4ff92': 0.9170847702308016, 'wx4ffdf': 3.931569493545031, 'wx4ffdj': 14.362760974431563}\n",
      "{'wx4gd7m': 16.175319806440562, 'wx4gd7j': 8.350838720950822, 'wx4gd7c': 9.893396830751298, 'wx4gd99': 8.454502931110168}\n",
      "{'wx4endm': 14.174351812470901, 'wx4ejc2': 4.069920055996805}\n",
      "{'wx4dxyq': 12.636382799210407, 'wx4fdrb': 6.738701394647353, 'wx4f8j9': 13.482405100870553, 'wx4ff0t': 17.913212418736123, 'wx4fdpy': 4.317923552815481, 'wx4ghc2': 18.468535287191475, 'wx4ff14': 6.842829352518771, 'wx4fdpz': 0.0777711917330823}\n",
      "{}\n",
      "{'wx4e5sw': 1.6848713653814562, 'wx4g5be': 7.580138534082632}\n",
      "{'wx4fhh9': 1.9575200286930392, 'wx4fhj3': 16.78661289984972, 'wx4fhj8': 9.221449939297036, 'wx4fhjn': 13.406782546169488, 'wx4fhj2': 0.5427644558508827, 'wx4fhkf': 7.299246130408423, 'wx4f5vh': 3.433968130788293, 'wx4curg': 18.367802854135117, 'wx4f5vq': 7.265507246523317, 'wx4fhjb': 18.45247289561695, 'wx4fhj6': 13.388546028017592}\n",
      "{'wx4enjf': 3.0245915272290844}\n",
      "{'wx4u03w': 17.134060072539302}\n",
      "{'wx4g1kb': 18.255206838142687, 'wx4fbg2': 12.994722393153522, 'wx4fbsz': 7.459828134091517, 'wx4g1hs': 10.245962830877923}\n",
      "{'wx4sqpb': 7.4221807507262, 'wx4gd3e': 15.53507098215794}\n",
      "{'wx4g1fj': 15.79269117698173, 'wx4fcy4': 13.016377191066287}\n",
      "{'wx4fbsu': 6.806070817135814, 'wx4dzyg': 15.310215654316902, 'wx4fbsg': 6.836958236589822, 'wx4g14q': 15.537235466955158, 'wx4g12b': 15.364481047892545, 'wx4fbeu': 11.412952503287512, 'wx4fbt7': 13.397959244223161, 'wx4fbeg': 13.287116674817169, 'wx4fbmt': 6.682409865558868, 'wx4fbnt': 14.761704954118112, 'wx4fbes': 11.272589613105959, 'wx4g0bs': 15.330244947092922}\n",
      "{}\n",
      "{'wx4equx': 13.290430163378211}\n",
      "{}\n",
      "{}\n",
      "{'wx4e5ec': 13.194273798244534, 'wx4e5cx': 15.840528531185358, 'wx4eh5m': 12.265946017171986, 'wx4eh4v': 16.11965137136259}\n",
      "{'wx4gj0q': 10.479289323384245}\n",
      "{'wx4gbyp': 15.259338751616411}\n",
      "{'wx4g4kj': 6.2019961879740375, 'wx4gfcq': 14.767980097586788, 'wx4g4kf': 5.236260536000531, 'wx4gfcs': 15.33530528790133, 'wx4gg12': 16.007621258267154, 'wx4g4km': 7.400849367748136}\n",
      "{'wx4g622': 11.760719889567046, 'wx4g4r9': 6.840159653430804}\n",
      "{'wx4g134': 14.316516470029345, 'wx4g116': 14.153515885704643, 'wx4g4r9': 8.439538378333852}\n",
      "{'wx4g820': 18.20478669879967, 'wx4g2qt': 12.463089028803653, 'wx4g828': 4.663259431453983, 'wx4g2q6': 14.182850499946756}\n",
      "{}\n",
      "{'wx4g4fk': 16.8579777975543, 'wx4g4cb': 13.980863742089978, 'wx4g4f7': 17.107390523082447}\n",
      "{'wx4fdxw': 13.975789202435289, 'wx4g6fb': 9.33254300796991, 'wx4g69z': 14.907174344342057, 'wx4g6uc': 5.628388588751577}\n",
      "{'wx4ffn7': 6.98476471181256, 'wx4g43j': 14.77974029180344, 'wx4fczf': 6.431360716857725, 'wx4ffne': 16.46610556239199, 'wx4fczd': 16.941563434331986}\n",
      "{}\n",
      "{'wx4fh61': 15.726810864595235}\n",
      "{}\n",
      "{'wx4fc1c': 14.836737072614428, 'wx4ff79': 14.895564879354083, 'wx4g449': 14.904577585748582, 'wx4ff6e': 13.574884737849645, 'wx4ff6q': 2.8225976687696623, 'wx4ff75': 18.08423375172778, 'wx4fbcd': 15.091295760742678, 'wx4g44f': 14.979548825540146, 'wx4ff6z': 3.826950722684343, 'wx4g451': 14.96700948575737, 'wx4ff6m': 9.170737247088372, 'wx4ffd8': 15.529977192453229}\n",
      "{'wx4sqs2': 18.059005882727977, 'wx4sqgv': 15.3831076439591}\n",
      "{}\n",
      "{'wx4duxn': 18.608149197087876, 'wx4eh91': 0.26319233606928905, 'wx4ehb8': 16.958362789203832}\n",
      "{'wx4dym7': 16.72487292552998, 'wx4e7bx': 19.38098327839691, 'wx4eq5w': 15.264296383723698, 'wx4enxd': 17.75368735526944, 'wx4ekwn': 11.457005853444587, 'wx4g4hk': 17.1457092098284, 'wx4eqss': 15.31189720121632, 'wx4ekug': 16.921638250895413, 'wx4g8b2': 15.116656056009841}\n",
      "{'wx4g548': 1.008570210964252}\n",
      "{'wx4ephs': 19.518292016362906}\n",
      "{'wx4ffqr': 14.934407185409249, 'wx4ffrs': 14.877537364656083, 'wx4er9p': 15.689514410849489, 'wx4dr64': 14.170137637699884, 'wx4dr50': 14.405059658013215, 'wx4dr4c': 14.634452306511331, 'wx4dr4w': 16.620675538617093}\n",
      "{'wx4g8h5': 10.64329375328252, 'wx4guug': 13.514790758942107, 'wx4g8h6': 15.674157544736254, 'wx4g84n': 13.68536864962147, 'wx4exut': 4.073739058947735}\n",
      "{'wx4dy4s': 3.793994431457474}\n",
      "{'wx4g59q': 14.085869889713852, 'wx4g5eb': 15.048619392914295, 'wx4g5dk': 0.03743203143799178, 'wx4g5de': 1.5837308038544937, 'wx4g5ds': 3.170287555610778, 'wx4g59m': 9.411841233489664}\n",
      "{'wx4snw5': 10.075705699591776, 'wx4snub': 14.991528590915761, 'wx4g0ms': 5.223881056766808}\n",
      "{'wx4g474': 2.357505598081226, 'wx4g17r': 10.246459845204633}\n",
      "{'wx4erhb': 6.265600407535566}\n",
      "{'wx4ey7n': 15.183984156836042, 'wx4g1rp': 2.9009824364443735, 'wx4g388': 13.585752425958121, 'wx4ey3u': 14.770351858083755, 'wx4ey6u': 15.627099809770748, 'wx4g3bk': 2.662363965644091, 'wx4ey7h': 14.839345702722284}\n",
      "{'wx4spbt': 14.114528928094524, 'wx4g45g': 14.555670558998997}\n",
      "{'wx4dwd0': 14.637571304701254}\n",
      "{'wx4g6wj': 15.032770934567468, 'wx4g4hm': 0.012961865288847052, 'wx4g6xg': 14.548605625132982, 'wx4g45z': 11.107902217869372, 'wx4g6wh': 9.342942710936946}\n",
      "{'wx4dzxj': 9.006972518227613, 'wx4dzv8': 9.357793487255389, 'wx4ferh': 1.5911478232199552}\n",
      "{'wx4dvc6': 16.59704362720356, 'wx4ejuw': 15.599055271187183, 'wx4dy40': 16.66040807596173, 'wx4dzme': 13.903984349789694, 'wx4fbrs': 14.213332228113744, 'wx4f3m6': 13.033905781035893, 'wx4fek5': 17.140805274860494, 'wx4embg': 14.837445343338418}\n",
      "{'wx4ffw2': 16.26171912747525, 'wx4er0q': 7.859914641456586}\n",
      "{'wx4g1d0': 14.762464281551248, 'wx4ffx3': 18.44986250412913, 'wx4g190': 15.645615251102134}\n",
      "{'wx4f76n': 10.549709784385858, 'wx4f7jw': 14.272959243716835, 'wx4f73p': 14.46136791827959, 'wx4f76w': 3.9425193802039287}\n",
      "{'wx4dnvs': 3.5141382500077167}\n",
      "{}\n",
      "{'wx4dzh6': 10.847157925471585, 'wx4dyu3': 12.045602498371307, 'wx4dyu1': 11.896250961626448}\n",
      "{'wx4f8kj': 1.0931377852398745, 'wx4g4f1': 18.042093540369017, 'wx4f8k9': 15.911705140271332, 'wx4g4cc': 18.353494158382585, 'wx4g4cm': 13.507985319975747}\n",
      "{'wx4dz3e': 12.712913952403879, 'wx4dzd6': 13.822965523898985, 'wx4f2y9': 0.8928401473229691}\n",
      "{'wx4ehjq': 6.602366754971524, 'wx4ehm5': 8.722406182685518}\n",
      "{}\n",
      "{'wx4dqry': 14.917791673352392, 'wx4dw2p': 17.895643140787367, 'wx4dw2w': 18.755362215200133, 'wx4dw2t': 19.97482944166104, 'wx4dqrz': 18.67292864439687}\n",
      "{'wx4g34m': 9.779029527397643, 'wx4fcyk': 3.654956860135537, 'wx4fczh': 3.6998692418672157, 'wx4fczd': 10.385884135821412}\n",
      "{'wx4er85': 3.4241042368559875, 'wx4epww': 14.985524879784503, 'wx4epxn': 16.691519676215194, 'wx4epxh': 2.146982811349519, 'wx4epwy': 10.531351111820234}\n",
      "{'wx4g4ve': 15.394545835335597, 'wx4g4uw': 10.941196405908244, 'wx4ert1': 7.973188766251517}\n",
      "{'wx4fvmd': 3.425612639573797}\n",
      "{'wx4eph2': 7.6856817912666795}\n",
      "{'wx4g6zd': 13.863452003630258}\n",
      "{'wx4fgyy': 2.2456595272246496, 'wx4fuph': 10.320445525123283, 'wx4fupk': 10.054865866317822}\n",
      "{'wx4erhg': 7.527868977271793, 'wx4e5be': 7.671120045032616, 'wx4erjs': 11.783362185233795}\n",
      "{'wx4g207': 14.109753385688197, 'wx4g20e': 16.39549683409968}\n",
      "{'wx4g2m6': 10.24209047012584, 'wx4g2qn': 11.029064603868107, 'wx4g2md': 6.651950383271206, 'wx4g2qy': 6.639782705005924}\n",
      "{'wx4eyeh': 14.830077674376936, 'wx4dxkj': 5.1790323841284565}\n",
      "{}\n",
      "{'wx4ghcm': 15.669005437344993, 'wx4ghc9': 10.599949473133751, 'wx4g97q': 4.315354735630146}\n",
      "{'wx4g5dw': 15.06652052664842, 'wx4fv7e': 15.325434361413, 'wx4fvdd': 14.85047149562483, 'wx4g5fm': 15.070298098722073, 'wx4gj38': 15.06907775591077, 'wx4fvdm': 13.836301183815223, 'wx4fvd5': 9.922390424439287}\n",
      "{'wx4dsyj': 3.3665621047099443, 'wx49uhc': 14.723319890697178, 'wx4dsy4': 0.3743203143799198, 'wx4dswr': 8.76360161932528, 'wx4dsyh': 4.319732484017145}\n",
      "{'wx4dxdp': 5.720202096736881, 'wx4dxdk': 7.536134284708336, 'wx4dxdn': 7.347640803391771, 'wx4dxdu': 13.846442752926341}\n",
      "{'wx4duxu': 16.848946972124274}\n",
      "{'wx4ff6j': 13.507985319975747}\n",
      "{'wx4g492': 14.925996133972872}\n",
      "{'wx4e4z5': 14.609825448138707, 'wx4eh5y': 15.33435731505725, 'wx4ff23': 16.282299039637344, 'wx4e68r': 15.275307583311648, 'wx4ff13': 13.85239323612044}\n",
      "{'wx4gc36': 11.872157229054018, 'wx4gc6t': 9.707280864787583, 'wx4snub': 9.365976939226904, 'wx4snu8': 13.901804946118208}\n",
      "{'wx4ekbw': 11.570263679239577, 'wx4enb8': 14.804356603116952, 'wx4enbh': 10.941196405908244, 'wx4g48h': 14.101545993769452, 'wx4em20': 14.94888374416062}\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'wx4gd4m': 15.485509708338363, 'wx4g919': 15.627099809770748}\n",
      "{'wx4dw22': 15.982425435357946, 'wx4dq61': 14.64689370227436}\n",
      "{'wx4ep93': 14.769723378643398, 'wx4dxd0': 6.034834086399475, 'wx4ep3v': 5.898783943309846, 'wx4ep91': 19.24821882695468, 'wx4ep92': 6.629135185461145}\n",
      "{'wx4g9py': 15.455859840072781, 'wx4fbbf': 5.222871159014813}\n",
      "{}\n",
      "{'wx4drz4': 8.786545186695216, 'wx4f2ws': 17.163964037394457, 'wx4dryb': 2.8409428273935085}\n",
      "{'wx4dwhe': 10.30031244336297, 'wx4dwhr': 16.23446881702839, 'wx4dwj4': 20.163464812403117, 'wx4dwhc': 7.6808062361472995, 'wx4dwhq': 15.106514727985886}\n",
      "{'wx4gjsj': 3.014150268748242, 'wx4g3bm': 13.835123907992942, 'wx4ujqr': 14.716835290428598, 'wx4gjev': 3.017924890298082, 'wx4gjk3': 11.649521002432047}\n",
      "{'wx4expp': 12.649368451078244, 'wx4exr2': 11.984962924101655, 'wx4exqy': 12.760318599339751}\n",
      "{}\n",
      "{}\n",
      "{}\n",
      "{'wx4g4cf': 12.07725822272207}\n",
      "{'wx4dysg': 10.979862886180323, 'wx4dyt9': 10.865847480265213, 'wx4dy32': 15.502567445324397}\n",
      "{}\n",
      "{'wx4g4vg': 8.868394562564095, 'wx4g4vj': 13.467186402545607, 'wx4g4vn': 0.6924925816028509, 'wx4g4y5': 13.65163872986871, 'wx4g4vp': 7.010924998299982}\n",
      "{'wx4f5t0': 0.2592373057769417, 'wx4f5t7': 4.834805862660165, 'wx4f5n6': 6.405582013470819, 'wx4f5n9': 8.154741375185749}\n",
      "{'wx4dw43': 10.715700328241304, 'wx4dw51': 9.474369899357347, 'wx4dw4b': 9.44879972952977, 'wx4dw56': 9.429398423754906, 'wx4dw4s': 15.566685335346724, 'wx4dw5h': 13.56264314847955}\n",
      "{'wx4dtnr': 12.54061825400595, 'wx4dtjy': 15.569043130132277, 'wx4dtjr': 3.776123555499704, 'wx4dtmg': 8.76015071623199, 'wx4dtjx': 8.3353786454837, 'wx4dtm3': 2.6062266332365978, 'wx4dttr': 6.919799210244818, 'wx4dtjz': 13.155948484781778}\n",
      "{'wx4uqch': 10.135078806800776}\n",
      "{'wx4ffph': 9.935665017970647, 'wx4g2yy': 13.69010984651517, 'wx4ffnu': 13.850370106571605, 'wx4g2yw': 13.72435363813636}\n",
      "{'wx4g4qw': 4.654753633622665, 'wx4ucdt': 13.866837381842238}\n",
      "{}\n",
      "{'wx4gh9u': 18.396006029890824, 'wx4ejeu': 18.535471154015603, 'wx4ge2r': 11.775453339548715, 'wx4ffb1': 18.458546559247026}\n",
      "{'wx4fbwn': 14.011097379910733, 'wx4fcyr': 15.58939628732858, 'wx4g4yp': 7.206781187274408, 'wx4g5n0': 9.017345886998873, 'wx4g4yz': 11.955082869752262, 'wx4fbwd': 15.22890353663662, 'wx4fbw2': 10.531106741964026}\n",
      "{}\n",
      "{'wx4eqc6': 2.1346108377168944, 'wx4eqbg': 2.2264637439216615}\n",
      "{'wx4ej9n': 17.868885057740073, 'wx4ej9f': 18.493175705910012, 'wx4ejbg': 10.784902858047095, 'wx4ej8f': 16.393787547661756, 'wx4ej9r': 16.676421620540385}\n",
      "{'wx4fc92': 7.02215246529664, 'wx4fc2x': 4.820958077519618, 'wx4dzh9': 9.56222303919516, 'wx4fc3k': 12.742673366799645, 'wx4dzj6': 17.398285800829708}\n",
      "{'wx4g56d': 12.605314168350144}\n",
      "{'wx4dy4v': 8.978659765021389, 'wx4dy54': 18.94848475067515, 'wx4dy4c': 19.039662139731725, 'wx4dvgw': 13.925200692915595, 'wx4dy53': 9.642275966669207}\n",
      "{'wx4g490': 7.4925761003770575, 'wx4g492': 15.021658436870467, 'wx4g463': 5.5349222858617395}\n",
      "{'wx4g855': 13.868567647776004, 'wx4g84v': 13.490547752415953, 'wx4g94g': 14.99573384733893, 'wx4g84p': 15.442845385007963, 'wx4exut': 11.072619841847446}\n",
      "{'wx4cfw1': 13.906188601373334, 'wx4f79b': 3.014150268748242, 'wx4f7d0': 3.0202453895762242, 'wx4cfmy': 19.50277988958763}\n",
      "{'wx4f8vh': 15.128423594063722, 'wx4f8we': 0.13101211003297022}\n",
      "{'wx4g1fx': 9.743460951079589}\n",
      "{'wx4f8ke': 6.177346410906429, 'wx4ffwb': 9.657555207385142}\n",
      "{'wx4g327': 10.60555177313474, 'wx4g1ph': 4.35666787541712}\n",
      "{}\n",
      "{'wx4epez': 17.712204828371892, 'wx4epex': 12.245224446792118}\n",
      "{'wx4fyrx': 8.978170025790895, 'wx4gn8b': 14.76370996852545, 'wx4fytf': 19.00441599122674, 'wx4gn23': 8.25357413831915}\n",
      "{'wx4f8jd': 0.077771191733083, 'wx4f8jx': 7.064868303402013}\n",
      "{'wx4uq0p': 15.813527069916338, 'wx4uq1p': 16.1727278344468}\n",
      "{'wx4e4hs': 16.219789899955288, 'wx4e47g': 9.627760827349807, 'wx4e47e': 9.623336090104406, 'wx4e4np': 13.970838184567569, 'wx4e4hd': 8.020156614690347, 'wx4e4jz': 16.111272057998534}\n",
      "{'wx4fc81': 18.14272339722785, 'wx4f9ws': 6.922835822076965}\n",
      "{'wx4epv2': 19.380983278396915, 'wx4eqc9': 7.5429904656867315, 'wx4eqcd': 7.047423553846919}\n",
      "{'wx4g0ns': 16.52446132492749, 'wx4dwhm': 4.981058693306021}\n",
      "{'wx4dy3d': 2.5720730667589224, 'wx4dy4p': 3.333502909909562}\n",
      "{}\n",
      "{'wx4dwe5': 7.441867771527728, 'wx4dw5k': 6.0017124069720635, 'wx4d5yn': 9.198491900807246, 'wx4dw5n': 16.302460558038455, 'wx4dw5g': 7.883462699257823, 'wx4d5z0': 13.47885819868511, 'wx4dw5m': 13.890259746025341, 'wx4dw5e': 4.543981219432648}\n",
      "{'wx4erym': 16.02127021572041, 'wx4g41n': 3.728544876953152, 'wx4g2j8': 14.424998038161732}\n",
      "{}\n",
      "{}\n",
      "{'wx4gjk3': 4.409359842520016}\n",
      "{'wx4ejvw': 3.0230276374832132, 'wx4ejvq': 4.4071346452418405}\n"
     ]
    }
   ],
   "source": [
    "training(r'F:\\data\\mobike\\train.csv', r'F:\\data\\mobike\\test.csv', r'F:\\data\\mobike\\submission.csv' )"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 用dict保存信息\n",
    "#user_habit_dict:每个用户的乘车记录:起点,终点,距离\n",
    "user_habit_dict={}\n",
    "\n",
    "#start_end_dict:每条记录的起点,终点对\n",
    "start_end_dict={}\n",
    "\n",
    "#end_start_dict:每条记录的起点,终点对\n",
    "end_start_dict={}\n",
    "\n",
    "#user_habit_dict_test:test中每个用户的记录\n",
    "user_habit_dict_test={}\n",
    "\n",
    "#bike_dict:bike中的记录\n",
    "bike_dict={}\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[{'geohashed_start_loc': 'wx4dnu8', 'isHoliday': 0, 'biketype': '1', 'bikeid': '329100', 'minute': 1161, 'orderid': '3162575', 'data': 10, 'starttime': '2017/5/11 19:21', 'userid': '1027944', 'geohashed_end_loc': 'wx4dng7'}, {'geohashed_start_loc': 'wx4dnu8', 'isHoliday': 0, 'biketype': '1', 'bikeid': '329100', 'minute': 1161, 'orderid': '3162575', 'data': 10, 'starttime': '2017/5/11 19:21', 'userid': '1027944', 'geohashed_end_loc': 'wx4dng7'}, {'geohashed_start_loc': 'wx4dnu8', 'isHoliday': 0, 'biketype': '1', 'bikeid': '329100', 'minute': 1161, 'orderid': '3162575', 'data': 10, 'starttime': '2017/5/11 19:21', 'userid': '1027944', 'geohashed_end_loc': 'wx4dng7'}]\n"
     ]
    }
   ],
   "source": [
    "from random import choice\n",
    "#print(user_habit_dict[choice(list(user_habit_dict.keys()))]) #随即打印一条看看\n",
    "print(start_end_dict[choice(list(start_end_dict.keys()))]) #随即打印一条看看"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
