{"action":"created","comment":{"url":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/comments/90380250","pull_request_review_id":10898935,"id":90380250,"diff_hunk":"@@ -0,0 +1,178 @@\n+\"\"\"temperature.py\"\"\"\n+\n+import wget\n+import os\n+import zipfile\n+\n+import urllib3\n+import certifi\n+import sys\n+import glob\n+\n+import numpy as np\n+import pandas as pd\n+\n+import matplotlib.pyplot as plt\n+import plotly.offline as py\n+import seaborn as sns\n+\n+def download_if_needed(URL, filename):\n+    \"\"\"\n+    Download from URL to filename unless filename already exists\n+\n+    \"\"\"\n+\n+    if os.path.exists(filename):\n+        print('The File already exists !!')\n+        return\n+    else:\n+        print('downloading', filename,'This may take several seconds... Please be patient :)')\n+\n+        # needed for https\n+        http = urllib3.PoolManager(\n+            cert_reqs='CERT_REQUIRED', # Force certificate check.\n+            ca_certs=certifi.where(),  # Path to the Certifi bundle.\n+            retries=3\n+        )\n+\n+        try:\n+            response = http.request('GET',URL)\n+            with open(filename,'wb') as f:\n+                f.write(response.data)\n+            f.close()\n+            response.release_conn()\n+\n+        except:\n+            e = sys.exc_info()[0]\n+            print('Error! Data not downloaded.',e)\n+\n+def get_temperature_data():\n+    \"\"\"\n+    Download temperature data, unless already downloaded\n+    \"\"\"\n+    download_if_needed('https://www.kaggle.com/berkeleyearth/climate-change-earth-surface-temperature-data/downloads/GlobalLandTemperatures.zip',\n+    'GlobalLandTemperatures.zip')\n+\n+def global_temp_country():\n+    \"\"\"\n+    Fetch data (if needed) and extract global temperatures of countries\n+    \"\"\"\n+    get_temperature_data()\n+    zf = zipfile.ZipFile('GlobalLandTemperatures.zip')\n+    file_handle = zf.open('GlobalLandTemperaturesByCountry.csv')\n+    return pd.read_csv(file_handle)\n+\n+def mercator():\n+    \"\"\"\n+    Creates Mercator projection of the world Map tos how temperature\n+    \"\"\"\n+    data = [ dict(\n+        type = 'choropleth',\n+        locations = countries,\n+        z = mean_temp,\n+        text = countries,\n+        locationmode = 'country names',\n+        autocolorscale = True,\n+        reversescale = False,\n+        marker = dict(\n+            line = dict (\n+                color = 'rgb(180,180,180)',\n+                width = 0.5\n+            ) ),\n+        colorbar = dict(\n+            autotick = False,\n+            title = 'Average land temperature'),\n+      ) ]\n+\n+    layout = dict(\n+        title = 'Average land temperature by country',\n+        geo = dict(\n+            showframe = False,\n+            showcoastlines = False,\n+            showocean = True,\n+            oceancolor = 'rgb(10,200,255)',\n+            projection = dict(\n+                type = 'Mercator'\n+                )\n+            )\n+        )\n+\n+    fig = dict( data=data, layout=layout )\n+    py.iplot( fig, validate=False, filename='d3-world-map' )\n+\n+def globe_graph():\n+    \"\"\"\n+    Cleaning data & plotting average land temperature\n+    \"\"\"\n+    global_temp_country_clean = global_temp_country[~global_temp_country['Country'].isin(\n+    ['Denmark', 'Antarctica', 'France', 'Europe', 'Netherlands',\n+     'United Kingdom', 'Africa', 'South America'])]\n+\n+    global_temp_country_clean = global_temp_country_clean.replace(\n+       ['Denmark (Europe)', 'France (Europe)', 'Netherlands (Europe)', 'United Kingdom (Europe)'],\n+       ['Denmark', 'France', 'Netherlands', 'United Kingdom'])\n+\n+    #Let's average temperature for each country\n+","path":"Climate_police/homework 7/temperature.py","position":116,"original_position":116,"commit_id":"87168b17de2e15619d67db0e7af386831725d501","original_commit_id":"87168b17de2e15619d67db0e7af386831725d501","user":{"login":"abhisheksugam","id":22601620,"avatar_url":"https://avatars.githubusercontent.com/u/22601620?v=3","gravatar_id":"","url":"https://api.github.com/users/abhisheksugam","html_url":"https://github.com/abhisheksugam","followers_url":"https://api.github.com/users/abhisheksugam/followers","following_url":"https://api.github.com/users/abhisheksugam/following{/other_user}","gists_url":"https://api.github.com/users/abhisheksugam/gists{/gist_id}","starred_url":"https://api.github.com/users/abhisheksugam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhisheksugam/subscriptions","organizations_url":"https://api.github.com/users/abhisheksugam/orgs","repos_url":"https://api.github.com/users/abhisheksugam/repos","events_url":"https://api.github.com/users/abhisheksugam/events{/privacy}","received_events_url":"https://api.github.com/users/abhisheksugam/received_events","type":"User","site_admin":false},"body":"that can be done in subsequent weeks, there might be some problems due to data missing from different years\r\n","created_at":"2016-12-01T04:06:14Z","updated_at":"2016-12-01T04:06:14Z","html_url":"https://github.com/abhisheksugam/Climate_Police/pull/1#discussion_r90380250","pull_request_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/comments/90380250"},"html":{"href":"https://github.com/abhisheksugam/Climate_Police/pull/1#discussion_r90380250"},"pull_request":{"href":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/1","id":96015778,"html_url":"https://github.com/abhisheksugam/Climate_Police/pull/1","diff_url":"https://github.com/abhisheksugam/Climate_Police/pull/1.diff","patch_url":"https://github.com/abhisheksugam/Climate_Police/pull/1.patch","issue_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/issues/1","number":1,"state":"open","locked":false,"title":"Hw7sugam","user":{"login":"abhisheksugam","id":22601620,"avatar_url":"https://avatars.githubusercontent.com/u/22601620?v=3","gravatar_id":"","url":"https://api.github.com/users/abhisheksugam","html_url":"https://github.com/abhisheksugam","followers_url":"https://api.github.com/users/abhisheksugam/followers","following_url":"https://api.github.com/users/abhisheksugam/following{/other_user}","gists_url":"https://api.github.com/users/abhisheksugam/gists{/gist_id}","starred_url":"https://api.github.com/users/abhisheksugam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhisheksugam/subscriptions","organizations_url":"https://api.github.com/users/abhisheksugam/orgs","repos_url":"https://api.github.com/users/abhisheksugam/repos","events_url":"https://api.github.com/users/abhisheksugam/events{/privacy}","received_events_url":"https://api.github.com/users/abhisheksugam/received_events","type":"User","site_admin":false},"body":"This is a pull request for HW 7 code review","created_at":"2016-12-01T02:36:18Z","updated_at":"2016-12-01T04:06:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa9ddf504fe0f79dac9b398d6171b4a44a36b0d5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/1/commits","review_comments_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/1/comments","review_comment_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/comments{/number}","comments_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/issues/1/comments","statuses_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/statuses/87168b17de2e15619d67db0e7af386831725d501","head":{"label":"abhisheksugam:hw7sugam","ref":"hw7sugam","sha":"87168b17de2e15619d67db0e7af386831725d501","user":{"login":"abhisheksugam","id":22601620,"avatar_url":"https://avatars.githubusercontent.com/u/22601620?v=3","gravatar_id":"","url":"https://api.github.com/users/abhisheksugam","html_url":"https://github.com/abhisheksugam","followers_url":"https://api.github.com/users/abhisheksugam/followers","following_url":"https://api.github.com/users/abhisheksugam/following{/other_user}","gists_url":"https://api.github.com/users/abhisheksugam/gists{/gist_id}","starred_url":"https://api.github.com/users/abhisheksugam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhisheksugam/subscriptions","organizations_url":"https://api.github.com/users/abhisheksugam/orgs","repos_url":"https://api.github.com/users/abhisheksugam/repos","events_url":"https://api.github.com/users/abhisheksugam/events{/privacy}","received_events_url":"https://api.github.com/users/abhisheksugam/received_events","type":"User","site_admin":false},"repo":{"id":73669380,"name":"Climate_Police","full_name":"abhisheksugam/Climate_Police","owner":{"login":"abhisheksugam","id":22601620,"avatar_url":"https://avatars.githubusercontent.com/u/22601620?v=3","gravatar_id":"","url":"https://api.github.com/users/abhisheksugam","html_url":"https://github.com/abhisheksugam","followers_url":"https://api.github.com/users/abhisheksugam/followers","following_url":"https://api.github.com/users/abhisheksugam/following{/other_user}","gists_url":"https://api.github.com/users/abhisheksugam/gists{/gist_id}","starred_url":"https://api.github.com/users/abhisheksugam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhisheksugam/subscriptions","organizations_url":"https://api.github.com/users/abhisheksugam/orgs","repos_url":"https://api.github.com/users/abhisheksugam/repos","events_url":"https://api.github.com/users/abhisheksugam/events{/privacy}","received_events_url":"https://api.github.com/users/abhisheksugam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abhisheksugam/Climate_Police","description":"Visualization of Climate change & its correlation with pollution","fork":false,"url":"https://api.github.com/repos/abhisheksugam/Climate_Police","forks_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/forks","keys_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/teams","hooks_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/hooks","issue_events_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/issues/events{/number}","events_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/events","assignees_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/assignees{/user}","branches_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/branches{/branch}","tags_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/tags","blobs_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/git/refs{/sha}","trees_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/statuses/{sha}","languages_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/languages","stargazers_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/stargazers","contributors_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/contributors","subscribers_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/subscribers","subscription_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/subscription","commits_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/commits{/sha}","git_commits_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/git/commits{/sha}","comments_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/comments{/number}","issue_comment_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/issues/comments{/number}","contents_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/contents/{+path}","compare_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/merges","archive_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/downloads","issues_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/issues{/number}","pulls_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls{/number}","milestones_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/milestones{/number}","notifications_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/labels{/name}","releases_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/releases{/id}","deployments_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/deployments","created_at":"2016-11-14T05:18:00Z","updated_at":"2016-11-27T09:00:41Z","pushed_at":"2016-12-01T03:56:23Z","git_url":"git://github.com/abhisheksugam/Climate_Police.git","ssh_url":"git@github.com:abhisheksugam/Climate_Police.git","clone_url":"https://github.com/abhisheksugam/Climate_Police.git","svn_url":"https://github.com/abhisheksugam/Climate_Police","homepage":null,"size":37617,"stargazers_count":2,"watchers_count":2,"language":"Jupyter Notebook","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":2,"default_branch":"master"}},"base":{"label":"abhisheksugam:master","ref":"master","sha":"5d456ada4fe2c8a79a35c603f8e19b815e933a98","user":{"login":"abhisheksugam","id":22601620,"avatar_url":"https://avatars.githubusercontent.com/u/22601620?v=3","gravatar_id":"","url":"https://api.github.com/users/abhisheksugam","html_url":"https://github.com/abhisheksugam","followers_url":"https://api.github.com/users/abhisheksugam/followers","following_url":"https://api.github.com/users/abhisheksugam/following{/other_user}","gists_url":"https://api.github.com/users/abhisheksugam/gists{/gist_id}","starred_url":"https://api.github.com/users/abhisheksugam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhisheksugam/subscriptions","organizations_url":"https://api.github.com/users/abhisheksugam/orgs","repos_url":"https://api.github.com/users/abhisheksugam/repos","events_url":"https://api.github.com/users/abhisheksugam/events{/privacy}","received_events_url":"https://api.github.com/users/abhisheksugam/received_events","type":"User","site_admin":false},"repo":{"id":73669380,"name":"Climate_Police","full_name":"abhisheksugam/Climate_Police","owner":{"login":"abhisheksugam","id":22601620,"avatar_url":"https://avatars.githubusercontent.com/u/22601620?v=3","gravatar_id":"","url":"https://api.github.com/users/abhisheksugam","html_url":"https://github.com/abhisheksugam","followers_url":"https://api.github.com/users/abhisheksugam/followers","following_url":"https://api.github.com/users/abhisheksugam/following{/other_user}","gists_url":"https://api.github.com/users/abhisheksugam/gists{/gist_id}","starred_url":"https://api.github.com/users/abhisheksugam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhisheksugam/subscriptions","organizations_url":"https://api.github.com/users/abhisheksugam/orgs","repos_url":"https://api.github.com/users/abhisheksugam/repos","events_url":"https://api.github.com/users/abhisheksugam/events{/privacy}","received_events_url":"https://api.github.com/users/abhisheksugam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abhisheksugam/Climate_Police","description":"Visualization of Climate change & its correlation with pollution","fork":false,"url":"https://api.github.com/repos/abhisheksugam/Climate_Police","forks_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/forks","keys_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/teams","hooks_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/hooks","issue_events_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/issues/events{/number}","events_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/events","assignees_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/assignees{/user}","branches_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/branches{/branch}","tags_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/tags","blobs_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/git/refs{/sha}","trees_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/statuses/{sha}","languages_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/languages","stargazers_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/stargazers","contributors_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/contributors","subscribers_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/subscribers","subscription_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/subscription","commits_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/commits{/sha}","git_commits_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/git/commits{/sha}","comments_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/comments{/number}","issue_comment_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/issues/comments{/number}","contents_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/contents/{+path}","compare_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/merges","archive_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/downloads","issues_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/issues{/number}","pulls_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls{/number}","milestones_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/milestones{/number}","notifications_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/labels{/name}","releases_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/releases{/id}","deployments_url":"https://api.github.com/repos/abhisheksugam/Climate_Police/deployments","created_at":"2016-11-14T05:18:00Z","updated_at":"2016-11-27T09:00:41Z","pushed_at":"2016-12-01T03:56:23Z","git_url":"git://github.com/abhisheksugam/Climate_Police.git","ssh_url":"git@github.com:abhisheksugam/Climate_Police.git","clone_url":"https://github.com/abhisheksugam/Climate_Police.git","svn_url":"https://github.com/abhisheksugam/Climate_Police","homepage":null,"size":37617,"stargazers_count":2,"watchers_count":2,"language":"Jupyter Notebook","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/1"},"html":{"href":"https://github.com/abhisheksugam/Climate_Police/pull/1"},"issue":{"href":"https://api.github.com/repos/abhisheksugam/Climate_Police/issues/1"},"comments":{"href":"https://api.github.com/repos/abhisheksugam/Climate_Police/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/abhisheksugam/Climate_Police/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/abhisheksugam/Climate_Police/statuses/87168b17de2e15619d67db0e7af386831725d501"}}}}
{"actor":{"display_login":"abhisheksugam"}}