awacke1 commited on
Commit
ff4b330
·
1 Parent(s): 7a985b7

Create backup-app.py

Browse files
Files changed (1) hide show
  1. backup-app.py +125 -0
backup-app.py ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import altair as alt
4
+
5
+ # Define list of largest hospitals with latitude and longitude
6
+ largest_hospitals = [
7
+ {
8
+ 'name': 'Florida Hospital Orlando',
9
+ 'city': 'Orlando',
10
+ 'state': 'FL',
11
+ 'zip_code': '32803',
12
+ 'bed_count': 2411,
13
+ 'lat': 28.562229,
14
+ 'lng': -81.362976
15
+ },
16
+ {
17
+ 'name': 'Cleveland Clinic',
18
+ 'city': 'Cleveland',
19
+ 'state': 'OH',
20
+ 'zip_code': '44195',
21
+ 'bed_count': 1730,
22
+ 'lat': 41.501669,
23
+ 'lng': -81.621275
24
+ },
25
+ {
26
+ 'name': 'Mayo Clinic',
27
+ 'city': 'Rochester',
28
+ 'state': 'MN',
29
+ 'zip_code': '55905',
30
+ 'bed_count': 1372,
31
+ 'lat': 44.020634,
32
+ 'lng': -92.463476
33
+ },
34
+ {
35
+ 'name': 'NewYork-Presbyterian Hospital-Columbia and Cornell',
36
+ 'city': 'New York',
37
+ 'state': 'NY',
38
+ 'zip_code': '10032',
39
+ 'bed_count': 2332,
40
+ 'lat': 40.840886,
41
+ 'lng': -73.942184
42
+ },
43
+ {
44
+ 'name': 'UCHealth University of Colorado Hospital',
45
+ 'city': 'Aurora',
46
+ 'state': 'CO',
47
+ 'zip_code': '80045',
48
+ 'bed_count': 672,
49
+ 'lat': 39.742401,
50
+ 'lng': -104.834694
51
+ },
52
+ {
53
+ 'name': 'Houston Methodist Hospital',
54
+ 'city': 'Houston',
55
+ 'state': 'TX',
56
+ 'zip_code': '77030',
57
+ 'bed_count': 1063,
58
+ 'lat': 29.710292,
59
+ 'lng': -95.399262
60
+ },
61
+ {
62
+ 'name': 'Johns Hopkins Hospital',
63
+ 'city': 'Baltimore',
64
+ 'state': 'MD',
65
+ 'zip_code': '21287',
66
+ 'bed_count': 1293,
67
+ 'lat': 39.297082,
68
+ 'lng': -76.590726
69
+ },
70
+ {
71
+ 'name': 'Massachusetts General Hospital',
72
+ 'city': 'Boston',
73
+ 'state': 'MA',
74
+ 'zip_code': '02114',
75
+ 'bed_count': 1032,
76
+ 'lat': 42.363371,
77
+ 'lng': -71.068635
78
+ },
79
+ {
80
+ 'name': 'University of Michigan Hospitals-Michigan Medicine',
81
+ 'city': 'Ann Arbor',
82
+ 'state': 'MI',
83
+ 'zip_code': '48109',
84
+ 'bed_count': 1145,
85
+ 'lat': 42.282531,
86
+ 'lng': -83.728376
87
+ },
88
+ {
89
+ 'name': 'Mount Sinai Hospital',
90
+ 'city': 'New York',
91
+ 'state': 'NY',
92
+ 'zip_code': '10029',
93
+ 'bed_count': 1168,
94
+ 'lat': 40.789866,
95
+ 'lng': -73.952348
96
+ }
97
+ ]
98
+
99
+ # Convert list of largest hospitals to a Pandas DataFrame
100
+ largest_hospitals_df = pd.DataFrame(largest_hospitals)
101
+
102
+ # Define chart functions
103
+ def map_chart():
104
+ chart = alt.Chart(largest_hospitals_df).mark_circle().encode(
105
+ longitude='lng:Q',
106
+ latitude='lat:Q',
107
+ size=alt.Size('bed_count:Q', title='Bed Count'),
108
+ color=alt.Color('state:N', legend=alt.Legend(title='State')),
109
+ tooltip=['name', 'bed_count', 'city', 'state']
110
+ ).properties(
111
+ width=700,
112
+ height=500,
113
+ title='Location of Largest Hospitals in the US'
114
+ )
115
+ st.altair_chart(chart)
116
+
117
+ # Define chart buttons
118
+ st.sidebar.header('Select a Chart')
119
+ chart_options = ['Map Chart']
120
+ chart_choice = st.sidebar.selectbox('', chart_options)
121
+
122
+ # Call chart functions based on user input
123
+ if chart_choice == 'Map Chart':
124
+ map_chart()
125
+