Spaces:
Runtime error
Runtime error
bug fix
Browse files
app.py
CHANGED
@@ -75,27 +75,25 @@ def generate_plot(df):
|
|
75 |
axs[0, 0].plot(df.loc[df['Group'] == '4', 'Date'], df.loc[df['Group'] == '4', 'sales'], color='grey')
|
76 |
axs[0, 0].plot(df.loc[df['Group'] == '4', 'Date'], df.loc[df['Group'] == '4', 'pred'], color = 'red')
|
77 |
axs[0, 0].set_title('Article Group 1')
|
78 |
-
axs[0, 0].
|
79 |
-
|
80 |
|
81 |
axs[0, 1].plot(df.loc[df['Group'] == '7', 'Date'], df.loc[df['Group'] == '7', 'sales'], color='grey')
|
82 |
axs[0, 1].plot(df.loc[df['Group'] == '7', 'Date'], df.loc[df['Group'] == '4', 'pred'], color = 'red')
|
83 |
axs[0, 1].set_title('Article Group 2')
|
84 |
-
axs[0,
|
85 |
-
axs[0, 0].tight_layout()
|
86 |
|
87 |
axs[1, 0].plot(df.loc[df['Group'] == '1', 'Date'], df.loc[df['Group'] == '1', 'sales'], color='grey')
|
88 |
axs[1, 0].plot(df.loc[df['Group'] == '1', 'Date'], df.loc[df['Group'] == '4', 'pred'], color = 'red')
|
89 |
axs[1, 0].set_title('Article Group 3')
|
90 |
-
axs[
|
91 |
-
axs[0, 0].tight_layout()
|
92 |
|
93 |
axs[1, 1].plot(df.loc[df['Group'] == '6', 'Date'], df.loc[df['Group'] == '6', 'sales'], color='grey')
|
94 |
axs[1, 1].plot(df.loc[df['Group'] == '6', 'Date'], df.loc[df['Group'] == '4', 'pred'], color = 'red')
|
95 |
axs[1, 1].set_title('Article Group 4')
|
96 |
-
axs[
|
97 |
-
axs[0, 0].tight_layout()
|
98 |
|
|
|
99 |
return fig, axs
|
100 |
|
101 |
@st.cache_data
|
|
|
75 |
axs[0, 0].plot(df.loc[df['Group'] == '4', 'Date'], df.loc[df['Group'] == '4', 'sales'], color='grey')
|
76 |
axs[0, 0].plot(df.loc[df['Group'] == '4', 'Date'], df.loc[df['Group'] == '4', 'pred'], color = 'red')
|
77 |
axs[0, 0].set_title('Article Group 1')
|
78 |
+
axs[0, 0].set_xticklabels(['Start', 'Mid', 'End'], rotation=45)
|
79 |
+
|
80 |
|
81 |
axs[0, 1].plot(df.loc[df['Group'] == '7', 'Date'], df.loc[df['Group'] == '7', 'sales'], color='grey')
|
82 |
axs[0, 1].plot(df.loc[df['Group'] == '7', 'Date'], df.loc[df['Group'] == '4', 'pred'], color = 'red')
|
83 |
axs[0, 1].set_title('Article Group 2')
|
84 |
+
axs[0, 1].set_xticklabels(['Start', 'Mid', 'End'], rotation=45)
|
|
|
85 |
|
86 |
axs[1, 0].plot(df.loc[df['Group'] == '1', 'Date'], df.loc[df['Group'] == '1', 'sales'], color='grey')
|
87 |
axs[1, 0].plot(df.loc[df['Group'] == '1', 'Date'], df.loc[df['Group'] == '4', 'pred'], color = 'red')
|
88 |
axs[1, 0].set_title('Article Group 3')
|
89 |
+
axs[1, 0].set_xticklabels(['Start', 'Mid', 'End'], rotation=45)
|
|
|
90 |
|
91 |
axs[1, 1].plot(df.loc[df['Group'] == '6', 'Date'], df.loc[df['Group'] == '6', 'sales'], color='grey')
|
92 |
axs[1, 1].plot(df.loc[df['Group'] == '6', 'Date'], df.loc[df['Group'] == '4', 'pred'], color = 'red')
|
93 |
axs[1, 1].set_title('Article Group 4')
|
94 |
+
axs[1, 1].set_xticklabels(['Start', 'Mid', 'End'], rotation=45)
|
|
|
95 |
|
96 |
+
plt.tight_layout()
|
97 |
return fig, axs
|
98 |
|
99 |
@st.cache_data
|