edwinrajeev commited on
Commit
c44018d
·
1 Parent(s): 2b1001c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -4
app.py CHANGED
@@ -213,7 +213,12 @@ def goda(Case, Hs, Hmax, h, d, h_acc, hc, T, beta, rho, slope_foreshore, B, lamb
213
  #fig = ff.create_table(data_matrix)
214
  #fig.update_layout(width=1000)
215
  title = 'Case Number ' + str(Case) + ' Horizontal table.csv'
216
- pd.DataFrame(data_matrix).to_csv(title, header=None, index=None)
 
 
 
 
 
217
  #fig.write_image()
218
 
219
 
@@ -238,9 +243,14 @@ def goda(Case, Hs, Hmax, h, d, h_acc, hc, T, beta, rho, slope_foreshore, B, lamb
238
  ['Load Elevation', '[ft] MSL', round(Bottom_of_Wall + Load_Distance_from_Bottom,2)]]
239
 
240
  title = 'Case Number ' + str(Case) + ' Suction table.csv'
241
- pd.DataFrame(data_matrix).to_csv(title, header=None, index=None)
242
-
243
-
 
 
 
 
 
244
 
245
 
246
 
 
213
  #fig = ff.create_table(data_matrix)
214
  #fig.update_layout(width=1000)
215
  title = 'Case Number ' + str(Case) + ' Horizontal table.csv'
216
+ csv_string = pd.DataFrame(data_matrix).to_csv(title, header=None, index=None)
217
+
218
+ # Create a download link for the generated CSV file
219
+ b64 = base64.b64encode(csv_string.encode()).decode()
220
+ href = f'<a href="data:file/csv;base64,{b64}" download="{filename}">Download CSV</a>'
221
+ st.markdown(href, unsafe_allow_html=True)
222
  #fig.write_image()
223
 
224
 
 
243
  ['Load Elevation', '[ft] MSL', round(Bottom_of_Wall + Load_Distance_from_Bottom,2)]]
244
 
245
  title = 'Case Number ' + str(Case) + ' Suction table.csv'
246
+ csv_string = pd.DataFrame(data_matrix).to_csv(title, header=None, index=None)
247
+
248
+
249
+ # Create a download link for the generated CSV file
250
+ b64 = base64.b64encode(csv_string.encode()).decode()
251
+ href = f'<a href="data:file/csv;base64,{b64}" download="{filename}">Download CSV</a>'
252
+ st.markdown(href, unsafe_allow_html=True)
253
+
254
 
255
 
256