Version that works-checkpoint.ipynb 2.52 KB
Newer Older
blb032's avatar
blb032 committed
1 2
{
 "cells": [
wx002's avatar
wx002 committed
3 4 5 6 7 8 9 10
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# All of that stuff above is unnecccccessary\n",
    "## we just need to do this \\/"
   ]
  },
blb032's avatar
blb032 committed
11 12
  {
   "cell_type": "code",
wx002's avatar
wx002 committed
13
   "execution_count": 35,
blb032's avatar
blb032 committed
14 15 16
   "metadata": {},
   "outputs": [],
   "source": [
wx002's avatar
wx002 committed
17 18
    "import pandas as pd\n",
    "import geocoder\n",
blb032's avatar
blb032 committed
19
    "import json\n",
wx002's avatar
wx002 committed
20
    "import gmplot"
blb032's avatar
blb032 committed
21 22 23 24
   ]
  },
  {
   "cell_type": "code",
wx002's avatar
wx002 committed
25
   "execution_count": 13,
blb032's avatar
blb032 committed
26 27 28
   "metadata": {},
   "outputs": [],
   "source": [
wx002's avatar
wx002 committed
29
    "dataset = pd.read_csv('Datasets/Brightkite.csv', index_col=1)"
blb032's avatar
blb032 committed
30 31 32 33
   ]
  },
  {
   "cell_type": "code",
wx002's avatar
wx002 committed
34
   "execution_count": 14,
blb032's avatar
blb032 committed
35
   "metadata": {},
wx002's avatar
wx002 committed
36 37 38 39 40 41 42 43 44 45 46 47
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['UserID', 'Latitude', 'Longitude', 'PlaceID'], dtype='object')"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
blb032's avatar
blb032 committed
48
   "source": [
wx002's avatar
wx002 committed
49
    "dataset.columns"
blb032's avatar
blb032 committed
50 51 52 53
   ]
  },
  {
   "cell_type": "code",
wx002's avatar
wx002 committed
54
   "execution_count": 15,
blb032's avatar
blb032 committed
55
   "metadata": {},
wx002's avatar
wx002 committed
56 57 58 59 60 61 62 63 64 65 66 67
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([   0,    1,    2, ..., 2964, 2965, 2966], dtype=int64)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
blb032's avatar
blb032 committed
68
   "source": [
wx002's avatar
wx002 committed
69
    "dataset['UserID'].unique()\n"
blb032's avatar
blb032 committed
70 71 72 73
   ]
  },
  {
   "cell_type": "code",
wx002's avatar
wx002 committed
74
   "execution_count": 22,
blb032's avatar
blb032 committed
75 76 77
   "metadata": {},
   "outputs": [],
   "source": [
wx002's avatar
wx002 committed
78 79
    "key = 'AiEfap-qUoZalL1qK8ollM-SwVdoJFemh60tHo0EeraVYP8V4WPJXAVD2YjqzgA1'\n",
    "#geo = geocoder.bing([45.15,-75.14], method='reverse', key = key)"
blb032's avatar
blb032 committed
80 81 82 83
   ]
  },
  {
   "cell_type": "code",
wx002's avatar
wx002 committed
84
   "execution_count": 37,
blb032's avatar
blb032 committed
85
   "metadata": {},
wx002's avatar
wx002 committed
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dict_keys(['address', 'bbox', 'city', 'confidence', 'country', 'lat', 'lng', 'ok', 'postal', 'quality', 'raw', 'state', 'status', 'street'])\n"
     ]
    }
   ],
   "source": [
    "dic = geo.json\n",
    "print(dic.keys())\n",
    "test = gmplot.GoogleMapPlotter(30.3164945, \n",
    "                                78.03219179999999, 13)\n",
    "test.draw('testmap.html')"
   ]
blb032's avatar
blb032 committed
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
  }
 ],
 "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",
wx002's avatar
wx002 committed
120
   "version": "3.7.1"
blb032's avatar
blb032 committed
121 122 123 124 125
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}