This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import pandas_profiling | |
from streamlit_pandas_profiling import st_profile_report | |
import pandas as pd | |
st.set_page_config( | |
page_title='Data Profiler', | |
layout='wide', | |
page_icon='🔍' | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
from streamlit_pandas_profiling import st_profile_report | |
from streamlit import session_state as session | |
import numpy as np | |
import pandas as pd | |
from pandas_profiling import ProfileReport | |
if 'data_uploader_submitted' not in session: | |
session.data_uploader_submitted = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See this thread: https://discuss.streamlit.io/t/best-fastest-practice-to-display-live-2d-data/19895 | |
# Code below is lifted from @andfanilo's comment | |
# https://realpython.com/async-io-python/#using-a-queue | |
import asyncio | |
from datetime import datetime | |
# pip install opencv-python-headless | |
import cv2 | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import random | |
import time | |
import streamlit as st | |
# pip install streamlit-echarts | |
from streamlit_echarts import st_echarts | |
st.title("I ❤️ ECharts") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://discuss.streamlit.io/t/selection-is-sometimes-not-returned-from-custom-widgets/21202 | |
import streamlit as st | |
# https://github.com/PablocFonseca/streamlit-aggrid | |
from st_aggrid import AgGrid, GridOptionsBuilder | |
import pandas as pd | |
import numpy as np | |
np.random.seed(42) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import time | |
st.set_page_config( | |
page_title='Pomodoro', | |
layout='centered', | |
page_icon='🍅' | |
) | |
def count_down(ts): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
# callback to update query param on selectbox change | |
def update_params(): | |
st.experimental_set_query_params(option=st.session_state.qp) | |
options = ["cat", "dog", "mouse", "bat", "duck"] | |
query_params = st.experimental_get_query_params() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import numpy as np | |
c1, c2 = st.columns([1,1]) | |
show_p1 = c1.checkbox('Show panel 1', True) | |
show_p2 = c2.checkbox('Show panel 2', True) | |
panel1 = c1.empty() | |
panel2 = c2.empty() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Since widgets are created anew on each page their values will be initialized to their default values. | |
# I’ve created a separate ‘value cache’ to store values between pages. | |
# (Note, when a widget has a key and you initialize its value with a session state key value other than the widget’s own key value, | |
# Streamlit will complain. Therefore, the widgets don't have a key.) | |
import streamlit as st | |
# Instantiate the Session State Variables | |
if 'cache' not in st.session_state: | |
st.session_state.cache = {'name': '', 'age': '', 'gender': ''} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import base64 | |
import textwrap | |
# https://gist.github.com/treuille/8b9cbfec270f7cda44c5fc398361b3b1 | |
def render_svg(svg): | |
"""Renders the given svg string.""" | |
b64 = base64.b64encode(svg.encode('utf-8')).decode("utf-8") | |
html = r'<img src="data:image/svg+xml;base64,%s"/>' % b64 | |
st.write(html, unsafe_allow_html=True) |
OlderNewer