Commit ·
a2f18ea
1
Parent(s): 81bd088
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,9 +71,9 @@ pt = sns.barplot(y=SGCObar_vals,x = SGCObar_list)
|
|
| 71 |
pt.bar_label(pt.containers[0])
|
| 72 |
fig = pt.get_figure()
|
| 73 |
fig.savefig(f'{choice}firstdraw.png')
|
| 74 |
-
st.image(f'{choice}firstdraw.png')
|
| 75 |
|
| 76 |
-
choice2 = st.selectbox("
|
| 77 |
|
| 78 |
if choice2 == "Клиенты с СГЦО 0%":
|
| 79 |
x1 = zeroproc
|
|
@@ -88,12 +88,12 @@ for vb in x1['Тип скидки'].unique():
|
|
| 88 |
ex.update({vb:x1.loc[x1['Тип скидки']==f'{vb}'].shape[0]})
|
| 89 |
bar_list = list(ex.keys())
|
| 90 |
bar_vals = list(ex.values())
|
| 91 |
-
pt = sns.barplot(y=bar_vals,x=bar_list)
|
| 92 |
sns.set(rc={'figure.figsize':(15,10)},font_scale=1)
|
|
|
|
| 93 |
pt.bar_label(pt.containers[0])
|
| 94 |
fig = pt.get_figure()
|
| 95 |
fig.savefig(f'{choice}{choice2}firstdraw.png')
|
| 96 |
-
st.image(f'{choice}{choice2}firstdraw.png')
|
| 97 |
|
| 98 |
plt.clf()
|
| 99 |
pie_data = [x1.loc[x1['Минимальный объем'] > x1['Количество']].shape[0],x1.loc[x1['Минимальный объем'] < x1['Количество']].shape[0]]
|
|
@@ -102,7 +102,7 @@ sns.set(rc={'figure.figsize':(15,10)},font_scale=1)
|
|
| 102 |
colors_pie= sns.color_palette('bright')[1:5]
|
| 103 |
plt.pie(pie_data,labels=pie_lables,colors=colors_pie,autopct='%.0f%%')
|
| 104 |
plt.savefig(f'{choice}{choice2}piefirsttdraw.png')
|
| 105 |
-
st.image(f'{choice}{choice2}piefirsttdraw.png')
|
| 106 |
|
| 107 |
plt.clf()
|
| 108 |
tg_array = x1['Номенклатура.Вид номенклатуры'].unique()
|
|
@@ -117,7 +117,7 @@ y = sns.barplot(y=bar_list,x=bar_vals)
|
|
| 117 |
y.bar_label(y.containers[0])
|
| 118 |
fig = y.get_figure()
|
| 119 |
fig.savefig(f'{choice}{choice2}secdraw.png')
|
| 120 |
-
st.image(f'{choice}{choice2}secdraw.png')
|
| 121 |
|
| 122 |
plt.clf()
|
| 123 |
tg_array = x1['Номенклатура.Вид номенклатуры'].unique()
|
|
@@ -131,4 +131,5 @@ y = sns.barplot(x=bar_vals,y=bar_list,palette=['blue'])
|
|
| 131 |
y.bar_label(y.containers[0])
|
| 132 |
fig = y.get_figure()
|
| 133 |
fig.savefig(f'{choice}{choice2}thirddraw.png')
|
| 134 |
-
st.image(f'{choice}{choice2}thirddraw.png'
|
|
|
|
|
|
| 71 |
pt.bar_label(pt.containers[0])
|
| 72 |
fig = pt.get_figure()
|
| 73 |
fig.savefig(f'{choice}firstdraw.png')
|
| 74 |
+
st.image(f'{choice}firstdraw.png',caption='Разделение кол-ва скидок по группам СГЦО')
|
| 75 |
|
| 76 |
+
choice2 = st.selectbox("Выберите группу клиентов", ("Клиенты с СГЦО 0%",'Клиенты с СГЦО 5% ','Клиенты с СГЦО 10%'))
|
| 77 |
|
| 78 |
if choice2 == "Клиенты с СГЦО 0%":
|
| 79 |
x1 = zeroproc
|
|
|
|
| 88 |
ex.update({vb:x1.loc[x1['Тип скидки']==f'{vb}'].shape[0]})
|
| 89 |
bar_list = list(ex.keys())
|
| 90 |
bar_vals = list(ex.values())
|
|
|
|
| 91 |
sns.set(rc={'figure.figsize':(15,10)},font_scale=1)
|
| 92 |
+
pt = sns.barplot(y=bar_vals,x=bar_list,palette=['Green'])
|
| 93 |
pt.bar_label(pt.containers[0])
|
| 94 |
fig = pt.get_figure()
|
| 95 |
fig.savefig(f'{choice}{choice2}firstdraw.png')
|
| 96 |
+
st.image(f'{choice}{choice2}firstdraw.png',caption='Разделение по Типу скидки ')
|
| 97 |
|
| 98 |
plt.clf()
|
| 99 |
pie_data = [x1.loc[x1['Минимальный объем'] > x1['Количество']].shape[0],x1.loc[x1['Минимальный объем'] < x1['Количество']].shape[0]]
|
|
|
|
| 102 |
colors_pie= sns.color_palette('bright')[1:5]
|
| 103 |
plt.pie(pie_data,labels=pie_lables,colors=colors_pie,autopct='%.0f%%')
|
| 104 |
plt.savefig(f'{choice}{choice2}piefirsttdraw.png')
|
| 105 |
+
st.image(f'{choice}{choice2}piefirsttdraw.png', caption='Соотношение позиций в соотвествии с минимальным объемом')
|
| 106 |
|
| 107 |
plt.clf()
|
| 108 |
tg_array = x1['Номенклатура.Вид номенклатуры'].unique()
|
|
|
|
| 117 |
y.bar_label(y.containers[0])
|
| 118 |
fig = y.get_figure()
|
| 119 |
fig.savefig(f'{choice}{choice2}secdraw.png')
|
| 120 |
+
st.image(f'{choice}{choice2}secdraw.png',caption='Количество скидок по товарным группам')
|
| 121 |
|
| 122 |
plt.clf()
|
| 123 |
tg_array = x1['Номенклатура.Вид номенклатуры'].unique()
|
|
|
|
| 131 |
y.bar_label(y.containers[0])
|
| 132 |
fig = y.get_figure()
|
| 133 |
fig.savefig(f'{choice}{choice2}thirddraw.png')
|
| 134 |
+
st.image(f'{choice}{choice2}thirddraw.png',caption='Медиана процента общей скидки '
|
| 135 |
+
'(Под общей скидкой понимается СГЦО + % скидки ДП)')
|