Spaces:
Sleeping
Sleeping
import streamlit as st | |
import pandas as pd | |
import folium | |
# Define the data for top ten cities in India | |
data = { | |
'City': ['Mumbai', 'Delhi', 'Bangalore', 'Hyderabad', 'Ahmedabad', 'Chennai', 'Kolkata', 'Surat', 'Pune', 'Jaipur'], | |
'Latitude': [19.0760, 28.7041, 12.9716, 17.3850, 23.0225, 13.0827, 22.5726, 21.1702, 18.5204, 26.9124], | |
'Longitude': [72.8777, 77.1025, 77.5946, 78.4867, 72.5714, 80.2707, 88.3639, 72.8311, 73.8567, 75.7873] | |
} | |
# Create a pandas DataFrame from the data | |
df = pd.DataFrame(data) | |
# Render the map of India using Folium | |
india_map = folium.Map(location=[20.5937, 78.9629], zoom_start=5) | |
# Plot markers for each city on the map | |
for i in range(len(df)): | |
folium.Marker( | |
location=[df['Latitude'][i], df['Longitude'][i]], | |
popup=df['City'][i] | |
).add_to(india_map) | |
# Display the map using Streamlit | |
st.title('Top Ten Cities in India') | |
st.write("Map showing the top ten cities in India:") | |
st.write(india_map) |