Niharmahesh commited on
Commit
bceed2a
·
verified ·
1 Parent(s): 1ce841d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -144,6 +144,17 @@ def display_dashboard(df):
144
  with col4:
145
  fig = create_chart(top_job_titles, top_job_titles.index, top_job_titles.values, "Top 20 Job Titles", ['#59a14f'])
146
  st.plotly_chart(fig, use_container_width=True)
 
 
 
 
 
 
 
 
 
 
 
147
  def display_data_explorer(df):
148
  st.subheader("Data Explorer")
149
 
 
144
  with col4:
145
  fig = create_chart(top_job_titles, top_job_titles.index, top_job_titles.values, "Top 20 Job Titles", ['#59a14f'])
146
  st.plotly_chart(fig, use_container_width=True)
147
+ @st.cache_data
148
+ def filter_dataframe(df, companies, locations, job_types):
149
+ filtered_df = df
150
+ if companies:
151
+ filtered_df = filtered_df[filtered_df['company'].isin(companies)]
152
+ if locations:
153
+ filtered_df = filtered_df[filtered_df['location'].isin(locations)]
154
+ if job_types:
155
+ filtered_df = filtered_df[filtered_df['job_type'].isin(job_types)]
156
+ return filtered_df
157
+
158
  def display_data_explorer(df):
159
  st.subheader("Data Explorer")
160