This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"id": "theoretical-governor", | |
"metadata": {}, | |
"source": [ | |
"## Data prep" | |
] | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks to Leland McInnes (@leland_mcinnes) for devising the weighting solution | |
import hdbscan | |
# https://hdbscan.readthedocs.io/en/latest/index.html | |
import numpy as np | |
"""Assume df is a pandas dataframe with latitude and longitude columns in WGS84""" | |
# Define a cluster selection epsilon to group points within this distance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fiscal_election_date | FSA | winning_party | |
---|---|---|---|
2008 | A0A | Liberal Party of Canada | |
2008 | A0B | Liberal Party of Canada | |
2008 | A0C | Liberal Party of Canada | |
2008 | A0E | Liberal Party of Canada | |
2008 | A0G | Liberal Party of Canada | |
2008 | A0H | Liberal Party of Canada | |
2008 | A0J | Liberal Party of Canada | |
2008 | A0K | Liberal Party of Canada | |
2008 | A0L | Newfoundland and Labrador First Party |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
year | name | value | lastValue | |
---|---|---|---|---|
1990 | BP CANADA | 170 | ||
1990 | EXXONMOBIL CANADA | 105 | ||
1990 | IMPERIAL OIL | 87 | ||
1990 | ENCANA | 37 | ||
1990 | HUSKY OIL | 29 | ||
1990 | PEMBINA | 23 | ||
1990 | HOME OIL COMPANY | 22 | ||
1990 | PETRO-CANADA | 21 | ||
1990 | CHEVRON CANADA | 19 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
year | name | value | lastValue | |
---|---|---|---|---|
1975 | Imperial Oil Resources Limited | 61 | ||
1975 | BP Canada Energy Company | 49 | ||
1975 | Imperial Oil Resources | 42 | ||
1975 | Petro-Canada | 30 | ||
1975 | Gulf Canada Limited | 21 | ||
1975 | Pembina Resources Limited | 12 | ||
1975 | Chevron Canada Limited | 11 | ||
1975 | Dome Petroleum Ltd. | 9 | ||
1975 | ExxonMobil Canada Energy | 9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CTUID | CTNAME | bilingual | |
---|---|---|---|
4620001.00 | 0001.00 | 1015 | |
4620002.00 | 0002.00 | 945 | |
4620003.00 | 0003.00 | 2630 | |
4620004.00 | 0004.00 | 1305 | |
4620005.00 | 0005.00 | 1170 | |
4620006.00 | 0006.00 | 1655 | |
4620007.00 | 0007.00 | 2320 | |
4620008.00 | 0008.00 | 1155 | |
4620009.00 | 0009.00 | 1500 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Census tracts on Montreal island</title> | |
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script> | |
<style type="text/css"> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drug | negative | neutral | positive | |
---|---|---|---|---|
Methamphetamine | 36 | 6 | 11 | |
MDMA | 26 | 9 | 16 | |
Cannabis | 13 | 13 | 11 | |
Peyote | 11 | 15 | 10 | |
PCP | 15 | 12 | 8 | |
Amphetamine | 23 | 5 | 6 | |
LSD | 13 | 12 | 9 | |
Ketamine | 12 | 12 | 6 | |
Mushrooms | 8 | 12 | 9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = | |
[{"From":"WA", "Students":11906, "To":"WA"}, | |
{"From":"WA", "Students":0, "To":"DE"}, | |
{"From":"WA", "Students":60, "To":"DC"}, | |
{"From":"WA", "Students":38, "To":"WI"}, | |
{"From":"WA", "Students":4, "To":"WV"}, | |
{"From":"WA", "Students":75, "To":"HI"}, | |
{"From":"WA", "Students":76, "To":"FL"}, | |
{"From":"WA", "Students":17, "To":"WY"}, | |
{"From":"WA", "Students":21, "To":"NH"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
year | election_num | election_abbr | election_name | party | elected_members | percentage_of_popular_vote | number_of_valid_votes | number_of_candidates | voter_turnout | Winner | |
---|---|---|---|---|---|---|---|---|---|---|---|
1867 | 1 | 1st | 1st General Election | Conservative (1867-1942) | 101 | 50% | 73 | Conservative (1867-1942) | |||
1867 | 1 | 1st | 1st General Election | Liberal Party of Canada | 80 | 49% | 73 | Conservative (1867-1942) | |||
1867 | 1 | 1st | 1st General Election | Other | 1% | 73 | Conservative (1867-1942) | ||||
1872 | 2 | 2nd | 2nd General Election | Conservative (1867-1942) | 103 | 49.90% | 70 | Conservative (1867-1942) | |||
1872 | 2 | 2nd | 2nd General Election | Liberal Party of Canada | 97 | 49.10% | 70 | Conservative (1867-1942) | |||
1872 | 2 | 2nd | 2nd General Election | Other | 1% | 70 | Conservative (1867-1942) | ||||
1874 | 3 | 3rd | 3rd General Election | Liberal Party of Canada | 133 | 53.80% | 70 | Liberal Party of Canada | |||
1874 | 3 | 3rd | 3rd General Election | Conservative (1867-1942) | 73 | 45.40% | 70 | Liberal Party of Canada | |||
1874 | 3 | 3rd | 3rd General Election | Other | 0.80% | 70 | Liberal Party of Canada |
NewerOlder