Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -69,8 +69,8 @@ def load_and_concat_data():
|
|
69 |
filtered_df = concatenated_df[columns_to_keep].reset_index(drop=True)
|
70 |
filtered_df['date_posted'] = pd.to_datetime(filtered_df['date_posted'], errors='coerce')
|
71 |
|
72 |
-
# Drop duplicates
|
73 |
-
filtered_df = filtered_df.drop_duplicates()
|
74 |
|
75 |
return filtered_df
|
76 |
|
@@ -92,6 +92,7 @@ def expand_time_series(df, date_col, start_date, end_date):
|
|
92 |
df.set_index(date_col, inplace=True)
|
93 |
expanded_df = df.reindex(full_range).reset_index()
|
94 |
expanded_df.columns = ['Week', 'Job Postings']
|
|
|
95 |
return expanded_df
|
96 |
|
97 |
def create_weekly_dashboard(df):
|
|
|
69 |
filtered_df = concatenated_df[columns_to_keep].reset_index(drop=True)
|
70 |
filtered_df['date_posted'] = pd.to_datetime(filtered_df['date_posted'], errors='coerce')
|
71 |
|
72 |
+
# Drop duplicates and rows with NaT in date_posted
|
73 |
+
filtered_df = filtered_df.drop_duplicates().dropna(subset=['date_posted'])
|
74 |
|
75 |
return filtered_df
|
76 |
|
|
|
92 |
df.set_index(date_col, inplace=True)
|
93 |
expanded_df = df.reindex(full_range).reset_index()
|
94 |
expanded_df.columns = ['Week', 'Job Postings']
|
95 |
+
expanded_df['Job Postings'] = expanded_df['Job Postings'].fillna(0)
|
96 |
return expanded_df
|
97 |
|
98 |
def create_weekly_dashboard(df):
|