Spaces:
Running
Running
Commit ·
8bee9a6
1
Parent(s): 8d80795
removed saves
Browse files- draft_mailscript.py +5 -5
draft_mailscript.py
CHANGED
|
@@ -86,7 +86,7 @@ def bookingcomparison_year2019(qmodel_df : pd.DataFrame()) -> str:
|
|
| 86 |
fig.update_layout(geo=dict(showlakes=False, lakecolor = 'rgba(0,0,0,0)', bgcolor= 'rgba(0,0,0,0)'))
|
| 87 |
fig.update_layout(geo=dict(scope='usa', showlakes=False))
|
| 88 |
fig.update_traces(showlegend=True)
|
| 89 |
-
fig.write_image("/code/static/images/usmap_percentchangefrmyear2019.png", engine='kaleido',format='png')
|
| 90 |
# resize the image to fit in the cell
|
| 91 |
im = Image.open('/code/static/images/usmap_percentchangefrmyear2019.png')
|
| 92 |
width, height = im.size
|
|
@@ -165,7 +165,7 @@ def bookingcomparison_previousweek(qmodel_df: pd.DataFrame()) -> str:
|
|
| 165 |
fig.update_layout(coloraxis_showscale=False)
|
| 166 |
fig.update_layout(geo=dict(showlakes=False, lakecolor = 'rgba(0,0,0,0)', bgcolor= 'rgba(0,0,0,0)'))
|
| 167 |
fig.update_layout(geo=dict(scope='usa', showlakes=False))
|
| 168 |
-
fig.write_image("/code/static/images/usmap_percentchangefrmlastweek.png", engine='kaleido',format='png')
|
| 169 |
|
| 170 |
im = Image.open('/code/static/images/usmap_percentchangefrmlastweek.png')
|
| 171 |
width, height = im.size
|
|
@@ -239,7 +239,7 @@ def actualbookingstats(qmodel_df : pd.DataFrame()) -> str:
|
|
| 239 |
fig.update_layout({'plot_bgcolor': 'rgba(0, 0, 0, 0)','paper_bgcolor': 'rgba(0, 0, 0, 0)'}, xaxis = dict(tickmode = 'linear', tickangle = -45, tick0 = dlatest.Date[0],
|
| 240 |
dtick = 30), legend=dict(orientation="h", yanchor="bottom", y=0.85, xanchor="left", x=0.05, font = dict(size=10)))
|
| 241 |
print("Layout updated ")
|
| 242 |
-
fig.write_image(r"/code/static/images/dailybooking_lineplot.png", engine='kaleido',format='png', height=400, width = 600)
|
| 243 |
# resize the image to fit in the cell - plot_bgcolor = "rgba(211, 245, 244,0.5)",
|
| 244 |
print("image written")
|
| 245 |
im = Image.open('/code/static/images/dailybooking_lineplot.png')
|
|
@@ -289,7 +289,7 @@ def statewiseanalysis_ytd(qmodel_df: pd.DataFrame()) -> str:
|
|
| 289 |
fig.update_layout({'plot_bgcolor': 'rgba(0, 0, 0, 0)','paper_bgcolor': 'rgba(0, 0, 0, 0)'})
|
| 290 |
# fig.update_traces(textposition='inside', textinfo='percent+label')
|
| 291 |
# fig.update_layout(coloraxis_showscale=False)
|
| 292 |
-
fig.write_image("/code/static/images/pie_statesytd.png", engine='kaleido',format='png')
|
| 293 |
|
| 294 |
highstatelist = ', '.join([item for item in avgBookings_state.State[:5].values])
|
| 295 |
last_char_index = highstatelist.rfind(",")
|
|
@@ -335,7 +335,7 @@ def divisionwiseanalysis(qmodel_df: pd.DataFrame) -> str:
|
|
| 335 |
fig.update_layout({'plot_bgcolor': 'rgba(0, 0, 0, 0)','paper_bgcolor': 'rgba(0, 0, 0, 0)'},
|
| 336 |
xaxis = dict(tickmode = 'linear', tickangle = -45),
|
| 337 |
legend=dict(orientation="h", yanchor="bottom", y=0.95, xanchor="right", x=1, font = dict(size=10)))
|
| 338 |
-
fig.write_image(r"/code/static/images/dailybookingdivision_barplot.png", engine='kaleido',format='png', height=400, width = 600)
|
| 339 |
|
| 340 |
df192021['pChangein1921'] = (df192021['2021'] - df192021['2019']) * 100 / df192021['2019']
|
| 341 |
df192021['pChangein2021'] = (df192021['2021'] - df192021['2020']) * 100 / df192021['2019']
|
|
|
|
| 86 |
fig.update_layout(geo=dict(showlakes=False, lakecolor = 'rgba(0,0,0,0)', bgcolor= 'rgba(0,0,0,0)'))
|
| 87 |
fig.update_layout(geo=dict(scope='usa', showlakes=False))
|
| 88 |
fig.update_traces(showlegend=True)
|
| 89 |
+
#fig.write_image("/code/static/images/usmap_percentchangefrmyear2019.png", engine='kaleido',format='png')
|
| 90 |
# resize the image to fit in the cell
|
| 91 |
im = Image.open('/code/static/images/usmap_percentchangefrmyear2019.png')
|
| 92 |
width, height = im.size
|
|
|
|
| 165 |
fig.update_layout(coloraxis_showscale=False)
|
| 166 |
fig.update_layout(geo=dict(showlakes=False, lakecolor = 'rgba(0,0,0,0)', bgcolor= 'rgba(0,0,0,0)'))
|
| 167 |
fig.update_layout(geo=dict(scope='usa', showlakes=False))
|
| 168 |
+
#fig.write_image("/code/static/images/usmap_percentchangefrmlastweek.png", engine='kaleido',format='png')
|
| 169 |
|
| 170 |
im = Image.open('/code/static/images/usmap_percentchangefrmlastweek.png')
|
| 171 |
width, height = im.size
|
|
|
|
| 239 |
fig.update_layout({'plot_bgcolor': 'rgba(0, 0, 0, 0)','paper_bgcolor': 'rgba(0, 0, 0, 0)'}, xaxis = dict(tickmode = 'linear', tickangle = -45, tick0 = dlatest.Date[0],
|
| 240 |
dtick = 30), legend=dict(orientation="h", yanchor="bottom", y=0.85, xanchor="left", x=0.05, font = dict(size=10)))
|
| 241 |
print("Layout updated ")
|
| 242 |
+
#fig.write_image(r"/code/static/images/dailybooking_lineplot.png", engine='kaleido',format='png', height=400, width = 600)
|
| 243 |
# resize the image to fit in the cell - plot_bgcolor = "rgba(211, 245, 244,0.5)",
|
| 244 |
print("image written")
|
| 245 |
im = Image.open('/code/static/images/dailybooking_lineplot.png')
|
|
|
|
| 289 |
fig.update_layout({'plot_bgcolor': 'rgba(0, 0, 0, 0)','paper_bgcolor': 'rgba(0, 0, 0, 0)'})
|
| 290 |
# fig.update_traces(textposition='inside', textinfo='percent+label')
|
| 291 |
# fig.update_layout(coloraxis_showscale=False)
|
| 292 |
+
#fig.write_image("/code/static/images/pie_statesytd.png", engine='kaleido',format='png')
|
| 293 |
|
| 294 |
highstatelist = ', '.join([item for item in avgBookings_state.State[:5].values])
|
| 295 |
last_char_index = highstatelist.rfind(",")
|
|
|
|
| 335 |
fig.update_layout({'plot_bgcolor': 'rgba(0, 0, 0, 0)','paper_bgcolor': 'rgba(0, 0, 0, 0)'},
|
| 336 |
xaxis = dict(tickmode = 'linear', tickangle = -45),
|
| 337 |
legend=dict(orientation="h", yanchor="bottom", y=0.95, xanchor="right", x=1, font = dict(size=10)))
|
| 338 |
+
#fig.write_image(r"/code/static/images/dailybookingdivision_barplot.png", engine='kaleido',format='png', height=400, width = 600)
|
| 339 |
|
| 340 |
df192021['pChangein1921'] = (df192021['2021'] - df192021['2019']) * 100 / df192021['2019']
|
| 341 |
df192021['pChangein2021'] = (df192021['2021'] - df192021['2020']) * 100 / df192021['2019']
|