Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,12 @@
|
|
1 |
from cmath import pi
|
2 |
from json import load, tool
|
3 |
from os import stat
|
4 |
-
#from telnetlib import RCP
|
5 |
import streamlit as st
|
6 |
import pandas as pd
|
7 |
import numpy as np
|
8 |
import pydeck as pdk
|
9 |
from typing import Dict, Union
|
10 |
import streamlit.components.v1 as components
|
11 |
-
#import streamlit_shared_funcs as my
|
12 |
|
13 |
st.title("Live 3D Map")
|
14 |
location = st.checkbox('Location Filter')
|
@@ -31,12 +29,9 @@ queried_female = st.checkbox("Female",value=True)
|
|
31 |
|
32 |
@st.cache(allow_output_mutation=True)
|
33 |
def gen_load() -> pd.DataFrame:
|
34 |
-
#df = my.get_data()
|
35 |
df = pd.read_csv('US.txt')
|
36 |
return df
|
37 |
|
38 |
-
#AI Emotional State Score: Anxiety, Confusion, Trepidation, Fear, Guilt
|
39 |
-
|
40 |
import streamlit as st
|
41 |
import pandas as pd
|
42 |
import pydeck as pdk
|
@@ -49,22 +44,23 @@ def ShowCityDataframe(uscities, US):
|
|
49 |
st.title("City FIPS, Location, and Population")
|
50 |
st.text("Search for any city in the United States:")
|
51 |
|
52 |
-
# Search query for existing data
|
53 |
search_query = st.text_input(label="City Name", value="")
|
54 |
if search_query != "":
|
55 |
df = df1[df1["city"].str.contains(search_query, case=False)]
|
56 |
st.subheader("City Detail")
|
57 |
st.write(df)
|
58 |
|
59 |
-
# Search query for new data
|
60 |
search_query2 = st.text_input(label="Zip Code", value="")
|
61 |
if search_query2 != "":
|
62 |
df = df2[df2["zips"].str.contains(search_query2, case=False)]
|
63 |
st.subheader("Zip Code Area Detail")
|
64 |
st.write(df)
|
65 |
|
66 |
-
uscities = "uscities.csv" # CSV -
|
67 |
-
US = "US.txt"
|
|
|
|
|
|
|
68 |
|
69 |
ShowCityDataframe(uscities, US)
|
70 |
|
|
|
1 |
from cmath import pi
|
2 |
from json import load, tool
|
3 |
from os import stat
|
|
|
4 |
import streamlit as st
|
5 |
import pandas as pd
|
6 |
import numpy as np
|
7 |
import pydeck as pdk
|
8 |
from typing import Dict, Union
|
9 |
import streamlit.components.v1 as components
|
|
|
10 |
|
11 |
st.title("Live 3D Map")
|
12 |
location = st.checkbox('Location Filter')
|
|
|
29 |
|
30 |
@st.cache(allow_output_mutation=True)
|
31 |
def gen_load() -> pd.DataFrame:
|
|
|
32 |
df = pd.read_csv('US.txt')
|
33 |
return df
|
34 |
|
|
|
|
|
35 |
import streamlit as st
|
36 |
import pandas as pd
|
37 |
import pydeck as pdk
|
|
|
44 |
st.title("City FIPS, Location, and Population")
|
45 |
st.text("Search for any city in the United States:")
|
46 |
|
|
|
47 |
search_query = st.text_input(label="City Name", value="")
|
48 |
if search_query != "":
|
49 |
df = df1[df1["city"].str.contains(search_query, case=False)]
|
50 |
st.subheader("City Detail")
|
51 |
st.write(df)
|
52 |
|
|
|
53 |
search_query2 = st.text_input(label="Zip Code", value="")
|
54 |
if search_query2 != "":
|
55 |
df = df2[df2["zips"].str.contains(search_query2, case=False)]
|
56 |
st.subheader("Zip Code Area Detail")
|
57 |
st.write(df)
|
58 |
|
59 |
+
uscities = "uscities.csv" # CSV - Columns are: "city","city_ascii","state_id","state_name","county_fips","county_name","lat","lng","population","density","source","military","incorporated","timezone","ranking","zips","id"
|
60 |
+
US = "US.txt" # TSV - Columns are: Country Zip City State Area AreaCode Latitude Longitude Include
|
61 |
+
# TSV Columns sample: US 99553 Akutan Alaska AK Aleutians East 013 54.143 -165.7854 1
|
62 |
+
us-zip-codes = "us-zip-code-latitude-and-longitude.txt" # SSV - Columns are: Zip;City;State;Latitude;Longitude;Timezone;Daylight savings time flag;geopoint
|
63 |
+
# SSV Columns sample: 71937;Cove;AR;34.398483;-94.39398;-6;1;34.398483,-94.39398
|
64 |
|
65 |
ShowCityDataframe(uscities, US)
|
66 |
|