TOPSInfosol
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,8 @@ def filter_data(start, end, df_state, select_product_column, date_column, target
|
|
37 |
df_state[original_date_column] = pd.to_datetime(df_state[original_date_column])
|
38 |
filtered_df = df_state[(df_state[original_date_column] >= start_datetime) & (df_state[original_date_column] <= end_datetime)]
|
39 |
|
40 |
-
|
|
|
41 |
fig = px.line(filtered_df, x=original_date_column, y=original_target_column, title="Historical Sales Data")
|
42 |
return [filtered_df, fig]
|
43 |
|
|
|
37 |
df_state[original_date_column] = pd.to_datetime(df_state[original_date_column])
|
38 |
filtered_df = df_state[(df_state[original_date_column] >= start_datetime) & (df_state[original_date_column] <= end_datetime)]
|
39 |
|
40 |
+
filtered_df = filtered_df.groupby(original_date_column)[original_target_column].sum().reset_index()
|
41 |
+
filtered_df = filtered_df.sort_values(by=original_date_column)
|
42 |
fig = px.line(filtered_df, x=original_date_column, y=original_target_column, title="Historical Sales Data")
|
43 |
return [filtered_df, fig]
|
44 |
|