Niharmahesh commited on
Commit
b114f89
·
verified ·
1 Parent(s): e883314

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -115,7 +115,13 @@ def get_unique_values(df):
115
  'Date_posted': df['date_posted'].unique()
116
 
117
  }
118
-
 
 
 
 
 
 
119
  def create_chart(data, _x, y, title, color_sequence):
120
  fig = px.bar(data, x=_x, y=y, title=title, color_discrete_sequence=color_sequence)
121
  fig.update_layout(plot_bgcolor='rgba(0,0,0,0)', paper_bgcolor='rgba(0,0,0,0)', font_color='#FFFFFF')
 
115
  'Date_posted': df['date_posted'].unique()
116
 
117
  }
118
+ @st.cache_data
119
+ def prepare_dashboard_data(df):
120
+ top_companies = df['company'].value_counts().head(10)
121
+ top_locations = df['location'].value_counts().head(10)
122
+ top_job_titles = df['title'].value_counts().head(20)
123
+ df_by_date = df.groupby('date_posted').size().reset_index(name='count')
124
+ return top_companies, top_locations, top_job_titles, df_by_date
125
  def create_chart(data, _x, y, title, color_sequence):
126
  fig = px.bar(data, x=_x, y=y, title=title, color_discrete_sequence=color_sequence)
127
  fig.update_layout(plot_bgcolor='rgba(0,0,0,0)', paper_bgcolor='rgba(0,0,0,0)', font_color='#FFFFFF')