williambr's picture
Update app.py
6a34f39
raw
history blame
528 Bytes
#import definitions
import pandas as pd
import streamlit as st
df = pd.read_csv('Map-City-State-Zip-Lat-Long.txt', dtype=str, sep=';')
st.title("Input a city or zip code and we will take you there!")
city_name = st.text_input("Please search for a city:")
lat = df[df["City"] == city_name]["Latitude"].values[0]
lon = df[df["City"] == city_name]["Longitude"].values[0]
st.write(lat)
if city_name != "":
st.map({'cities' : city_name, 'lat' : lat, 'lon' : lon})
st.write(city_name, "is located at: ", lat "," lon)