-
Notifications
You must be signed in to change notification settings - Fork 0
/
stateinfo.py
128 lines (126 loc) · 9.84 KB
/
stateinfo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
"""
A table with info per state.
"""
stateinfo = {
# state, total: rank, mi2, km2, land: rank, mi2, km2, pct, water: rank, mi2, km2, pct
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
"AK": ("Alaska", 1, 665384.04, 1723337, 1, 570640.95, 1477953, 85.76, 1, 94743.10, 245384, 14.24),
"TX": ("Texas", 2, 268596.46, 695662, 2, 261231.71, 676587, 97.26, 8, 7364.75, 19075, 2.74),
"CA": ("California", 3, 163694.74, 423967, 3, 155779.22, 403466, 95.16, 6, 7915.52, 20501, 4.84),
"MT": ("Montana", 4, 147039.71, 380831, 4, 145545.80, 376962, 98.98, 26, 1493.91, 3869, 1.02),
"NM": ("New Mexico", 5, 121590.30, 314917, 5, 121298.15, 314161, 99.76, 49, 292.15, 757, 0.24),
"AZ": ("Arizona", 6, 113990.30, 295234, 6, 113594.08, 294207, 99.65, 48, 396.22, 1026, 0.35),
"NV": ("Nevada", 7, 110571.82, 286380, 7, 109781.18, 284332, 99.28, 36, 790.65, 2048, 0.72),
"CO": ("Colorado", 8, 104093.67, 269601, 8, 103641.89, 268431, 99.57, 44, 451.78, 1170, 0.43),
"OR": ("Oregon", 9, 98378.54, 254799, 10, 95988.01, 248608, 97.57, 20, 2390.53, 6191, 2.43),
"WY": ("Wyoming", 10, 97813.01, 253335, 9, 97093.14, 251470, 99.26, 37, 719.87, 1864, 0.74),
"MI": ("Michigan", 11, 96713.51, 250487, 22, 56538.90, 146435, 58.46, 2, 40174.61, 104052, 41.54),
"MN": ("Minnesota", 12, 86935.83, 225163, 14, 79626.74, 206232, 91.59, 9, 7309.09, 18930, 8.41),
"UT": ("Utah", 13, 84896.88, 219882, 12, 82169.62, 212818, 96.79, 17, 2727.26, 7064, 3.21),
"ID": ("Idaho", 14, 83568.95, 216443, 11, 82643.12, 214045, 98.89, 33, 925.83, 2398, 1.11),
"KS": ("Kansas", 15, 82278.36, 213100, 13, 81758.72, 211754, 99.37, 42, 519.64, 1346, 0.63),
"NE": ("Nebraska", 16, 77347.81, 200330, 15, 76824.17, 198974, 99.32, 41, 523.64, 1356, 0.68),
"SD": ("South Dakota", 17, 77115.68, 199729, 16, 75811.00, 196350, 98.31, 29, 1304.68, 3379, 1.69),
"WA": ("Washington", 18, 71297.95, 184661, 20, 66455.52, 172119, 93.21, 11, 4842.43, 12542, 6.79),
"ND": ("North Dakota", 19, 70698.32, 183108, 17, 69000.80, 178711, 97.60, 24, 1697.52, 4397, 2.40),
"OK": ("Oklahoma", 20, 69898.87, 181037, 19, 68594.92, 177660, 98.13, 30, 1303.95, 3377, 1.87),
"MO": ("Missouri", 21, 69706.99, 180540, 18, 68741.52, 178040, 98.61, 32, 965.47, 2501, 1.39),
"FL": ("Florida", 22, 65757.70, 170312, 26, 53624.76, 138887, 81.55, 3, 12132.94, 31424, 18.45),
"WI": ("Wisconsin", 23, 65496.38, 169635, 25, 54157.80, 140268, 82.69, 4, 11338.57, 29367, 17.31),
"GA": ("Georgia", 24, 59425.15, 153910, 21, 57513.49, 148959, 96.78, 22, 1911.66, 4951, 3.22),
"IL": ("Illinois", 25, 57913.55, 149995, 24, 55518.93, 143793, 95.87, 19, 2394.62, 6202, 4.13),
"IA": ("Iowa", 26, 56272.81, 145746, 23, 55857.13, 144669, 99.26, 45, 415.68, 1077, 0.74),
"NY": ("New York", 27, 54554.98, 141297, 30, 47126.40, 122057, 86.38, 7, 7428.58, 19240, 13.62),
"NC": ("North Carolina", 28, 53819.16, 139391, 29, 48617.91, 125920, 90.34, 10, 5201.25, 13471, 9.66),
"AR": ("Arkansas", 29, 53178.55, 137732, 27, 52035.48, 134771, 97.85, 31, 1143.07, 2961, 2.15),
"AL": ("Alabama", 30, 52420.07, 135767, 28, 50645.33, 131171, 96.61, 23, 1774.74, 4597, 3.39),
"LA": ("Louisiana", 31, 52378.13, 135659, 33, 43203.90, 111898, 82.48, 5, 9174.23, 23761, 17.52),
"MS": ("Mississippi", 32, 48431.78, 125438, 31, 46923.27, 121531, 96.89, 25, 1508.51, 3907, 3.11),
"PA": ("Pennsylvania", 33, 46054.34, 119280, 32, 44742.70, 115883, 97.15, 28, 1311.64, 3397, 2.85),
"OH": ("Ohio", 34, 44825.58, 116098, 35, 40860.69, 105829, 91.15, 14, 3964.89, 10269, 8.85),
"VA": ("Virginia", 35, 42774.93, 110787, 36, 39490.09, 102279, 92.32, 15, 3284.84, 8508, 7.68),
"TN": ("Tennessee", 36, 42144.25, 109153, 34, 41234.90, 106798, 97.84, 35, 909.36, 2355, 2.16),
"KY": ("Kentucky", 37, 40407.80, 104656, 37, 39486.34, 102269, 97.72, 34, 921.46, 2387, 2.28),
"IN": ("Indiana", 38, 36419.55, 94326, 38, 35826.11, 92789, 98.37, 39, 593.44, 1537, 1.63),
"ME": ("Maine", 39, 35379.74, 91633, 39, 30842.92, 79883, 87.18, 12, 4536.82, 11750, 12.82),
"SC": ("South Carolina", 40, 32020.49, 82933, 40, 30060.70, 77857, 93.88, 21, 1959.79, 5076, 6.12),
"WV": ("West Virginia", 41, 24230.04, 62756, 41, 24038.21, 62259, 99.21, 50, 191.83, 497, 0.79),
"MD": ("Maryland", 42, 12405.93, 32131, 42, 9707.24, 25142, 78.25, 18, 2698.69, 6990, 21.75),
"HI": ("Hawaii", 43, 10931.72, 28313, 47, 6422.63, 16635, 58.75, 13, 4509.09, 11678, 41.25),
"MA": ("Massachusetts", 44, 10554.39, 27336, 45, 7800.06, 20202, 73.90, 16, 2754.33, 7134, 26.10),
"VT": ("Vermont", 45, 9616.36, 24906, 43, 9216.66, 23871, 95.84, 46, 399.71, 1035, 4.16),
"NH": ("New Hampshire", 46, 9349.16, 24214, 44, 8952.65, 23187, 95.76, 47, 396.51, 1027, 4.24),
"NJ": ("New Jersey", 47, 8722.58, 22591, 46, 7354.22, 19047, 84.31, 27, 1368.36, 3544, 15.69),
"CT": ("Connecticut", 48, 5543.41, 14357, 48, 4842.36, 12542, 87.35, 38, 701.06, 1816, 12.65),
"DE": ("Delaware", 49, 2488.72, 6446, 49, 1948.54, 5047, 78.29, 40, 540.18, 1399, 21.71),
"RI": ("Rhode Island", 50, 1544.89, 4001, 50, 1033.81, 2678, 66.92, 43, 511.07, 1324, 33.08),
"DC": ("District of Columbia", None, 68.34, 177, None, 61.05, 158, 89.33, None, 7.29, 19, 10.67),
"PR": ("Puerto Rico", None, 5324.84, 13791, None, 3423.78, 8868, 64.30, None, 1901.07, 4924, 35.70),
"MP": ("Northern Mariana Islands", None, 1975.57, 5117, None, 182.33, 472, 9.23, None, 1793.24, 4644, 90.77),
"VI": ("United States Virgin Islands", None, 732.93, 1898, None, 134.32, 348, 18.33, None, 598.61, 1550, 81.67),
"AS": ("American Samoa", None, 581.05, 1505, None, 76.46, 198, 13.16, None, 504.60, 1307, 86.84),
"GU": ("Guam", None, 570.62, 1478, None, 209.80, 543, 36.77, None, 360.82, 935, 63.23),
"UM": ("United States Minor Outlying Islands", None, 16.00, 41, None, 16.00, 41, None, None, None, None, None),
#("United States Contiguous United States", "Total", 3120426.47, 8081867, None, 2954841.42, 7653004, 94.69, None, 165584.6, 428862, 5.31),
#("United States 50 states and District of Columbia", "Total", 3796742.23, 9833517, None, 3531905.43, 9147593, 93.02, None, 264836.79, 685924, 6.98),
#("United States All U.S. territory", "Total", 3805943.26, 9857348, None, 3535948.12, 9158064, 92.91),
}
class State:
def __init__(self, code, name, nelectors, totalvotes):
self.code = code
self.name = name
self.nelectors = nelectors
self.totalvotes = totalvotes
electionstats = {
"AK": State("AK", "Alaska" , 3, 375584),
"AL": State("AL", "Alabama" , 9, 2313155),
"AR": State("AR", "Arkansas" , 6, 1198738),
"AZ": State("AZ", "Arizona" , 11, 3395288),
"CA": State("CA", "California" , 55, 16329189),
"CO": State("CO", "Colorado" , 9, 3304355),
"CT": State("CT", "Connecticut" , 7, 1781668),
"DC": State("DC", "District of Columbia" , 3, 316924),
"DE": State("DE", "Delaware" , 3, 505261),
"FL": State("FL", "Florida" , 29, 11124591),
"GA": State("GA", "Georgia" , 16, 5033023),
"HI": State("HI", "Hawaii" , 4, 591592),
"IA": State("IA", "Iowa" , 6, 1690265),
"ID": State("ID", "Idaho" , 4, 866071),
"IL": State("IL", "Illinois" , 20, 5904973),
"IN": State("IN", "Indiana" , 11, 3054370),
"KS": State("KS", "Kansas" , 6, 1346982),
"KY": State("KY", "Kentucky" , 8, 2145282),
"LA": State("LA", "Louisiana" , 8, 2244962),
"MA": State("MA", "Massachusetts" , 11, 3546360),
"MD": State("MD", "Maryland" , 10, 2839403),
"ME": State("ME", "Maine" , 4, 811819),
"MI": State("MI", "Michigan" , 16, 5550969),
"MN": State("MN", "Minnesota" , 10, 3270196),
"MO": State("MO", "Missouri" , 10, 3025889),
"MS": State("MS", "Mississippi" , 6, 1136172),
"MT": State("MT", "Montana" , 3, 606747),
"NC": State("NC", "North Carolina" , 15, 5494201),
"ND": State("ND", "North Dakota" , 3, 362294),
"NE": State("NE", "Nebraska" , 5, 944678),
"NH": State("NH", "New Hampshire" , 4, 809828),
"NJ": State("NJ", "New Jersey" , 14, 4462962),
"NM": State("NM", "New Mexico" , 5, 918552),
"NV": State("NV", "Nevada" , 6, 1393987),
"NY": State("NY", "New York" , 29, 8344155),
"OH": State("OH", "Ohio" , 18, 5982518),
"OK": State("OK", "Oklahoma" , 7, 1562469),
"OR": State("OR", "Oregon" , 7, 2318988),
"PA": State("PA", "Pennsylvania" , 20, 6815155),
"RI": State("RI", "Rhode Island" , 4, 507800),
"SC": State("SC", "South Carolina" , 9, 2529402),
"SD": State("SD", "South Dakota" , 3, 449571),
"TN": State("TN", "Tennessee" , 11, 3049184),
"TX": State("TX", "Texas" , 38, 11436915),
"UT": State("UT", "Utah" , 6, 1376695),
"VA": State("VA", "Virginia" , 13, 4427319),
"VT": State("VT", "Vermont" , 3, 390289),
"WA": State("WA", "Washington" , 12, 4580745),
"WI": State("WI", "Wisconsin" , 10, 3312136),
"WV": State("WV", "West Virginia" , 5, 790478),
"WY": State("WY", "Wyoming" , 3, 281096),
}