Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -112,12 +112,16 @@ def prepare_dashboard_data(df):
|
|
112 |
def display_dashboard(df):
|
113 |
top_companies, top_locations, top_job_titles, df_by_date = prepare_dashboard_data(df)
|
114 |
|
|
|
|
|
|
|
115 |
col1, col2 = st.columns(2)
|
116 |
|
117 |
with col1:
|
118 |
st.subheader("Job Postings Overview")
|
119 |
st.metric("Total Job Postings", len(df))
|
120 |
st.metric("Unique Companies", df['company'].nunique())
|
|
|
121 |
|
122 |
min_date = df['date_posted'].min().date()
|
123 |
max_date = df['date_posted'].max().date()
|
@@ -140,18 +144,6 @@ def display_dashboard(df):
|
|
140 |
with col4:
|
141 |
fig = create_chart(top_job_titles, top_job_titles.index, top_job_titles.values, "Top 20 Job Titles", ['#59a14f'])
|
142 |
st.plotly_chart(fig, use_container_width=True)
|
143 |
-
|
144 |
-
@st.cache_data
|
145 |
-
def filter_dataframe(df, companies, locations, job_types):
|
146 |
-
filtered_df = df
|
147 |
-
if companies:
|
148 |
-
filtered_df = filtered_df[filtered_df['company'].isin(companies)]
|
149 |
-
if locations:
|
150 |
-
filtered_df = filtered_df[filtered_df['location'].isin(locations)]
|
151 |
-
if job_types:
|
152 |
-
filtered_df = filtered_df[filtered_df['job_type'].isin(job_types)]
|
153 |
-
return filtered_df
|
154 |
-
|
155 |
def display_data_explorer(df):
|
156 |
st.subheader("Data Explorer")
|
157 |
|
|
|
112 |
def display_dashboard(df):
|
113 |
top_companies, top_locations, top_job_titles, df_by_date = prepare_dashboard_data(df)
|
114 |
|
115 |
+
today = datetime.now().date()
|
116 |
+
jobs_today = df[df['date_posted'].dt.date == today].shape[0]
|
117 |
+
|
118 |
col1, col2 = st.columns(2)
|
119 |
|
120 |
with col1:
|
121 |
st.subheader("Job Postings Overview")
|
122 |
st.metric("Total Job Postings", len(df))
|
123 |
st.metric("Unique Companies", df['company'].nunique())
|
124 |
+
st.metric("Job Postings Today", jobs_today)
|
125 |
|
126 |
min_date = df['date_posted'].min().date()
|
127 |
max_date = df['date_posted'].max().date()
|
|
|
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 |
|