MFF212 commited on
Commit
2def7a1
·
1 Parent(s): a60ed43

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -4
main.py CHANGED
@@ -55,10 +55,13 @@ async def upload_file(file: UploadFile = File(...)):
55
  total_requests=logs_df.shape[0],
56
  redundant_requests=ip_address_count_df.shape[0],
57
  redundant_percentage=(ip_address_count_df.shape[0] / logs_df.shape[0]) * 100,
58
- dataframe_html=ip_address_count_df.head(1000)
59
- .style.background_gradient(subset=['count', 'perc', 'cum_perc'], cmap='cividis')
60
- .format({'count': '{:,}', 'perc': '{:.1%}', 'cum_perc': '{:.1%}'})
61
- .render(),
 
 
 
62
  )
63
 
64
  # # Save result in a new HTML file
 
55
  total_requests=logs_df.shape[0],
56
  redundant_requests=ip_address_count_df.shape[0],
57
  redundant_percentage=(ip_address_count_df.shape[0] / logs_df.shape[0]) * 100,
58
+ dataframe_html = (
59
+ ip_address_count_df.head(1000)
60
+ .style.background_gradient(subset=['count', 'perc', 'cum_perc'], cmap='cividis')
61
+ .format({'count': '{:,}', 'perc': '{:.1%}', 'cum_perc': '{:.1%}'})
62
+ .render()
63
+ .replace('\n', '') # Remove newline characters to format the HTML properly
64
+ )
65
  )
66
 
67
  # # Save result in a new HTML file