Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,9 +34,13 @@ if st.button("Submit"):
|
|
| 34 |
|
| 35 |
elif selected_data_type == "Yearly":
|
| 36 |
df_selected = df_yearly[df_yearly["Shop Code"] == selected_index]
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
plt.figure(figsize=(10, 6))
|
| 39 |
-
plt.bar(
|
| 40 |
plt.title(f"Yearly Sales Data for Shop Code {selected_index}")
|
| 41 |
plt.xlabel("Years")
|
| 42 |
plt.ylabel("Sales Amount")
|
|
|
|
| 34 |
|
| 35 |
elif selected_data_type == "Yearly":
|
| 36 |
df_selected = df_yearly[df_yearly["Shop Code"] == selected_index]
|
| 37 |
+
|
| 38 |
+
# Filter out non-numeric columns
|
| 39 |
+
numeric_columns = df_selected.columns[1:]
|
| 40 |
+
df_selected[numeric_columns] = df_selected[numeric_columns].apply(pd.to_numeric, errors='coerce')
|
| 41 |
+
|
| 42 |
plt.figure(figsize=(10, 6))
|
| 43 |
+
plt.bar(numeric_columns, df_selected.iloc[0, 1:].astype(float))
|
| 44 |
plt.title(f"Yearly Sales Data for Shop Code {selected_index}")
|
| 45 |
plt.xlabel("Years")
|
| 46 |
plt.ylabel("Sales Amount")
|