Hiroshi99 commited on
Commit
608e43e
·
verified ·
1 Parent(s): decc9fe

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import numpy as np
3
+ import pandas as pd
4
+ import plotly.express as px
5
+
6
+ st.set_page_config(layout='wide')
7
+ df = pd.read_csv('india.csv')
8
+
9
+ list_of_states = list(df['State'].unique())
10
+ list_of_states.insert(0,'Overall India')
11
+
12
+ st.sidebar.title('india Data Vix')
13
+ selected_state = st.sidebar.selectbox('select a state', list_of_states)
14
+ primary = st.sidebar.selectbox('Select primary Parameter:', sorted(df.columns[5:]))
15
+ secondary = st.sidebar.selectbox('select secondary Parameter:', sorted(df.columns[5:]))
16
+
17
+ plot = st.sidebar.button('Plot a graph')
18
+ if plot:
19
+ st.text('Size represent primary parameter')
20
+ st.text('Color represent secondary parameter')
21
+ if selected_state == 'Overall India':
22
+ #plot for india card
23
+ fig = px.scatter_mapbox(df,lat="Latitude",lon='Longitude',size=primary,color=secondary,zoom=4,size_max=35, mapbox_style ='carto-positron',width=1200,height=700,hover_name="District")
24
+ st.plotly_chart(fig,use_container_width=True)