|
import streamlit as st |
|
import plotly.graph_objects as go |
|
import pandas as pd |
|
from data import * |
|
from utils import * |
|
|
|
st.write('Калькулятор фин здоровья') |
|
|
|
st.sidebar.title('Подбор параметров') |
|
with st.sidebar: |
|
banner_fz_alf = st.number_input( |
|
"Введите охват аудитории с баннера/виджета ФЗ в АЛФ", |
|
min_value=0, |
|
step=1, |
|
format='%d' |
|
|
|
) |
|
|
|
banner_fz_vs = st.number_input( |
|
"Введите охват аудитории с баннера/виджета ФЗ в Всего Средств", |
|
min_value=0, |
|
step=1, |
|
format='%d' |
|
|
|
) |
|
banner_fz_profile = st.number_input( |
|
"Введите охват аудитории с баннера/виджета ФЗ в Профиле", |
|
min_value=0, |
|
step=1, |
|
format='%d' |
|
|
|
) |
|
banner_fz_all_serv = st.number_input( |
|
"Введите охват аудитории с баннера/виджета ФЗ в разделе Все Сервисы", |
|
min_value=0, |
|
step=1, |
|
format='%d' |
|
|
|
) |
|
|
|
banner_fz_smart_search = st.number_input( |
|
"Введите охват аудитории с Умного Поиска", |
|
min_value=0, |
|
step=1, |
|
format='%d' |
|
|
|
) |
|
|
|
|
|
st.title("Калькулятор Фин Здоровья") |
|
st.write('Данный инструмент позволяет простроить прогноз на 1 месяц с конверсией, учитывая усредненные показатели предыдущих периодов') |
|
|
|
df_with_conv = pd.DataFrame() |
|
df_with_conv['Значение метрики'] = list_with_metrics |
|
df_with_conv['Конверсия'] = [round(i*100, 2) for i in list_with_percent] |
|
|
|
|
|
|
|
|
|
|
|
|
|
gez_fz_show = (banner_fz_alf*list_with_percent[4]+banner_fz_vs*list_with_percent[5]+banner_fz_profile*list_with_percent[6])*list_with_percent[7] |
|
|
|
|
|
|
|
wait_mau = [banner_fz_alf, |
|
banner_fz_vs, |
|
banner_fz_profile, |
|
banner_fz_alf*list_with_percent[4], |
|
banner_fz_vs*list_with_percent[5], |
|
banner_fz_profile*list_with_percent[6], |
|
gez_fz_show, |
|
gez_fz_show*list_with_percent[8], |
|
gez_fz_show*list_with_percent[9], |
|
gez_fz_show*list_with_percent[10], |
|
gez_fz_show*list_with_percent[11], |
|
gez_fz_show*list_with_percent[12], |
|
gez_fz_show*list_with_percent[13], |
|
gez_fz_show*list_with_percent[14], |
|
gez_fz_show*list_with_percent[15], |
|
gez_fz_show*list_with_percent[14]*list_with_percent[16], |
|
gez_fz_show*list_with_percent[15]*list_with_percent[17], |
|
gez_fz_show*list_with_percent[15]*list_with_percent[18], |
|
gez_fz_show*list_with_percent[15]*list_with_percent[18]*list_with_percent[19], |
|
] + [0 for i in range(len(df_with_conv)-19)] |
|
|
|
df_with_conv['Ожидаемый MAU'] = [round(i) for i in wait_mau] |
|
|
|
st.dataframe(df_with_conv, width=1100, height=500) |
|
|
|
|
|
|
|
|
|
st.subheader("Sankey-диаграмма за октябрь в Streamlit") |
|
|
|
fig_1 = plot_sankey(data_1) |
|
|
|
fig_2 = plot_sankey(data_2) |
|
|
|
|
|
|
|
|
|
st.plotly_chart(fig_1, use_container_width=True, height=1000) |
|
|
|
st.plotly_chart(fig_2) |