Advertisement
Guest User

pyinstrument in Streamlit

a guest
Dec 30th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. import streamlit as st
  2. from pyinstrument import Profiler
  3.  
  4. profiler = Profiler()
  5. profiler.start()
  6.  
  7. st.header('aaa')
  8.  
  9. import pandas as pd
  10. import numpy as np
  11.  
  12. file = 'https://raw.githubusercontent.com/CharlyWargnier/CSVHub/main/Tommy-Macys-encoding-ISO-8859-1/CK_categories.csv'
  13. names=['URL','Category']
  14.  
  15. print(file)
  16. df=pd.read_csv(file, encoding='latin-1', names=names, na_filter=False)
  17. df = df.iloc[1:]
  18. df.head()
  19.  
  20. profiler.stop()
  21.  
  22. st.write(profiler.output_text(unicode=True, color=True))
  23. print(profiler.output_text(unicode=True, color=True))
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement