Commit 699719e3 authored by Corrine Smith's avatar Corrine Smith

finished user comparison code

parent 38e2e917
......@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
......@@ -16,7 +16,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
......@@ -25,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [
{
......@@ -34,7 +34,7 @@
"Index(['Unnamed: 0', 'UserID', 'PlaceID', 'Coordinates', 'Date', 'Time'], dtype='object')"
]
},
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
......@@ -45,7 +45,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
......@@ -61,7 +61,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
......@@ -77,7 +77,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
......@@ -86,7 +86,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"metadata": {},
"outputs": [
{
......@@ -177,7 +177,7 @@
"(39.739154, -104.984703) 7441"
]
},
"execution_count": 8,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
......@@ -190,7 +190,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
......@@ -202,7 +202,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 9,
"metadata": {},
"outputs": [
{
......@@ -211,7 +211,7 @@
"\"\\nrankings = place_rankings.to_frame()\\nlocations = rankings['Coordinates'].index\\nimport geocoder\\nbing_key = 'AiEfap-qUoZalL1qK8ollM-SwVdoJFemh60tHo0EeraVYP8V4WPJXAVD2YjqzgA1'\\ncoordinates = locations\\naddr_file = open('Datasets/address_kite.txt', 'w+', encoding='utf-8')\\nfor cord in coordinates:\\n cord_list = tuple_str_to_list(cord)\\n g = geocoder.bing(cord_list, method = 'reverse', key = bing_key)\\n for r in g:\\n if r.city == None:\\n line_str = r.address + ',' + r.country + '\\n'\\n else:\\n line_str = r.address + ',' + r.city + ',' + r.country + '\\n'\\n addr_file.write(str(cord_list) + ' : ' + line_str)\\n print('{} : {}'.format(cord_list, line_str))\\naddr_file.close()\\nprint('finish address!')\\n\""
]
},
"execution_count": 44,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
......@@ -387,7 +387,7 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 12,
"metadata": {},
"outputs": [
{
......@@ -429,7 +429,7 @@
},
{
"cell_type": "code",
"execution_count": 32,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
......@@ -438,7 +438,7 @@
},
{
"cell_type": "code",
"execution_count": 34,
"execution_count": 14,
"metadata": {},
"outputs": [
{
......@@ -480,7 +480,7 @@
},
{
"cell_type": "code",
"execution_count": 35,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
......@@ -489,7 +489,7 @@
},
{
"cell_type": "code",
"execution_count": 36,
"execution_count": 16,
"metadata": {},
"outputs": [
{
......@@ -531,7 +531,7 @@
},
{
"cell_type": "code",
"execution_count": 37,
"execution_count": 17,
"metadata": {},
"outputs": [
{
......@@ -574,7 +574,7 @@
},
{
"cell_type": "code",
"execution_count": 39,
"execution_count": 18,
"metadata": {},
"outputs": [
{
......@@ -617,7 +617,7 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 19,
"metadata": {},
"outputs": [
{
......@@ -660,7 +660,7 @@
},
{
"cell_type": "code",
"execution_count": 41,
"execution_count": 20,
"metadata": {},
"outputs": [
{
......@@ -703,7 +703,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 21,
"metadata": {},
"outputs": [
{
......@@ -746,21 +746,21 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": 22,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"count 10.000000\n",
"mean 6.700000\n",
"std 0.483046\n",
"min 6.000000\n",
"25% 6.250000\n",
"50% 7.000000\n",
"75% 7.000000\n",
"max 7.000000\n",
"count 478.00000\n",
"mean 3.40795\n",
"std 1.19700\n",
"min 2.00000\n",
"25% 2.00000\n",
"50% 3.00000\n",
"75% 4.00000\n",
"max 7.00000\n",
"Name: Date, dtype: float64\n"
]
}
......@@ -769,7 +769,7 @@
"place_8 = place_groups.get_group('(29.763284000000002, -95.363271)')\n",
"date_groups = place_8.groupby(['Date'], group_keys=True)\n",
"date_counts = date_groups['Date'].count()\n",
"date_rankings = date_counts.sort_values().tail(10)\n",
"date_rankings = date_counts.sort_values()\n",
"print(date_rankings.describe())"
]
},
......@@ -782,21 +782,21 @@
},
{
"cell_type": "code",
"execution_count": 24,
"execution_count": 23,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"count 10.000000\n",
"mean 7.300000\n",
"std 0.483046\n",
"min 7.000000\n",
"25% 7.000000\n",
"50% 7.000000\n",
"75% 7.750000\n",
"max 8.000000\n",
"count 471.000000\n",
"mean 3.426752\n",
"std 1.336256\n",
"min 2.000000\n",
"25% 2.000000\n",
"50% 3.000000\n",
"75% 4.000000\n",
"max 8.000000\n",
"Name: Date, dtype: float64\n"
]
}
......@@ -805,7 +805,7 @@
"place_9 = place_groups.get_group('(33.748995, -84.387982)')\n",
"date_groups = place_9.groupby(['Date'], group_keys=True)\n",
"date_counts = date_groups['Date'].count()\n",
"date_rankings = date_counts.sort_values().tail(10)\n",
"date_rankings = date_counts.sort_values()\n",
"print(date_rankings.describe())"
]
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment